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

spider returns parsing failure on valid left join select by translating the on expression to ()

    XMLWordPrintable

Details

    Description

      This testcase works until 10.5.23 normal.

      With 10.5.24 the select trigger

      ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') where 1' at line 1
      

      Testcase to reproduce:

      docker run -d --name acd --env MARIADB_ROOT_PASSWORD=Maria2024!  mariadb:10.5.24
       
       
      docker exec -it acd bash
      apt update
      apt install mariadb-plugin-spider
       
      mysql -uroot -pMaria2024!
       
      INSTALL SONAME "ha_spider";
       
      create database archive;
      use archive;
       
       
      DROP TABLE if EXISTS `t1` ;
       
      CREATE TABLE `t1` (       `DOC_ID` INT(10) UNSIGNED NOT NULL,       `DOC_NOM` VARCHAR(255) NOT NULL ,       PRIMARY KEY (`DOC_ID`) USING BTREE ) ENGINE=MYISAM ;
       
      DROP TABLE if EXISTS `t2` ;
       
      CREATE TABLE `t2` (       `DAA_ID` INT(10) UNSIGNED NOT NULL,       `DOC_ID` INT(10) UNSIGNED NOT NULL ) ENGINE=MYISAM ;
       
      SET spider_same_server_link= on;
       
      create server s foreign data wrapper mysql options (host "127.0.0.1", database "archive", user "root", password "Maria2016!", PORT 3306 );
       
      DROP TABLE if EXISTS `t2_spider` ;
       
      CREATE TABLE `t2_spider` (       `DAA_ID` INT(10) UNSIGNED NOT NULL,       `DOC_ID` INT(10) UNSIGNED NOT NULL,       PRIMARY KEY (`DAA_ID`) USING BTREE ) COMMENT='wrapper "mysql",srv "s",table "t2"' ENGINE=SPIDER ;
       
       
       
      DROP TABLE if EXISTS `t1_spider` ;
       
       
       CREATE TABLE `t1_spider` (       `DOC_ID` INT(10) UNSIGNED NOT NULL,       `DOC_NOM` VARCHAR(255) NOT NULL ,       PRIMARY KEY (`DOC_ID`) USING BTREE ) COMMENT='wrapper "mysql",srv "s", table "t1"' ENGINE=SPIDER;
       
       
       
      INSERT INTO t1_spider VALUES(1,'oooo');
       
      INSERT INTO t2_spider VALUES(1,1);
       
       
       
      SELECT t2_spider.DAA_ID,t1_spider.DOC_ID FRoM t2_spider LEFT join  t1_spider ON (t2_spider.DOC_ID = t1_spider.DOC_ID)  WHERE t2_spider.DAA_ID = 1;
      

      Attachments

        Issue Links

          Activity

            People

              ycp Yuchen Pei
              Richard Richard Stracke
              Votes:
              1 Vote for this issue
              Watchers:
              6 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.