Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-23628

boundsMatch() in query_planner_test_lib.cpp should verify that the field names of the object match the index key pattern

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 3.3.5
    • Affects Version/s: None
    • Component/s: Querying
    • Labels:
      None
    • Fully Compatible
    • Query 13 (04/22/16)

      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]]}}}}}]}}");
      }
      

            Assignee:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Reporter:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: