[SERVER-23628] boundsMatch() in query_planner_test_lib.cpp should verify that the field names of the object match the index key pattern Created: 10/Apr/16  Updated: 26/Apr/16  Resolved: 18/Apr/16

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 3.3.5

Type: Improvement Priority: Trivial - P5
Reporter: Max Hirschhorn Assignee: Max Hirschhorn
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Query 13 (04/22/16)
Participants:

 Description   

There are a couple query planning test cases that specify the correct index bounds but specify field names that don't match the index key pattern. We should amend these test cases and update the QueryPlannerTest fixture to verify that the entire object structure of the IndexBounds matches the query solution specified.

TEST_F(QueryPlannerTest, CanCompoundBoundsWhenSharedPrefixIsMultikeyButHasElemMatch) {
    ...
    assertSolutionExists(
        "{fetch: {node: {ixscan: {pattern: {'a.b': 1, 'a.c': 1}, "
        "bounds: {a: [[2, 2, true, true]], b: [[3, 3, true, true]]}}}}}");
}

TEST_F(QueryPlannerTest, OrQueryCanBeIndexedWhenBothBranchesHaveIndexWithMatchingCollation) {
    ...
    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]]}}}}}]}}");
}



 Comments   
Comment by Githook User [ 18/Apr/16 ]

Author:

{u'username': u'visemet', u'name': u'Max Hirschhorn', u'email': u'max.hirschhorn@mongodb.com'}

Message: SERVER-23628 Verify field names of index bounds in QueryPlannerTest.
Branch: master
https://github.com/mongodb/mongo/commit/d17e4a60f6970defb7d4993e1a85bf74fa30d553

Generated at Thu Feb 08 04:03:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.