summaryrefslogtreecommitdiff
path: root/src/mongo/s/commands/commands_public.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/s/commands/commands_public.cpp')
-rw-r--r--src/mongo/s/commands/commands_public.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mongo/s/commands/commands_public.cpp b/src/mongo/s/commands/commands_public.cpp
index a5eb613114c..19f0a97c962 100644
--- a/src/mongo/s/commands/commands_public.cpp
+++ b/src/mongo/s/commands/commands_public.cpp
@@ -366,6 +366,9 @@ public:
const NamespaceString nss(parseNs(dbName, cmdObj));
const auto routingInfo =
uassertStatusOK(Grid::get(opCtx)->catalogCache()->getCollectionRoutingInfo(opCtx, nss));
+ uassert(ErrorCodes::IllegalOperation,
+ "You can't convertToCapped a sharded collection",
+ !routingInfo.cm());
// convertToCapped creates a temp collection and renames it at the end. It will require
// special handling for create collection.