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

Error: expected PlanStage for table DBname.t4, got <nil> SQLState: HY000 ErrorCode: 1105, MongoDB 2.6 server

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: 4.0.2
    • Fix Version/s: None
    • Component/s: Querying
    • Labels:
      None
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      Run SQL like following against MongoDB BI Connector 2.6 on MongoDB 4.0.2

       

      SELECT
      `t1`.`col1` AS `C1`,
      `t1`.`col2` AS `C2`,
      `t1`.`col3` AS `C3`
      FROM
      `dbName`.`Table1` `t2`,
      `dbName`.`Table1` `t3`,
      (
      SELECT
      `col2`,
      1 AS `c2`
      FROM
      `dbName`.`Table1`
      WHERE
      `col2` IN (
      'P1',
      'c' )
      ) `t4`,
      (
      SELECT
      `col1`,
      `col2`,
      `col3`
      FROM
      `dbName`.`tsupply`
      WHERE
      `col1` = 'S1' AND
      `col2` = 'P1'
      ) `t1`
      WHERE
      `t2`.`col2` = `t1`.`col2` AND
      `t2`.`col2` = `t4`.`col2` AND
      `t2`.`col2` = `t3`.`col2` AND
      `t2`.`col2` IN (
      'P1',
      'a' ) AND
      `t3`.`col2` IN (
      'P1',
      'b' )
      ORDER BY
      `C3` ASC

      Show
      Run SQL like following against MongoDB BI Connector 2.6 on MongoDB 4.0.2   SELECT `t1`.`col1` AS `C1`, `t1`.`col2` AS `C2`, `t1`.`col3` AS `C3` FROM `dbName`.`Table1` `t2`, `dbName`.`Table1` `t3`, ( SELECT `col2`, 1 AS `c2` FROM `dbName`.`Table1` WHERE `col2` IN ( 'P1', 'c' ) ) `t4`, ( SELECT `col1`, `col2`, `col3` FROM `dbName`.`tsupply` WHERE `col1` = 'S1' AND `col2` = 'P1' ) `t1` WHERE `t2`.`col2` = `t1`.`col2` AND `t2`.`col2` = `t4`.`col2` AND `t2`.`col2` = `t3`.`col2` AND `t2`.`col2` IN ( 'P1', 'a' ) AND `t3`.`col2` IN ( 'P1', 'b' ) ORDER BY `C3` ASC

      Description

      This issue is specific to MONGO 2.6 server.

      When we try to run the following query against MongoDB BI Connector 2.6 on MongoDB 4.0.2 server then it throws the ERROR: error cross join optimizer: expected PlanStage for table dbcert.t4, got <nil>
      SQLState: HY000
      ErrorCode: 1105

      PLEASE NOTE: This issue does not occur when we use the same query against MongoDB BI Connector 2.7 on MongoDB 4.0.3 and MongoDB BI Connector 2.8 on MongoDB 4.0.5

       

      QUERY:

      SELECT
      `t1`.`col1` AS `C1`,
      `t1`.`col2` AS `C2`,
      `t1`.`col3` AS `C3`
      FROM
      `dbName`.`Table1` `t2`,
      `dbName`.`Table1` `t3`,
      (
      SELECT
      `col2`,
      1 AS `c2`
      FROM
      `dbName`.`Table1`
      WHERE
      `col2` IN (
      'P1',
      'c' )
      ) `t4`,
      (
      SELECT
      `col1`,
      `col2`,
      `col3`
      FROM
      `dbName`.`tsupply`
      WHERE
      `col1` = 'S1' AND
      `col2` = 'P1'
      ) `t1`
      WHERE
      `t2`.`col2` = `t1`.`col2` AND
      `t2`.`col2` = `t4`.`col2` AND
      `t2`.`col2` = `t3`.`col2` AND
      `t2`.`col2` IN (
      'P1',
      'a' ) AND
      `t3`.`col2` IN (
      'P1',
      'b' )
      ORDER BY
      `C3` ASC

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: