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

Spider ignores syntax errors in connection string in COMMENT field

    XMLWordPrintable

    Details

      Description

      Spider seems to ignore syntax errors in the connection string that it parses from the table's COMMENT field.

      e.g. if I do the following on the remote server:

      CREATE DATABASE spider_test;
       
      GRANT ALL PRIVILEGES ON spider_test.* TO spider_test@'%' IDENTIFIED BY 'password';
       
      USE spider_test;
       
      CREATE TABLE local_tab (
         id int auto_increment primary key,
         str varchar(50)
      ) ENGINE=InnoDB;
      

      And then the following on the Spider server:

      CREATE SERVER srv1 
        FOREIGN DATA WRAPPER mysql 
      OPTIONS( 
        HOST '172.30.0.249', 
        DATABASE 'spider_test',
        USER 'spider_test',
        PASSWORD 'password'
      );
       
      CREATE DATABASE spider_test;
       
      USE spider_test;
       
      CREATE TABLE spider_tab (
         id int auto_increment primary key,
         str varchar(50)
      ) ENGINE=Spider COMMENT='wrapper "mysql", srv "srv1" table "local_tab"';
      

      Notice that there is a comma missing after "srv1" and before "table" in the COMMENT field. Regardless, Spider does not complain:

      MariaDB [spider_test]> CREATE TABLE spider_tab (
          ->    id int auto_increment primary key,
          ->    str varchar(50)
          -> ) ENGINE=Spider COMMENT='wrapper "mysql", srv "srv1" table "local_tab"';
      Query OK, 0 rows affected (0.01 sec)
      

      And when the table is queried, the resulting error doesn't make the problem obvious:

      MariaDB [spider_test]> SELECT * FROM spider_tab;
      ERROR 12702 (HY000): Remote table 'spider_test.spider_tab' is not found
      

        Attachments

          Activity

            People

            Assignee:
            jacob-mathew Jacob Mathew (Inactive)
            Reporter:
            GeoffMontee Geoff Montee
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: