summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/rename_collection_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/commands/rename_collection_cmd.cpp')
-rw-r--r--src/mongo/db/commands/rename_collection_cmd.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/db/commands/rename_collection_cmd.cpp b/src/mongo/db/commands/rename_collection_cmd.cpp
index 569907eaab2..6385dcc5d0f 100644
--- a/src/mongo/db/commands/rename_collection_cmd.cpp
+++ b/src/mongo/db/commands/rename_collection_cmd.cpp
@@ -144,6 +144,13 @@ public:
return false;
}
+ if (source.isAdminDotSystemDotVersion()) {
+ appendCommandStatus(result,
+ Status(ErrorCodes::IllegalOperation,
+ "renaming admin.system.version is not allowed"));
+ return false;
+ }
+
RenameCollectionOptions options;
options.dropTarget = cmdObj["dropTarget"].trueValue();
options.stayTemp = cmdObj["stayTemp"].trueValue();