Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SERVER-3375 test that v0 key generation used for v0 indexes
- Loading branch information
Showing
1 changed file
with
14 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,14 @@ | |||
// Check that v0 keys are generated for v0 indexes SERVER-3375 | |||
|
|||
t = db.jstests_indexw; | |||
t.drop(); | |||
|
|||
t.save( {a:[]} ); | |||
assert.eq( 1, t.count( {a:[]} ) ); | |||
t.ensureIndex( {a:1} ); | |||
assert.eq( 1, t.count( {a:[]} ) ); | |||
t.dropIndexes(); | |||
|
|||
// The count result is incorrect - just checking here that v0 key generation is used. | |||
t.ensureIndex( {a:1}, {v:0} ); | |||
assert.eq( 0, t.count( {a:[]} ) ); |