Permalink
Browse files

SERVER-3555 assert when or query yield fails to prevent potential inv…

…alid memory access
  • Loading branch information...
1 parent 4184797 commit 294340b750905c6377d97be500336999d1fc46df @astaple astaple committed Aug 18, 2011
Showing with 22 additions and 0 deletions.
  1. +22 −0 jstests/orn.js
View
@@ -0,0 +1,22 @@
+// Test dropping during an $or distinct yield SERVER-3555
+
+t = db.jstests_orn;
+t.drop();
+
+clauses = [];
+for( i = 0; i < 10; ++i ) {
+ clauses.push( {a:{$lte:(i+1)*5000/10},i:49999} );
+ clauses.push( {b:{$lte:(i+1)*5000/10},i:49999} );
+}
+
+p = startParallelShell( 'for( i = 0; i < 15; ++i ) { sleep( 1000 ); db.jstests_orn.drop() }' );
+for( j = 0; j < 5; ++j ) {
+ for( i = 0; i < 5000; ++i ) {
+ t.save( {a:i,i:i} );
+ t.save( {b:i,i:i} );
+ }
+ t.ensureIndex( {a:1} );
+ t.ensureIndex( {b:1} );
+ t.distinct('a',{$or:clauses});
+}
+p();

0 comments on commit 294340b

Please sign in to comment.