summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/mr.cpp
diff options
context:
space:
mode:
authorMisha Tyulenev <misha@mongodb.com>2015-12-14 19:19:03 -0500
committerMisha Tyulenev <misha@mongodb.com>2015-12-14 19:20:08 -0500
commit3e1a3872c996fcc72c8cf20ea38e9fe86a11caa4 (patch)
treeb91f82e70d61d87d48c00a97b927333011087a7d /src/mongo/db/commands/mr.cpp
parentf10f60e9ccea4615f6e90df302f48c6c9fc23be2 (diff)
downloadmongo-3e1a3872c996fcc72c8cf20ea38e9fe86a11caa4.tar.gz
SERVER-21706 error when mapReduce outputs to config or admin db
Diffstat (limited to 'src/mongo/db/commands/mr.cpp')
-rw-r--r--src/mongo/db/commands/mr.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/db/commands/mr.cpp b/src/mongo/db/commands/mr.cpp
index 2d050c924f1..d0066e7e066 100644
--- a/src/mongo/db/commands/mr.cpp
+++ b/src/mongo/db/commands/mr.cpp
@@ -1566,6 +1566,14 @@ public:
int,
string& errmsg,
BSONObjBuilder& result) {
+ if (!grid.shardRegistry()) {
+ return appendCommandStatus(
+ result,
+ Status(ErrorCodes::CommandNotSupported,
+ str::stream() << "Can not execute mapReduce with output database "
+ << dbname));
+ }
+
boost::optional<DisableDocumentValidation> maybeDisableValidation;
if (shouldBypassDocumentValidationForCommand(cmdObj))
maybeDisableValidation.emplace(txn);