diff options
author | Max Hirschhorn <max.hirschhorn@mongodb.com> | 2016-04-18 10:33:22 -0400 |
---|---|---|
committer | Max Hirschhorn <max.hirschhorn@mongodb.com> | 2016-04-18 10:33:22 -0400 |
commit | d17e4a60f6970defb7d4993e1a85bf74fa30d553 (patch) | |
tree | 79fa7a6ba6d7d6f984955b0725fc413a5498e3e9 /src/mongo | |
parent | ada93b91fee623a25dbf050b744269e4ccee8cba (diff) | |
download | mongo-d17e4a60f6970defb7d4993e1a85bf74fa30d553.tar.gz |
SERVER-23628 Verify field names of index bounds in QueryPlannerTest.
Diffstat (limited to 'src/mongo')
-rw-r--r-- | src/mongo/db/query/query_planner_array_test.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/query/query_planner_collation_test.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/query/query_planner_test_lib.cpp | 3 |
3 files changed, 5 insertions, 2 deletions
diff --git a/src/mongo/db/query/query_planner_array_test.cpp b/src/mongo/db/query/query_planner_array_test.cpp index 6ff77e845f7..d5f7fa741a3 100644 --- a/src/mongo/db/query/query_planner_array_test.cpp +++ b/src/mongo/db/query/query_planner_array_test.cpp @@ -1398,7 +1398,7 @@ TEST_F(QueryPlannerTest, CanCompoundBoundsWhenSharedPrefixIsMultikeyButHasElemMa assertSolutionExists("{cscan: {dir: 1, filter: {a: {$elemMatch: {b: 2, c: 3}}}}}"); assertSolutionExists( "{fetch: {node: {ixscan: {pattern: {'a.b': 1, 'a.c': 1}, " - "bounds: {a: [[2, 2, true, true]], b: [[3, 3, true, true]]}}}}}"); + "bounds: {'a.b': [[2, 2, true, true]], 'a.c': [[3, 3, true, true]]}}}}}"); } TEST_F(QueryPlannerTest, CannotCompoundBoundsWhenSharedPrefixInsideElemMatchIsMultikey) { diff --git a/src/mongo/db/query/query_planner_collation_test.cpp b/src/mongo/db/query/query_planner_collation_test.cpp index 96df025483f..d2ba23b8488 100644 --- a/src/mongo/db/query/query_planner_collation_test.cpp +++ b/src/mongo/db/query/query_planner_collation_test.cpp @@ -207,7 +207,7 @@ TEST_F(QueryPlannerTest, OrQueryCanBeIndexedWhenBothBranchesHaveIndexWithMatchin assertSolutionExists( "{or: {nodes: [" "{fetch: {node: {ixscan: {pattern: {a: 1}, bounds: {a: [['oof','oof',true,true]]}}}}}," - "{fetch: {node: {ixscan: {pattern: {b: 1}, bounds: {a: [['rab','rab',true,true]]}}}}}]}}"); + "{fetch: {node: {ixscan: {pattern: {b: 1}, bounds: {b: [['rab','rab',true,true]]}}}}}]}}"); } TEST_F(QueryPlannerTest, ElemMatchObjectResultsInCorrectComparisonKeyBounds) { diff --git a/src/mongo/db/query/query_planner_test_lib.cpp b/src/mongo/db/query/query_planner_test_lib.cpp index 2ba02902729..c0bdb8e5d3a 100644 --- a/src/mongo/db/query/query_planner_test_lib.cpp +++ b/src/mongo/db/query/query_planner_test_lib.cpp @@ -130,6 +130,9 @@ bool boundsMatch(const BSONObj& testBounds, const IndexBounds trueBounds) { int fieldItCount = 0; while (fieldIt.more()) { BSONElement arrEl = fieldIt.next(); + if (arrEl.fieldNameStringData() != trueBounds.getFieldName(fieldItCount)) { + return false; + } if (arrEl.type() != Array) { return false; } |