summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests/jsobjtests.cpp
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2015-01-09 18:42:22 -0500
committerMathias Stearn <mathias@10gen.com>2015-01-12 18:49:05 -0500
commita9cacdf8762ed197b1de1fd5d4ff2b47692e5a92 (patch)
tree42cd5cb82cfff42b5ae053fb6d3623029f76c429 /src/mongo/dbtests/jsobjtests.cpp
parent743051d82afc04d9e236a6519c50f7b1526f991d (diff)
downloadmongo-a9cacdf8762ed197b1de1fd5d4ff2b47692e5a92.tar.gz
SERVER-16632 Encode TypeBits along with KeyStrings in WT indexes
This allows covered queries to recover the original data, without collapsing cases that compare equally (such as 1 and 1.0, or 0.0 and -0.0). However, no attempt is made to preserve specific versions of NaN, they all become quiet_NaN(). This resolves this issue discussed in SERVER-16762.
Diffstat (limited to 'src/mongo/dbtests/jsobjtests.cpp')
-rw-r--r--src/mongo/dbtests/jsobjtests.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/dbtests/jsobjtests.cpp b/src/mongo/dbtests/jsobjtests.cpp
index eb441f45d72..d769e66a043 100644
--- a/src/mongo/dbtests/jsobjtests.cpp
+++ b/src/mongo/dbtests/jsobjtests.cpp
@@ -809,6 +809,9 @@ namespace JsobjTests {
b.append( "g" , -123.456 );
+ b.append( "h" , 0.0 );
+ b.append( "i" , -0.0 );
+
BSONObj x = b.obj();
keyTest(x);
@@ -822,6 +825,8 @@ namespace JsobjTests {
ASSERT_EQUALS( "-123.456" , x["g"].toString( false , true ) );
+ ASSERT_EQUALS( "0.0" , x["h"].toString( false , true ) );
+ ASSERT_EQUALS( "-0.0" , x["i"].toString( false , true ) );
}
};