diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2016-12-09 17:19:48 -0500 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2016-12-13 14:40:34 -0500 |
commit | b07f96535de47c2da6700074e79ce0ee6eb1ae21 (patch) | |
tree | 51c4b4b03a931b3d2d0310917537a96c36f70779 /src/mongo/db | |
parent | 898c16aad31369e59e3617a3423a5e38e19eb10b (diff) | |
download | mongo-b07f96535de47c2da6700074e79ce0ee6eb1ae21.tar.gz |
SERVER-27381 Remove DBConfig::dropDatabase
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/commands/dbcommands.cpp | 5 | ||||
-rw-r--r-- | src/mongo/db/namespace_string.cpp | 1 | ||||
-rw-r--r-- | src/mongo/db/namespace_string.h | 3 |
3 files changed, 7 insertions, 2 deletions
diff --git a/src/mongo/db/commands/dbcommands.cpp b/src/mongo/db/commands/dbcommands.cpp index 5eea6f7e39f..31d621c788c 100644 --- a/src/mongo/db/commands/dbcommands.cpp +++ b/src/mongo/db/commands/dbcommands.cpp @@ -188,7 +188,8 @@ public: string& errmsg, BSONObjBuilder& result) { // disallow dropping the config database - if (serverGlobalParams.clusterRole == ClusterRole::ConfigServer && (dbname == "config")) { + if (serverGlobalParams.clusterRole == ClusterRole::ConfigServer && + (dbname == NamespaceString::kConfigDb)) { return appendCommandStatus(result, Status(ErrorCodes::IllegalOperation, "Cannot drop 'config' database if mongod started " @@ -197,7 +198,7 @@ public: if ((repl::getGlobalReplicationCoordinator()->getReplicationMode() != repl::ReplicationCoordinator::modeNone) && - (dbname == "local")) { + (dbname == NamespaceString::kLocalDb)) { return appendCommandStatus(result, Status(ErrorCodes::IllegalOperation, "Cannot drop 'local' database while replication " diff --git a/src/mongo/db/namespace_string.cpp b/src/mongo/db/namespace_string.cpp index 9779bdd4139..6ee4d989ceb 100644 --- a/src/mongo/db/namespace_string.cpp +++ b/src/mongo/db/namespace_string.cpp @@ -104,6 +104,7 @@ bool legalClientSystemNS(StringData ns) { constexpr StringData NamespaceString::kAdminDb; constexpr StringData NamespaceString::kLocalDb; +constexpr StringData NamespaceString::kConfigDb; constexpr StringData NamespaceString::kSystemDotViewsCollectionName; const NamespaceString NamespaceString::kConfigCollectionNamespace(kConfigCollection); diff --git a/src/mongo/db/namespace_string.h b/src/mongo/db/namespace_string.h index 8bac89fb362..220c188203c 100644 --- a/src/mongo/db/namespace_string.h +++ b/src/mongo/db/namespace_string.h @@ -63,6 +63,9 @@ public: // Namespace for the local database static constexpr StringData kLocalDb = "local"_sd; + // Namespace for the sharding config database + static constexpr StringData kConfigDb = "config"_sd; + // Name for the system views collection static constexpr StringData kSystemDotViewsCollectionName = "system.views"_sd; |