summaryrefslogtreecommitdiff
path: root/jstests/remove10.js
blob: cf1dac448ecddbfeebee4bf2066cc246023533ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// SERVER-2009 Update documents with adjacent indexed keys.
// This test doesn't fail, it just prints an invalid warning message.

if ( 0 ) { // SERVER-2009
t = db.jstests_remove10;
t.drop();
t.ensureIndex( {i:1} );

function arr( i ) {
    ret = [];
 	for( j = i; j < i + 11; ++j ) {
        ret.push( j );
    }
    return ret;
}

for( i = 0; i < 1100; i += 11 ) {
    t.save( {i:arr( i )} );
}

s = startParallelShell( 't = db.jstests_remove10; for( j = 0; j < 1000; ++j ) { o = t.findOne( {i:Random.randInt(1100)} ); t.remove( {_id:o._id} ); t.insert( o ); }' );

for( i = 0; i < 200; ++i ) {
    t.find( {i:{$gte:0}} ).hint( {i:1} ).itcount();
}

s();
}