diff options
author | Geert Bosch <geert@mongodb.com> | 2015-10-26 18:32:35 -0400 |
---|---|---|
committer | Geert Bosch <geert@mongodb.com> | 2015-10-28 22:28:58 -0400 |
commit | adcef363bccdb179e448b47e18ba5541d9a60eab (patch) | |
tree | e6e3e2442c5732716289234e5f55cb9c66462ac8 /jstests/core | |
parent | 5d6d625bd2fad0c52af639ba04c2abbca6abc49e (diff) | |
download | mongo-adcef363bccdb179e448b47e18ba5541d9a60eab.tar.gz |
SERVER-21160: revert woCompare to using unsigned comparison for Timestamp
Diffstat (limited to 'jstests/core')
-rw-r--r-- | jstests/core/compare_timestamps.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/jstests/core/compare_timestamps.js b/jstests/core/compare_timestamps.js new file mode 100644 index 00000000000..6c65d185e8b --- /dev/null +++ b/jstests/core/compare_timestamps.js @@ -0,0 +1,10 @@ +// SERVER-21160: Check that timestamp comparisons are unsigned +(function() { + 'use strict'; + var t = db.compare_timestamps; + t.drop(); + assert.writeOK(t.insert({a: new Timestamp(-2, 3), b:"non-zero"})); + assert.writeOK(t.insert({a: new Timestamp(0, 0), b:"zero"})); + assert.eq(t.find().sort({a:1}).limit(1).next().b, "zero", "timestamp must compare unsigned"); +}()); + |