diff options
author | Tommaso Tocci <tommaso.tocci@mongodb.com> | 2021-03-11 10:01:06 +0100 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-03-16 10:48:04 +0000 |
commit | b134809bd5db091c0517ee0fb4378ad420a5c021 (patch) | |
tree | 3716fd90ff7c07fd28ef3dc5a7349b0e76138578 /src/mongo/db/commands/dbcommands.cpp | |
parent | 8bc0340b458b363510bd2caca8c1b6a5790f41db (diff) | |
download | mongo-b134809bd5db091c0517ee0fb4378ad420a5c021.tar.gz |
SERVER-55145 Make dropping a nonexistent database a noop
Diffstat (limited to 'src/mongo/db/commands/dbcommands.cpp')
-rw-r--r-- | src/mongo/db/commands/dbcommands.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/mongo/db/commands/dbcommands.cpp b/src/mongo/db/commands/dbcommands.cpp index b6c1790794f..299ebc197c5 100644 --- a/src/mongo/db/commands/dbcommands.cpp +++ b/src/mongo/db/commands/dbcommands.cpp @@ -208,15 +208,10 @@ public: } Status status = dropDatabase(opCtx, dbName.toString()); - DropDatabaseReply reply; - if (status == ErrorCodes::NamespaceNotFound) { - reply.setInfo("database does not exist"_sd); - } else { + if (status != ErrorCodes::NamespaceNotFound) { uassertStatusOK(status); - reply.setDropped(request().getDbName()); } - - return reply; + return {}; } }; } cmdDropDatabase; |