diff options
author | David Storch <david.storch@10gen.com> | 2016-04-21 16:10:48 -0400 |
---|---|---|
committer | David Storch <david.storch@10gen.com> | 2016-04-21 16:17:13 -0400 |
commit | 1a371955e7a93f846a5ddddb19f33d6b270a3991 (patch) | |
tree | 57fee6e4b54968838d3a7c9782bc4ffa7b355013 | |
parent | 218ded6589ec11ad157812e369c8785e20670f6a (diff) | |
download | mongo-1a371955e7a93f846a5ddddb19f33d6b270a3991.tar.gz |
SERVER-23858 move test of $regex with embedded null to appropriate file
-rw-r--r-- | jstests/core/regex.js | 3 | ||||
-rw-r--r-- | jstests/noPassthrough/server22767.js | 22 |
2 files changed, 3 insertions, 22 deletions
diff --git a/jstests/core/regex.js b/jstests/core/regex.js index 983ead6d733..d6982678f97 100644 --- a/jstests/core/regex.js +++ b/jstests/core/regex.js @@ -34,4 +34,7 @@ assert.throws(function() { t.find({a: {$regex: "ab", $options: "i\0"}}).itcount(); }); + assert.throws(function() { + t.find({key: {$regex: 'abcd\0xyz'}}).explain(); + }); })(); diff --git a/jstests/noPassthrough/server22767.js b/jstests/noPassthrough/server22767.js deleted file mode 100644 index 74efd3eade4..00000000000 --- a/jstests/noPassthrough/server22767.js +++ /dev/null @@ -1,22 +0,0 @@ -// test that the mongos doesn't segfault when it receives malformed BSON -var st = new ShardingTest({shards: 1}); -var testDB = st.getDB('test'); -testDB.test.insert({a: 1}); - -try { - testDB.test.find({key: {$regex: 'abcd\0xyz'}}).explain(); -} catch (e) { - /* - * if the mongos segfaults, the error is the msg: - * "Error: error doing query: failed: network error while attempting to run command 'explain' on - *host '127.0.0.1:20014'" - * - * if the mongos doesn't segfault, the error is the object: - * "Error: explain failed: { - * "code" : 22, - * "ok" : 0, - * "errmsg" : "bson length doesn't match what we found in object with unknown _id" - * }" - */ - assert.eq(22, e.code); -}
\ No newline at end of file |