summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/dbcommands.cpp
diff options
context:
space:
mode:
authorTommaso Tocci <tommaso.tocci@mongodb.com>2021-03-11 10:01:06 +0100
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-03-16 10:48:04 +0000
commitb134809bd5db091c0517ee0fb4378ad420a5c021 (patch)
tree3716fd90ff7c07fd28ef3dc5a7349b0e76138578 /src/mongo/db/commands/dbcommands.cpp
parent8bc0340b458b363510bd2caca8c1b6a5790f41db (diff)
downloadmongo-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.cpp9
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;