summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests/documenttests.cpp
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2015-01-02 17:26:58 -0500
committerMathias Stearn <mathias@10gen.com>2015-01-07 11:56:33 -0500
commitf58fa5f78a91ce36d8e31d6730ebfdaa6cc1d5ab (patch)
treebd143554b3ba2f46edaa9a00a12f1e4840c7c142 /src/mongo/dbtests/documenttests.cpp
parentde54755e568481d1bdef37339d899403e3b04d86 (diff)
downloadmongo-f58fa5f78a91ce36d8e31d6730ebfdaa6cc1d5ab.tar.gz
Make BSONObj::woCompare a total ordering
Changes: * Date and Timestamp are now distinct with all Dates before all Timestamps. * Numeric comparisons now correctly handle Doubles and Long > 2**53. * CodeWScope doesn't strcmp BSONObjs or strings which may contain NULs. There should be no changes in any of the cases where woCompare defined a correct total ordering before. The new behavior matches the ordering defined by KeyString. Related tickets: * SERVER-3304 Error comparing Date and Timestamp * SERVER-3719 Total ordering over Longs and Doubles * SERVER-7804 CodeWScope comparisons are broken * SERVER-16632 Change WiredTiger index key format Changes to the comparison function for aggregation will be handled separately as SERVER-16708.
Diffstat (limited to 'src/mongo/dbtests/documenttests.cpp')
-rw-r--r--src/mongo/dbtests/documenttests.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/dbtests/documenttests.cpp b/src/mongo/dbtests/documenttests.cpp
index aa21bbeb4e9..f29b75fd7b2 100644
--- a/src/mongo/dbtests/documenttests.cpp
+++ b/src/mongo/dbtests/documenttests.cpp
@@ -1296,9 +1296,9 @@ namespace DocumentTests {
assertComparison(-1, Value(vector<Value>()), Value(BSONBinData("", 0, MD5Type)));
assertComparison(-1, Value(BSONBinData("", 0, MD5Type)), Value(mongo::OID()));
assertComparison(-1, Value(mongo::OID()), Value(false));
- assertComparison(-1, Value(false), Value(OpTime()));
- assertComparison(0, Value(OpTime()), Value(Date_t(0)));
- assertComparison(-1, Value(Date_t(0)), Value(BSONRegEx("")));
+ assertComparison(-1, Value(false), Value(Date_t(0)));
+ assertComparison(-1, Value(Date_t(0)), Value(OpTime()));
+ assertComparison(-1, Value(OpTime()), Value(BSONRegEx("")));
assertComparison(-1, Value(BSONRegEx("")), Value(BSONDBRef("", mongo::OID())));
assertComparison(-1, Value(BSONDBRef("", mongo::OID())), Value(BSONCode("")));
assertComparison(-1, Value(BSONCode("")), Value(BSONCodeWScope("", BSONObj())));