diff options
author | Eliot Horowitz <eliot@10gen.com> | 2009-08-25 02:24:27 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2009-08-25 02:24:27 -0400 |
commit | 360dc900a0e45481b535662acb5fd9970eba55ab (patch) | |
tree | 57dc94c6b503da78ac9606ebfdcf1752d24be817 | |
parent | 07b2685b464f946910d2536840ae54de78039d35 (diff) | |
download | mongo-360dc900a0e45481b535662acb5fd9970eba55ab.tar.gz |
test for broken indexing thing - doesn't assert - just prints
-rw-r--r-- | dbtests/querytests.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/dbtests/querytests.cpp b/dbtests/querytests.cpp index e2735821842..1a9ec74f170 100644 --- a/dbtests/querytests.cpp +++ b/dbtests/querytests.cpp @@ -640,6 +640,34 @@ namespace QueryTests { } }; + class DifferentNumbers : public ClientBase { + public: + ~DifferentNumbers(){ + client().dropCollection( "unittests.querytests.DifferentNumbers" ); + } + void t( const char * ns ){ + auto_ptr< DBClientCursor > cursor = client().query( ns, Query().sort( "7" ) ); + while ( cursor->more() ){ + BSONObj o = cursor->next(); + cout << " foo " << o << endl; + } + + } + void run() { + const char *ns = "unittests.querytests.DifferentNumbers"; + { BSONObjBuilder b; b.append( "7" , (int)4 ); client().insert( ns , b.obj() ); } + { BSONObjBuilder b; b.append( "7" , (long long)2 ); client().insert( ns , b.obj() ); } + { BSONObjBuilder b; b.appendNull( "7" ); client().insert( ns , b.obj() ); } + { BSONObjBuilder b; b.append( "7" , "b" ); client().insert( ns , b.obj() ); } + { BSONObjBuilder b; b.appendNull( "8" ); client().insert( ns , b.obj() ); } + { BSONObjBuilder b; b.append( "7" , (double)3.7 ); client().insert( ns , b.obj() ); } + + t(ns); + client().ensureIndex( ns , BSON( "7" << 1 ) ); + t(ns); + } + }; + class All : public Suite { public: All() { @@ -674,6 +702,7 @@ namespace QueryTests { add< DirectLocking >(); add< FastCountIn >(); add< EmbeddedArray >(); + add< DifferentNumbers >(); } }; |