diff options
author | Kyle Suarez <kyle.suarez@mongodb.com> | 2017-03-22 14:10:15 -0400 |
---|---|---|
committer | Kyle Suarez <kyle.suarez@mongodb.com> | 2017-03-23 08:42:49 -0400 |
commit | dea0ff9c2f1dd175aabce90a41c8e4d50e282401 (patch) | |
tree | e2b05c5e4fe1ada000d7afa173ecad5d2df93c42 /src | |
parent | d55eaad5cdfcfbe8458658d39f8c57102c3b3504 (diff) | |
download | mongo-dea0ff9c2f1dd175aabce90a41c8e4d50e282401.tar.gz |
SERVER-19019 prohibit mapReduce on system collections
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/db/commands/mr.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mongo/db/commands/mr.cpp b/src/mongo/db/commands/mr.cpp index 50e6edc44a5..b89c15d3d1f 100644 --- a/src/mongo/db/commands/mr.cpp +++ b/src/mongo/db/commands/mr.cpp @@ -1393,7 +1393,12 @@ public: LOG(1) << "mr ns: " << config.nss; - uassert(16149, "cannot run map reduce without the js engine", getGlobalScriptEngine()); + uassert(16149, "cannot run mapReduce without the js engine", getGlobalScriptEngine()); + uassert(ErrorCodes::InvalidNamespace, + str::stream() << "cannot run mapReduce on the system collection '" + << config.nss.ns() + << "'", + !config.nss.isSystem()); // Prevent sharding state from changing during the MR. unique_ptr<RangePreserver> rangePreserver; |