Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-24343

Spider Left join failed Unknown column 't0.ID' in 'on clause'

Details

    Description

      Hi using spider as federated tables each table on same backend

      MariaDB [SANDBOX]> SELECT * from TEST_RDT_2 JOIN TEST_RDT_3 ON TEST_RDT_2.ID = TEST_RDT_3.ID LEFT OUTER JOIN TEST_RDT_1 ON TEST_RDT_1.ID = TEST_RDT_2.ID;
      ERROR 1054 (42S22): Unknown column 't0.ID' in 'on clause'
      

      MariaDB [SANDBOX]> SELECT * from TEST_RDT_2 LEFT OUTER JOIN TEST_RDT_1 ON TEST_RDT_1.ID = TEST_RDT_2.ID JOIN TEST_RDT_3 ON TEST_RDT_2.ID = TEST_RDT_3.ID ;
      +----+-----------+------+-----------+----+---------+
      | ID | LASTNAME  | ID   | FIRSTNAME | ID | SURNAME |
      +----+-----------+------+-----------+----+---------+
      |  1 | DEMONGEOT |    1 | RICHARD   |  1 | CON     |
      |  2 | VAROQUI   |    2 | STEPHANE  |  2 | MOYEN   |
      +----+-----------+------+-----------+----+---------+
      2 rows in set (0.008 sec)
      

      Depending on the pos of LEFT join in FROM clause it failed or not .

      Attachments

        1. TEST_RDT_1.sql
          2 kB
        2. TEST_RDT_2.sql
          2 kB
        3. TEST_RDT_3.sql
          2 kB
        4. variables_spider.txt
          22 kB

        Activity

          stephane@skysql.com VAROQUI Stephane created issue -
          stephane@skysql.com VAROQUI Stephane made changes -
          Field Original Value New Value
          Attachment TEST_RDT_2.sql [ 55005 ]
          Attachment TEST_RDT_3.sql [ 55006 ]
          Attachment TEST_RDT_1.sql [ 55007 ]
          Attachment variables_spider.txt [ 55008 ]
          stephane@skysql.com VAROQUI Stephane made changes -
          Description Hi using spider as federated tables

          MariaDB [SANDBOX]> SELECT * from TEST_RDT_2 JOIN TEST_RDT_3 ON TEST_RDT_2.ID = TEST_RDT_3.ID LEFT OUTER JOIN TEST_RDT_1 ON TEST_RDT_1.ID = TEST_RDT_2.ID;
          ERROR 1054 (42S22): Unknown column 't0.ID' in 'on clause'


          MariaDB [SANDBOX]> SELECT * from TEST_RDT_2 LEFT OUTER JOIN TEST_RDT_1 ON TEST_RDT_1.ID = TEST_RDT_2.ID JOIN TEST_RDT_3 ON TEST_RDT_2.ID = TEST_RDT_3.ID ;
          +----+-----------+------+-----------+----+---------+
          | ID | LASTNAME | ID | FIRSTNAME | ID | SURNAME |
          +----+-----------+------+-----------+----+---------+
          | 1 | DEMONGEOT | 1 | RICHARD | 1 | CON |
          | 2 | VAROQUI | 2 | STEPHANE | 2 | MOYEN |
          +----+-----------+------+-----------+----+---------+
          2 rows in set (0.008 sec)

          Depending on the pos of LEFT join in FROM clause it failed or not .
          Hi using spider as federated tables

          {code:sql}
          MariaDB [SANDBOX]> SELECT * from TEST_RDT_2 JOIN TEST_RDT_3 ON TEST_RDT_2.ID = TEST_RDT_3.ID LEFT OUTER JOIN TEST_RDT_1 ON TEST_RDT_1.ID = TEST_RDT_2.ID;
          ERROR 1054 (42S22): Unknown column 't0.ID' in 'on clause'
          {code:sql}


          {code:sql}
          MariaDB [SANDBOX]> SELECT * from TEST_RDT_2 LEFT OUTER JOIN TEST_RDT_1 ON TEST_RDT_1.ID = TEST_RDT_2.ID JOIN TEST_RDT_3 ON TEST_RDT_2.ID = TEST_RDT_3.ID ;
          +----+-----------+------+-----------+----+---------+
          | ID | LASTNAME | ID | FIRSTNAME | ID | SURNAME |
          +----+-----------+------+-----------+----+---------+
          | 1 | DEMONGEOT | 1 | RICHARD | 1 | CON |
          | 2 | VAROQUI | 2 | STEPHANE | 2 | MOYEN |
          +----+-----------+------+-----------+----+---------+
          2 rows in set (0.008 sec)
          {code:sql}

          Depending on the pos of LEFT join in FROM clause it failed or not .
          stephane@skysql.com VAROQUI Stephane made changes -
          Description Hi using spider as federated tables

          {code:sql}
          MariaDB [SANDBOX]> SELECT * from TEST_RDT_2 JOIN TEST_RDT_3 ON TEST_RDT_2.ID = TEST_RDT_3.ID LEFT OUTER JOIN TEST_RDT_1 ON TEST_RDT_1.ID = TEST_RDT_2.ID;
          ERROR 1054 (42S22): Unknown column 't0.ID' in 'on clause'
          {code:sql}


          {code:sql}
          MariaDB [SANDBOX]> SELECT * from TEST_RDT_2 LEFT OUTER JOIN TEST_RDT_1 ON TEST_RDT_1.ID = TEST_RDT_2.ID JOIN TEST_RDT_3 ON TEST_RDT_2.ID = TEST_RDT_3.ID ;
          +----+-----------+------+-----------+----+---------+
          | ID | LASTNAME | ID | FIRSTNAME | ID | SURNAME |
          +----+-----------+------+-----------+----+---------+
          | 1 | DEMONGEOT | 1 | RICHARD | 1 | CON |
          | 2 | VAROQUI | 2 | STEPHANE | 2 | MOYEN |
          +----+-----------+------+-----------+----+---------+
          2 rows in set (0.008 sec)
          {code:sql}

          Depending on the pos of LEFT join in FROM clause it failed or not .
          Hi using spider as federated tables

          {code:sql}
          MariaDB [SANDBOX]> SELECT * from TEST_RDT_2 JOIN TEST_RDT_3 ON TEST_RDT_2.ID = TEST_RDT_3.ID LEFT OUTER JOIN TEST_RDT_1 ON TEST_RDT_1.ID = TEST_RDT_2.ID;
          ERROR 1054 (42S22): Unknown column 't0.ID' in 'on clause'
          {code}


          {code:sql}
          MariaDB [SANDBOX]> SELECT * from TEST_RDT_2 LEFT OUTER JOIN TEST_RDT_1 ON TEST_RDT_1.ID = TEST_RDT_2.ID JOIN TEST_RDT_3 ON TEST_RDT_2.ID = TEST_RDT_3.ID ;
          +----+-----------+------+-----------+----+---------+
          | ID | LASTNAME | ID | FIRSTNAME | ID | SURNAME |
          +----+-----------+------+-----------+----+---------+
          | 1 | DEMONGEOT | 1 | RICHARD | 1 | CON |
          | 2 | VAROQUI | 2 | STEPHANE | 2 | MOYEN |
          +----+-----------+------+-----------+----+---------+
          2 rows in set (0.008 sec)
          {code}

          Depending on the pos of LEFT join in FROM clause it failed or not .
          stephane@skysql.com VAROQUI Stephane made changes -
          Description Hi using spider as federated tables

          {code:sql}
          MariaDB [SANDBOX]> SELECT * from TEST_RDT_2 JOIN TEST_RDT_3 ON TEST_RDT_2.ID = TEST_RDT_3.ID LEFT OUTER JOIN TEST_RDT_1 ON TEST_RDT_1.ID = TEST_RDT_2.ID;
          ERROR 1054 (42S22): Unknown column 't0.ID' in 'on clause'
          {code}


          {code:sql}
          MariaDB [SANDBOX]> SELECT * from TEST_RDT_2 LEFT OUTER JOIN TEST_RDT_1 ON TEST_RDT_1.ID = TEST_RDT_2.ID JOIN TEST_RDT_3 ON TEST_RDT_2.ID = TEST_RDT_3.ID ;
          +----+-----------+------+-----------+----+---------+
          | ID | LASTNAME | ID | FIRSTNAME | ID | SURNAME |
          +----+-----------+------+-----------+----+---------+
          | 1 | DEMONGEOT | 1 | RICHARD | 1 | CON |
          | 2 | VAROQUI | 2 | STEPHANE | 2 | MOYEN |
          +----+-----------+------+-----------+----+---------+
          2 rows in set (0.008 sec)
          {code}

          Depending on the pos of LEFT join in FROM clause it failed or not .
          Hi using spider as federated tables each table on same backend

          {code:sql}
          MariaDB [SANDBOX]> SELECT * from TEST_RDT_2 JOIN TEST_RDT_3 ON TEST_RDT_2.ID = TEST_RDT_3.ID LEFT OUTER JOIN TEST_RDT_1 ON TEST_RDT_1.ID = TEST_RDT_2.ID;
          ERROR 1054 (42S22): Unknown column 't0.ID' in 'on clause'
          {code}


          {code:sql}
          MariaDB [SANDBOX]> SELECT * from TEST_RDT_2 LEFT OUTER JOIN TEST_RDT_1 ON TEST_RDT_1.ID = TEST_RDT_2.ID JOIN TEST_RDT_3 ON TEST_RDT_2.ID = TEST_RDT_3.ID ;
          +----+-----------+------+-----------+----+---------+
          | ID | LASTNAME | ID | FIRSTNAME | ID | SURNAME |
          +----+-----------+------+-----------+----+---------+
          | 1 | DEMONGEOT | 1 | RICHARD | 1 | CON |
          | 2 | VAROQUI | 2 | STEPHANE | 2 | MOYEN |
          +----+-----------+------+-----------+----+---------+
          2 rows in set (0.008 sec)
          {code}

          Depending on the pos of LEFT join in FROM clause it failed or not .
          elenst Elena Stepanova made changes -
          Fix Version/s 10.5 [ 23123 ]
          Assignee Kentoku Shiba [ kentoku ]
          nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
          Status Open [ 1 ] Confirmed [ 10101 ]
          nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
          Comment [ I confirmed that the bug is reproducible on 10.5 HEAD.

          The wrong query executed on the data node is the following:
           
          {code:sql}
          info: spider query=select t0.`ID` `ID`,t0.`LASTNAME` `LASTNAME`,t1.`ID` `ID`,t1.`SURNAME` `SURNAME`,t2.`ID` `ID`,t2.`FIRSTNAME` `FIRSTNAME` from `test`.`TEST_RDT_2` t0,`test`.`TEST_RDT_3` t1 left join `test`.`TEST_RDT_1` t2 on (t2.`ID` = t0.`ID`) where (t1.`ID` = t0.`ID`)
          {code} ]
          nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
          Labels not-10.1
          nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
          Labels not-10.1 not-10.2
          nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
          Labels not-10.2 not-10.2 not-10.3
          nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
          Affects Version/s 10.4 [ 22408 ]
          Affects Version/s 10.6 [ 24028 ]
          nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
          Fix Version/s 10.4 [ 22408 ]
          Fix Version/s 10.6 [ 24028 ]
          nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
          Assignee Kentoku Shiba [ kentoku ] Nayuta Yanagisawa [ JIRAUSER47117 ]
          nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
          Status Confirmed [ 10101 ] In Progress [ 3 ]
          nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
          Assignee Nayuta Yanagisawa [ JIRAUSER47117 ] Alexey Botchkov [ holyfoot ]
          Status In Progress [ 3 ] In Review [ 10002 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 116453 ] MariaDB v4 [ 143778 ]
          holyfoot Alexey Botchkov made changes -
          Assignee Alexey Botchkov [ holyfoot ] Nayuta Yanagisawa [ JIRAUSER47117 ]
          Status In Review [ 10002 ] Stalled [ 10000 ]
          nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
          Fix Version/s 10.4.26 [ 27511 ]
          Fix Version/s 10.5.17 [ 27509 ]
          Fix Version/s 10.6.9 [ 27507 ]
          Fix Version/s 10.7.5 [ 27505 ]
          Fix Version/s 10.8.4 [ 27503 ]
          Fix Version/s 10.9.2 [ 27115 ]
          Fix Version/s 10.4 [ 22408 ]
          Fix Version/s 10.5 [ 23123 ]
          Fix Version/s 10.6 [ 24028 ]
          Resolution Fixed [ 1 ]
          Status Stalled [ 10000 ] Closed [ 6 ]

          People

            nayuta-yanagisawa Nayuta Yanagisawa (Inactive)
            stephane@skysql.com VAROQUI Stephane
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.