diff options
| author | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2025-02-14 14:26:38 -0300 |
|---|---|---|
| committer | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2025-02-14 14:26:38 -0300 |
| commit | 294bc6ecabf14c09c9bc8644704921dcf97cb44e (patch) | |
| tree | 279b1e0bab53901a1647ac63c1c724f0f789a663 /src/mongo/embedded | |
| parent | 70be7c27a251621187a1de533462ae2bb1e3bd39 (diff) | |
| parent | 1e917fd798aa25b7066d4b414b51184f13d5a092 (diff) | |
Update upstream source from tag 'upstream/6.0.10'debian/6.0.10-1
Update to upstream version '6.0.10'
with Debian dir 2d176fa254eee97b139f712fec5709641335a8c3
Diffstat (limited to 'src/mongo/embedded')
| -rw-r--r-- | src/mongo/embedded/SConscript | 3 | ||||
| -rw-r--r-- | src/mongo/embedded/embedded.cpp | 4 | ||||
| -rw-r--r-- | src/mongo/embedded/mongo_embedded/mongo_embedded_test.cpp | 105 | ||||
| -rw-r--r-- | src/mongo/embedded/stitch_support/SConscript | 2 |
4 files changed, 3 insertions, 111 deletions
diff --git a/src/mongo/embedded/SConscript b/src/mongo/embedded/SConscript index 879b5033969..c98aa087db4 100644 --- a/src/mongo/embedded/SConscript +++ b/src/mongo/embedded/SConscript @@ -88,8 +88,7 @@ env.Library( '$BUILD_DIR/mongo/db/commands/standalone', '$BUILD_DIR/mongo/db/concurrency/lock_manager', '$BUILD_DIR/mongo/db/fcv_op_observer', - '$BUILD_DIR/mongo/db/index/index_access_method_factory', - '$BUILD_DIR/mongo/db/index/index_access_methods', + '$BUILD_DIR/mongo/db/index/index_access_method', '$BUILD_DIR/mongo/db/index_builds_coordinator_interface', '$BUILD_DIR/mongo/db/logical_session_cache', '$BUILD_DIR/mongo/db/logical_session_cache_impl', diff --git a/src/mongo/embedded/embedded.cpp b/src/mongo/embedded/embedded.cpp index 20395926254..32be7c57efc 100644 --- a/src/mongo/embedded/embedded.cpp +++ b/src/mongo/embedded/embedded.cpp @@ -47,7 +47,6 @@ #include "mongo/db/concurrency/lock_state.h" #include "mongo/db/dbdirectclient.h" #include "mongo/db/global_settings.h" -#include "mongo/db/index/index_access_method_factory_impl.h" #include "mongo/db/kill_sessions_local.h" #include "mongo/db/logical_session_cache_impl.h" #include "mongo/db/op_observer_impl.h" @@ -103,7 +102,6 @@ MONGO_INITIALIZER_GENERAL(ForkServer, ("EndStartupOptionHandling"), ("default")) void setUpCatalog(ServiceContext* serviceContext) { DatabaseHolder::set(serviceContext, std::make_unique<DatabaseHolderImpl>()); - IndexAccessMethodFactory::set(serviceContext, std::make_unique<IndexAccessMethodFactoryImpl>()); Collection::Factory::set(serviceContext, std::make_unique<CollectionImpl::FactoryImpl>()); } @@ -128,7 +126,7 @@ GlobalInitializerRegisterer filterAllowedIndexFieldNamesEmbeddedInitializer( "FilterAllowedIndexFieldNamesEmbedded", [](InitializerContext* service) { index_key_validate::filterAllowedIndexFieldNames = - [](std::set<StringData>& allowedIndexFieldNames) { + [](std::map<StringData, std::set<IndexType>>& allowedIndexFieldNames) { allowedIndexFieldNames.erase(IndexDescriptor::kBackgroundFieldName); allowedIndexFieldNames.erase(IndexDescriptor::kExpireAfterSecondsFieldName); }; diff --git a/src/mongo/embedded/mongo_embedded/mongo_embedded_test.cpp b/src/mongo/embedded/mongo_embedded/mongo_embedded_test.cpp index 7d728bf451a..0e5c1a9dadf 100644 --- a/src/mongo/embedded/mongo_embedded/mongo_embedded_test.cpp +++ b/src/mongo/embedded/mongo_embedded/mongo_embedded_test.cpp @@ -550,111 +550,6 @@ TEST_F(MongodbCAPITest, InsertAndUpdate) { ASSERT(outputBSON2.getIntField("nModified") == 1); } -TEST_F(MongodbCAPITest, RunListCommands) { - auto client = createClient(); - - std::vector<std::string> allowlist = {"_hashBSONElement", - "_killOperations", - "aggregate", - "buildInfo", - "collMod", - "collStats", - "configureFailPoint", - "count", - "create", - "createIndexes", - "currentOp", - "dataSize", - "dbStats", - "delete", - "distinct", - "drop", - "dropDatabase", - "dropIndexes", - "echo", - "endSessions", - "explain", - "find", - "findAndModify", - "getLastError", - "getMore", - "getParameter", - "httpClientRequest", - "insert", - "isMaster", - "killCursors", - "killOp", - "killSessions", - "killAllSessions", - "killAllSessionsByPattern", - "listCollections", - "listCommands", - "listDatabases", - "listIndexes", - "lockInfo", - "logMessage", - "ping", - "planCacheClear", - "planCacheClearFilters", - "planCacheListFilters", - "planCacheSetFilter", - "reIndex", - "refreshLogicalSessionCacheNow", - "refreshSessions", - "renameCollection", - "repairDatabase", - "serverStatus", - "setParameter", - "sleep", - "startSession", - "update", - "validate", - "validateDBMetadata", - "waitForFailPoint", - "whatsmysni"}; - - std::sort(allowlist.begin(), allowlist.end()); - - mongo::BSONObj listCommandsObj = mongo::fromjson("{ listCommands: 1 }"); - auto listCommandsOpMsg = mongo::OpMsgRequest::fromDBAndBody("db_name", listCommandsObj); - auto output = performRpc(client, listCommandsOpMsg); - auto commandsBSON = output["commands"]; - std::vector<std::string> commands; - for (const auto& element : commandsBSON.Obj()) { - commands.push_back(element.fieldNameStringData().toString()); - } - std::sort(commands.begin(), commands.end()); - - std::vector<std::string> missing; - std::vector<std::string> unsupported; - std::set_difference(allowlist.begin(), - allowlist.end(), - commands.begin(), - commands.end(), - std::back_inserter(missing)); - std::set_difference(commands.begin(), - commands.end(), - allowlist.begin(), - allowlist.end(), - std::back_inserter(unsupported)); - - if (!missing.empty()) { - std::cout << "\nMissing commands from the embedded binary:\n"; - } - for (auto&& cmd : missing) { - std::cout << cmd << "\n"; - } - if (!unsupported.empty()) { - std::cout << "\nUnsupported commands in the embedded binary:\n"; - } - for (auto&& cmd : unsupported) { - std::cout << cmd << "\n"; - } - - ASSERT(missing.empty()) << mongo::StringSplitter::join(missing, ", "); - ASSERT(unsupported.empty()) << mongo::StringSplitter::join(unsupported, ", "); -} - // This test is temporary to make sure that only one database can be created // This restriction may be relaxed at a later time TEST_F(MongodbCAPITest, CreateMultipleDBs) { diff --git a/src/mongo/embedded/stitch_support/SConscript b/src/mongo/embedded/stitch_support/SConscript index 8ab94cb83c9..7206c33a1ce 100644 --- a/src/mongo/embedded/stitch_support/SConscript +++ b/src/mongo/embedded/stitch_support/SConscript @@ -43,7 +43,7 @@ stitchSupportTargets = stitchSupportEnv.Library( 'stitch_support.cpp', ], LIBDEPS_PRIVATE=[ - '$BUILD_DIR/mongo/db/index/index_access_methods', + '$BUILD_DIR/mongo/db/index/index_access_method', '$BUILD_DIR/mongo/db/matcher/expressions', '$BUILD_DIR/mongo/db/ops/parsed_update', '$BUILD_DIR/mongo/db/query/collation/collator_factory_icu', |
