summaryrefslogtreecommitdiff
path: root/jstests/noPassthroughWithMongod
diff options
context:
space:
mode:
authorDavid Hows <howsdav@gmail.com>2015-07-31 16:22:46 +1000
committerDavid Hows <david.hows@mongodb.com>2015-09-24 09:06:41 +1000
commit8efa1322b11574c7d4286cef56e937718aa5e2a1 (patch)
tree8a38fdbb1834f3b1e52d82c7fd173888bfe80baf /jstests/noPassthroughWithMongod
parent08eacba75fb15e397222f20af0bf48b26b54a0d5 (diff)
downloadmongo-8efa1322b11574c7d4286cef56e937718aa5e2a1.tar.gz
SERVER-19671 - Null chars in namespaces cause issues
Diffstat (limited to 'jstests/noPassthroughWithMongod')
-rw-r--r--jstests/noPassthroughWithMongod/newcollection2.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/jstests/noPassthroughWithMongod/newcollection2.js b/jstests/noPassthroughWithMongod/newcollection2.js
index 86d5e9f7a3a..da13f6eadf2 100644
--- a/jstests/noPassthroughWithMongod/newcollection2.js
+++ b/jstests/noPassthroughWithMongod/newcollection2.js
@@ -8,3 +8,10 @@ db.createCollection( baseName, {size:0x1FFC0000-0x10-8192} );
var v = db[ baseName ].validate();
printjson( v );
assert( v.valid );
+
+// Try creating collections with some invalid names and confirm that they
+// don't crash MongoD.
+
+db.runCommand({ applyOps: [ { op: 'u', ns: 'a\0b' } ] });
+var res = db["a\0a"].insert({});
+assert(res.hasWriteError(), "A write to collection a\0a succceeded")