0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

SERVER-3304 Clean up index between inserting a Timestamp and a Date

This should be unnecessary once SERVER-3304 is resolved.
This commit is contained in:
Mathias Stearn 2014-09-30 13:40:43 -04:00
parent ceb9f833b8
commit 017d360814

View File

@ -33,22 +33,6 @@ assert.eq( 1, t.find( {a:{$type:6}} ).hint( {a:1} ).itcount() );
t.save( {a:null} ); t.save( {a:null} );
assert.eq( 1, t.find( {a:{$type:6}} ).hint( {a:1} ).itcount() ); assert.eq( 1, t.find( {a:{$type:6}} ).hint( {a:1} ).itcount() );
// Type Timestamp
t.remove({});
t.save( {a:new Timestamp()} );
assert.eq( 1, t.find( {a:{$type:17}} ).itcount() );
if ( 0 ) { // SERVER-3304
assert.eq( 0, t.find( {a:{$type:9}} ).itcount() );
}
// Type Date
t.remove({});
t.save( {a:new Date()} );
if ( 0 ) { // SERVER-3304
assert.eq( 0, t.find( {a:{$type:17}} ).itcount() );
}
assert.eq( 1, t.find( {a:{$type:9}} ).itcount() );
// Type Code // Type Code
t.remove({}); t.remove({});
t.save( {a:function(){var a = 0;}} ); t.save( {a:function(){var a = 0;}} );
@ -58,3 +42,24 @@ assert.eq( 1, t.find( {a:{$type:13}} ).itcount() );
t.remove({}); t.remove({});
t.save( {a:new BinData(0,'')} ); t.save( {a:new BinData(0,'')} );
assert.eq( 1, t.find( {a:{$type:5}} ).itcount() ); assert.eq( 1, t.find( {a:{$type:5}} ).itcount() );
// Type Timestamp
t.remove({});
t.save( {a:new Timestamp()} );
assert.eq( 1, t.find( {a:{$type:17}} ).itcount() );
if ( 0 ) { // SERVER-3304
assert.eq( 0, t.find( {a:{$type:9}} ).itcount() );
}
// Due to SERVER-3304 we need to restart with a completely clean index with no possible traces of
// the Timestamp before inserting the Date.
t.drop();
t.ensureIndex({a:1});
// Type Date
t.remove({});
t.save( {a:new Date()} );
if ( 0 ) { // SERVER-3304
assert.eq( 0, t.find( {a:{$type:17}} ).itcount() );
}
assert.eq( 1, t.find( {a:{$type:9}} ).itcount() );