summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormathisbessamdb <mathis.bessa@mongodb.com>2022-12-20 22:46:37 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-12-21 00:13:50 +0000
commit22d2a4696c86a42662a86752a63fdb4ed9686ff7 (patch)
tree04880ea2d106508878303048428fca01c7b45c30 /src
parentaa841fd244431e841b47232ad9deb668704cc402 (diff)
downloadmongo-22d2a4696c86a42662a86752a63fdb4ed9686ff7.tar.gz
SERVER-71855 ListDatabases returns all databases if no tenantId supplied
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/commands/list_databases.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/mongo/db/commands/list_databases.cpp b/src/mongo/db/commands/list_databases.cpp
index e3aa35d36c2..ecb4694e57d 100644
--- a/src/mongo/db/commands/list_databases.cpp
+++ b/src/mongo/db/commands/list_databases.cpp
@@ -122,17 +122,8 @@ public:
Lock::GlobalLock lk(opCtx, MODE_IS);
CurOpFailpointHelpers::waitWhileFailPointEnabled(
&hangBeforeListDatabases, opCtx, "hangBeforeListDatabases", []() {});
- auto tid = cmd.getDbName().tenantId();
-
- if (gMultitenancySupport &&
- serverGlobalParams.featureCompatibility.isVersionInitialized() &&
- gFeatureFlagRequireTenantID.isEnabled(
- serverGlobalParams.featureCompatibility) &&
- !tid) {
- dbNames = {};
- } else {
- dbNames = storageEngine->listDatabases(tid);
- }
+
+ dbNames = storageEngine->listDatabases(cmd.getDbName().tenantId());
}
std::vector<ListDatabasesReplyItem> items;
int64_t totalSize = list_databases::setReplyItems(opCtx,