diff options
author | David Storch <david.storch@10gen.com> | 2014-12-30 23:45:45 -0500 |
---|---|---|
committer | David Storch <david.storch@10gen.com> | 2014-12-30 23:45:45 -0500 |
commit | 2ec561b99947a121cc68172c0aecfef744ca3d2f (patch) | |
tree | fb6698ae9956ab31d384ac87ef18c6bc8d47b5d1 /jstests/core/index_filter_commands.js | |
parent | 55871360dad240de351600b3cab67f9fd07994bc (diff) | |
download | mongo-2ec561b99947a121cc68172c0aecfef744ca3d2f.tar.gz |
SERVER-16577 fix test for queryPlanner.indexFilterSet explain field
Diffstat (limited to 'jstests/core/index_filter_commands.js')
-rw-r--r-- | jstests/core/index_filter_commands.js | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/jstests/core/index_filter_commands.js b/jstests/core/index_filter_commands.js index 048e1cd8178..b422dfffcd5 100644 --- a/jstests/core/index_filter_commands.js +++ b/jstests/core/index_filter_commands.js @@ -150,25 +150,27 @@ print('Plan details after setting filter = ' + tojson(planAfterSetFilter.details // Tests for the 'indexFilterSet' explain field. // -// No filter. -t.getPlanCache().clear(); -assert.eq(false, t.find({z: 1}).explain('queryPlanner').queryPlanner.indexFilterSet); -assert.eq(false, t.find(queryA1, projectionA1).sort(sortA1) - .explain('queryPlanner').queryPlanner.indexFilterSet); - -// With one filter set. -assert.commandWorked(t.runCommand('planCacheSetFilter', {query: {z: 1}, indexes: [{z: 1}]})); -assert.eq(true, t.find({z: 1}).explain('queryPlanner').queryPlanner.indexFilterSet); -assert.eq(false, t.find(queryA1, projectionA1).sort(sortA1) - .explain('queryPlanner').queryPlanner.indexFilterSet); - -// With two filters set. -assert.commandWorked(t.runCommand('planCacheSetFilter', { - query: queryA1, - projection: projectionA1, - sort: sortA1, - indexes: [indexA1B1, indexA1C1] -})); -assert.eq(true, t.find({z: 1}).explain('queryPlanner').queryPlanner.indexFilterSet); -assert.eq(true, t.find(queryA1, projectionA1).sort(sortA1) - .explain('queryPlanner').queryPlanner.indexFilterSet); +if (db.isMaster().msg !== "isdbgrid") { + // No filter. + t.getPlanCache().clear(); + assert.eq(false, t.find({z: 1}).explain('queryPlanner').queryPlanner.indexFilterSet); + assert.eq(false, t.find(queryA1, projectionA1).sort(sortA1) + .explain('queryPlanner').queryPlanner.indexFilterSet); + + // With one filter set. + assert.commandWorked(t.runCommand('planCacheSetFilter', {query: {z: 1}, indexes: [{z: 1}]})); + assert.eq(true, t.find({z: 1}).explain('queryPlanner').queryPlanner.indexFilterSet); + assert.eq(false, t.find(queryA1, projectionA1).sort(sortA1) + .explain('queryPlanner').queryPlanner.indexFilterSet); + + // With two filters set. + assert.commandWorked(t.runCommand('planCacheSetFilter', { + query: queryA1, + projection: projectionA1, + sort: sortA1, + indexes: [indexA1B1, indexA1C1] + })); + assert.eq(true, t.find({z: 1}).explain('queryPlanner').queryPlanner.indexFilterSet); + assert.eq(true, t.find(queryA1, projectionA1).sort(sortA1) + .explain('queryPlanner').queryPlanner.indexFilterSet); +} |