From 15487b84e44669a8741fa28d201b77606de8ef8d Mon Sep 17 00:00:00 2001 From: Andrew Kryczka Date: Thu, 21 Dec 2023 12:22:02 -0800 Subject: [PATCH] fix ldb_cmd_test.cc build with nondefault -DROCKSDB_NAMESPACE (#12173) Summary: I landed https://github.com/facebook/rocksdb/issues/12159 which had the below compiler error when using `-DROCKSDB_NAMESPACE`, which broke the CircleCI "build-linux-static_lib-alt_namespace-status_checked" job: ``` tools/ldb_cmd_test.cc:1213:21: error: 'rocksdb' does not name a type 1213 | int Compare(const rocksdb::Slice& a, const rocksdb::Slice& b) const override { | ^~~~~~~ tools/ldb_cmd_test.cc:1213:35: error: expected unqualified-id before '&' token 1213 | int Compare(const rocksdb::Slice& a, const rocksdb::Slice& b) const override { | ^ tools/ldb_cmd_test.cc:1213:35: error: expected ')' before '&' token 1213 | int Compare(const rocksdb::Slice& a, const rocksdb::Slice& b) const override { | ~ ^ | ) tools/ldb_cmd_test.cc:1213:35: error: expected ';' at end of member declaration 1213 | int Compare(const rocksdb::Slice& a, const rocksdb::Slice& b) const override { | ^ | ; tools/ldb_cmd_test.cc:1213:37: error: 'a' does not name a type 1213 | int Compare(const rocksdb::Slice& a, const rocksdb::Slice& b) const override { | ^ ... ``` Pull Request resolved: https://github.com/facebook/rocksdb/pull/12173 Test Plan: ``` $ make clean && make OPT="-DROCKSDB_NAMESPACE=alternative_rocksdb_ns" ldb_cmd_test -j56 ``` Reviewed By: pdillinger Differential Revision: D52373797 Pulled By: ajkr fbshipit-source-id: 8597aaae65a5333831fef66d85072827c5fb1187 --- tools/ldb_cmd_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ldb_cmd_test.cc b/tools/ldb_cmd_test.cc index 7175ea0d5a3..145a738eb67 100644 --- a/tools/ldb_cmd_test.cc +++ b/tools/ldb_cmd_test.cc @@ -1210,7 +1210,7 @@ TEST_F(LdbCmdTest, RenameDbAndLoadOptions) { class MyComparator : public Comparator { public: - int Compare(const rocksdb::Slice& a, const rocksdb::Slice& b) const override { + int Compare(const Slice& a, const Slice& b) const override { return a.compare(b); } void FindShortSuccessor(std::string* /*key*/) const override {}