summaryrefslogtreecommitdiff
path: root/jstests/indexp.js
diff options
context:
space:
mode:
authorAaron <aaron@10gen.com>2011-09-12 22:51:36 -0700
committerAaron <aaron@10gen.com>2011-09-13 08:38:19 -0700
commit9cc4038d7ebaddc01a14d41bc3405a06f9fbeed6 (patch)
tree8b76fb136ce05ee6f98860690b53f6394358457c /jstests/indexp.js
parent5410320e7c70616f3321f76859f8575a68230dd3 (diff)
downloadmongo-9cc4038d7ebaddc01a14d41bc3405a06f9fbeed6.tar.gz
SERVER-2864 allow generating a query pattern when there is an invalid range for a field
Diffstat (limited to 'jstests/indexp.js')
-rw-r--r--jstests/indexp.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/jstests/indexp.js b/jstests/indexp.js
index ee511eba5b4..7665e961791 100644
--- a/jstests/indexp.js
+++ b/jstests/indexp.js
@@ -42,17 +42,23 @@ t.save( {a:[1,2]} );
expectRecordedPlan( {a:{$gt:0,$lt:5}}, "a_1" );
// Invalid query with only valid fields used
-if ( 0 ) { // SERVER-2864
+// SERVER-2864
t.drop();
t.ensureIndex( {a:1} );
t.save( {a:1} );
t.find( {a:1,b:{$gt:5,$lt:0}} ).itcount();
-expectRecordedPlan( {a:{$gt:0,$lt:5}}, "a_1" );
-}
+expectRecordedPlan( {a:1,b:{$gt:0,$lt:5}}, "a_1" );
+
+// SERVER-2864
+t.drop();
+t.ensureIndex( {a:1} );
+t.save( {a:1} );
+t.find( {a:{$gt:5,$lt:0}} ).itcount();
+expectNoRecordedPlan( {a:{$gt:0,$lt:5}}, "a_1" );
// Dummy query plan not stored
t.drop();
t.ensureIndex( {a:1} );
t.save( {a:1} );
t.find( {a:{$gt:5,$lt:0}} ).itcount();
-expectNoRecordedPlan( {a:{$gt:5,$lt:0}} ); \ No newline at end of file
+expectNoRecordedPlan( {a:{$gt:5,$lt:0}} );