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

queryPlanner.winningPlan.inputStage is undefined for a specific query

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.9.0
    • Affects Version/s: 4.9.0
    • Component/s: Querying
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Query 2020-12-28, Query 2021-01-11, Query 2021-01-25, Query 2021-02-08

      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();

       

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

              Created:
              Updated:
              Resolved: