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

queryPlanner.winningPlan.inputStage is undefined for a specific query

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 4.9.0
    • 4.9.0
    • Querying
    • None
    • Fully Compatible
    • ALL
    • Query 2020-12-28, Query 2021-01-11, Query 2021-01-25, Query 2021-02-08

    Description

      We are going to run atlas proxy with mongodb 4.9+ version in the future. While trying to run the test harness with a new mongod in dev, I found a breaking change. We have this test in the test suite:

       

          log("Index all paths that includes _id");
          db.test5.insert({name: "foo", type: "bar", v: 1, _id: {a: 1, b: 2}});
          db.test5.createIndex({"$**": 1},{wildcardProjection: {name: 0, type: 0, _id: 1}});
          assert.eq("IXSCAN", db.test5.find({"_id.a": 1}).explain(true).queryPlanner.winningPlan.inputStage.stage);
          assert.eq("COLLSCAN", db.test5.find({"name": "foo"}).explain(true).queryPlanner.winningPlan.stage);

      which started failing with this error: `TypeError: db.test5.find(...).explain(...).queryPlanner.winningPlan.inputStage is undefined`

      We have similar tests that pass without a hitch, for example:

       

          log("Index all with excluded subtrees");
          db.test4.insert({name: "foo", type: "bar", v: 1});
          db.test4.createIndex({"$**": 1},{wildcardProjection: {name: 0, type: 0}});
          assert.eq("IXSCAN", db.test4.find({"v": 1}).explain(true).queryPlanner.winningPlan.inputStage.stage);
          assert.eq("COLLSCAN", db.test4.find({"name": "foo"}).explain(true).queryPlanner.winningPlan.stage);
          db.test4.drop();

       

      Attachments

        Issue Links

          Activity

            People

              ted.tuckman@mongodb.com Ted Tuckman
              tanay.abhra@mongodb.com Tanay Abhra
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: