[MDEV-15698] Spider ignores syntax errors in connection string in COMMENT field Created: 2018-03-27  Updated: 2020-08-25  Resolved: 2018-05-02

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - Spider
Affects Version/s: 10.2.14
Fix Version/s: 10.2.15, 10.3.7

Type: Bug Priority: Major
Reporter: Geoff Montee (Inactive) Assignee: Jacob Mathew (Inactive)
Resolution: Fixed Votes: 0
Labels: spider


 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



 Comments   
Comment by Jacob Mathew (Inactive) [ 2018-04-14 ]

Kentoku, please review my fix for this problem in commit eae4d1d on my branch.

Comment by Jacob Mathew (Inactive) [ 2018-05-02 ]

As per the review comments, I have extended the new Spider infrastructure to include the parsing of UDF parameters, in addition to the parsing of connection information.

Fix is pushed to 10.3 and 10.2.

Generated at Thu Feb 08 08:23:21 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.