Files
mongo/jstests/core/sortj.js
Siyuan Zhou 3660343e0b SERVER-12127 migrate js tests to jscore suite when not related to writes
Migrate js tests starting from j-z.
Include SERVER-12920 Update use_power_of_2.js

Signed-off-by: Matt Kangas <matt.kangas@mongodb.com>
2014-03-03 22:54:10 -05:00

17 lines
401 B
JavaScript

// Test an in memory sort memory assertion after a plan has "taken over" in the query optimizer
// cursor.
t = db.jstests_sortj;
t.drop();
t.ensureIndex( { a:1 } );
big = new Array( 100000 ).toString();
for( i = 0; i < 1000; ++i ) {
t.save( { a:1, b:big } );
}
assert.throws( function() {
t.find( { a:{ $gte:0 }, c:null } ).sort( { d:1 } ).itcount();
} );
t.drop();