summaryrefslogtreecommitdiff
path: root/jstests/sharding
diff options
context:
space:
mode:
authorAndrew Morrow <acm@10gen.com>2013-12-10 15:19:50 -0500
committerAndrew Morrow <acm@10gen.com>2013-12-12 11:20:22 -0500
commit6a13bdab4b65807884fe975d669ebf234b4fd6f2 (patch)
tree2061d8ac09c74fabf5a95ef2c7efbfe2e167873b /jstests/sharding
parentc5ca62db83eaf23f61f17504c570ffb9f3e50d9d (diff)
downloadmongo-6a13bdab4b65807884fe975d669ebf234b4fd6f2.tar.gz
SERVER-9074 Fix incorrect test cases in shard key immutability test
Diffstat (limited to 'jstests/sharding')
-rw-r--r--jstests/sharding/shard_key_immutable.js14
1 files changed, 4 insertions, 10 deletions
diff --git a/jstests/sharding/shard_key_immutable.js b/jstests/sharding/shard_key_immutable.js
index 50f07bcadab..fbccc6fc809 100644
--- a/jstests/sharding/shard_key_immutable.js
+++ b/jstests/sharding/shard_key_immutable.js
@@ -401,17 +401,14 @@ doc = compoundColl.findOne();
delete doc._id;
assert(friendlyEqual(doc, { a: 100, b: 100 }), 'doc changed: ' + tojson(doc));
-// Inspecting query and update alone is not enough to tell whether a shard key will change.
-/*
compoundColl.remove({}, false);
compoundColl.insert({ a: 100, b: 100 });
compoundColl.update({ b: 100 }, { a: 100 }, false);
gle = db.runCommand({ getLastError: 1 });
-assert(gle.err == null, 'gleObj: ' + tojson(gle));
+assert(gle.err != null, 'gleObj: ' + tojson(gle));
doc = compoundColl.findOne();
delete doc._id;
assert(friendlyEqual(doc, { a: 100, b: 100 }), 'doc changed: ' + tojson(doc));
-*/
compoundColl.remove({}, false);
compoundColl.insert({ a: 100, b: 100 });
@@ -859,15 +856,12 @@ assert(gle.err != null, 'gleObj: ' + tojson(gle));
doc = compoundColl.findOne();
assert(doc == null, 'doc was upserted: ' + tojson(doc));
-/*
compoundColl.remove({}, false);
compoundColl.update({ _id: 1 }, { $set: { a: 1, b: 1 }}, true, true);
gle = db.runCommand({ getLastError: 1 });
-assert(gle.err == null, 'gleObj: ' + tojson(gle));
+assert(gle.err != null, 'gleObj: ' + tojson(gle));
doc = compoundColl.findOne();
-delete doc._id;
-assert(friendlyEqual(doc, { a: 1, b: 1 }), 'bad doc: ' + tojson(doc));
-*/
+assert(doc == null, 'doc was upserted: ' + tojson(doc));
//
// Dotted query update
@@ -1053,7 +1047,7 @@ gle = db.runCommand({ getLastError: 1 });
assert(gle.err == null, 'gleObj: ' + tojson(gle));
doc = dotColl.findOne();
delete doc._id;
-assert(friendlyEqual(doc, { x: { a: 100, 2: 3 }}), 'bad doc: ' + tojson(doc));
+assert(friendlyEqual(doc, { x: { a: 100, b: 2 }}), 'bad doc: ' + tojson(doc));
*/
dotColl.remove({}, false);