summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Guo <robert.guo@10gen.com>2016-02-05 15:43:42 -0500
committerRobert Guo <robert.guo@10gen.com>2016-02-05 15:43:42 -0500
commitc7fb8dfebd386d3e995f1d14343291c5b7898c65 (patch)
tree825868be0271f58eff4fbfb425f08a2dee8aefcc
parentc259a7ef3886ae645a58a36a22a9e6e5e45875c3 (diff)
downloadmongo-c7fb8dfebd386d3e995f1d14343291c5b7898c65.tar.gz
Revert "SERVER-21388 validate captrunc argument"
This reverts commit f2a67700a3cfd9e401feb4a17931ea3209f10e4b.
-rw-r--r--jstests/noPassthroughWithMongod/capped_truncate.js7
-rw-r--r--src/mongo/db/commands/test_commands.cpp6
2 files changed, 0 insertions, 13 deletions
diff --git a/jstests/noPassthroughWithMongod/capped_truncate.js b/jstests/noPassthroughWithMongod/capped_truncate.js
index ce559919b80..ddba2420bba 100644
--- a/jstests/noPassthroughWithMongod/capped_truncate.js
+++ b/jstests/noPassthroughWithMongod/capped_truncate.js
@@ -11,13 +11,6 @@
autoIndexId: true }));
var t = db.capped_truncate;
- // It is an error to remove a non-positive number of documents.
- assert.commandFailed(db.runCommand({ captrunc: "capped_truncate", n: -1 }),
- "captrunc didn't return an error when attempting to remove a negative " +
- "number of documents");
- assert.commandFailed(db.runCommand({ captrunc: "capped_truncate", n: 0 }),
- "captrunc didn't return an error when attempting to remove 0 documents");
-
for (var j = 1; j <= 10; j++) {
assert.writeOK(t.insert({x:j}));
}
diff --git a/src/mongo/db/commands/test_commands.cpp b/src/mongo/db/commands/test_commands.cpp
index 9a2c5cec5cd..3cbc36519ba 100644
--- a/src/mongo/db/commands/test_commands.cpp
+++ b/src/mongo/db/commands/test_commands.cpp
@@ -189,13 +189,7 @@ public:
int n = cmdObj.getIntField("n");
bool inc = cmdObj.getBoolField("inc"); // inclusive range?
- if (n <= 0) {
- return appendCommandStatus(result,
- {ErrorCodes::BadValue, "n must be a positive integer"});
- }
-
Client::WriteContext ctx(txn, nss.ns());
-
Collection* collection = ctx.getCollection();
massert(13417, "captrunc collection not found or empty", collection);