diff options
author | Eliot Horowitz <eliot@10gen.com> | 2009-11-22 23:59:45 -0500 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2009-11-22 23:59:45 -0500 |
commit | f04da2c9ab9766e2c49bc2bf8bad6f73a2dfca28 (patch) | |
tree | dae7b9853ff759b94bc89bcc74b00733f26bc21d /jstests/remove7.js | |
parent | 1e388b0e6880adef288498d6b2e6d880879cef5d (diff) | |
download | mongo-f04da2c9ab9766e2c49bc2bf8bad6f73a2dfca28.tar.gz |
test for bad btree case
Diffstat (limited to 'jstests/remove7.js')
-rw-r--r-- | jstests/remove7.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/jstests/remove7.js b/jstests/remove7.js new file mode 100644 index 00000000000..a8e3c1261a7 --- /dev/null +++ b/jstests/remove7.js @@ -0,0 +1,31 @@ + +t = db.remove7 +t.drop(); + + + +function getTags( n ){ + n = n || 5; + var a = []; + for ( var i=0; i<n; i++ ){ + var v = Math.ceil( 20 * Math.random() ); + a.push( v ); + } + + return a; +} + +for ( i=0; i<1000; i++ ){ + t.save( { tags : getTags() } ); +} + +t.ensureIndex( { tags : 1 } ); + +for ( i=0; i<200; i++ ){ + for ( var j=0; j<10; j++ ) + t.save( { tags : getTags( 100 ) } ); + //t.remove( { tags : { $in : getTags( 10 ) } } ); + var o = db.getLastErrorObj(); + assert.isnull( o.err , "error: " + tojson( o ) ); +} + |