[MCOL-812] Cross engine join and a filter where the string contains a quote character Created: 2017-07-10  Updated: 2017-08-03  Resolved: 2017-08-03

Status: Closed
Project: MariaDB ColumnStore
Component/s: ExeMgr
Affects Version/s: 1.0.9
Fix Version/s: 1.0.11, 1.1.0

Type: Bug Priority: Critical
Reporter: Playax Assignee: Daniel Lee (Inactive)
Resolution: Fixed Votes: 2
Labels: None

Sprint: 2017-15

 Description   

We found a bug when you have a query with cross engine join and a filter where the string contains a quote character:

select r.* from column_store_table c
join innodb_table t on t.id = c.inno_id 
where t.title = '\''

The server returns:

Internal error: fatal error executing query in crossengine client lib(17)(17)

The same happens with backslash char:

select r.* from raw_detection r 
join tracks t on t.id = r.track_id 
where t.title = '\\'
limit 10



 Comments   
Comment by David Thompson (Inactive) [ 2017-07-12 ]

try doing:
where t.title = "''"

i.e using double quotes around the string and having 2 single quotes inside. This works for the test case i have. However it should support the given example format based on: https://mariadb.com/kb/en/mariadb/string-literals/

Comment by Andrew Hutchings (Inactive) [ 2017-07-27 ]

Pull requests for 1.0 and 1.1 as well as regression suites. Should be merged after 1.0.10 is tagged.

For QA, test case in regression suite:

CREATE TABLE test.mcol812a (
  `a` int(11) DEFAULT NULL,
  `b` varchar(10) DEFAULT NULL
) ENGINE=InnoDB; 
CREATE TABLE test.mcol812b (
  `a` int(11) DEFAULT NULL
) ENGINE=Columnstore;
 
insert into test.mcol812a values (1, '\'');
insert into test.mcol812b values (1);
 
select * from test.mcol812b join test.mcol812a on test.mcol812b.a = test.mcol812a.a where test.mcol812a.b='\'';
 
DROP TABLE test.mcol812a;
DROP TABLE test.mcol812b;

Before fix this will error. After fix it will return a row.

Comment by Daniel Lee (Inactive) [ 2017-08-03 ]

Build tested: Github source 1.0.10 and 1.1.0

1.0.10
commit 948b27f00e26266aa6ece760e454195a0ecb10aa
Author: david hill <david.hill@mariadb.com>
Date: Fri Jul 28 10:51:30 2017 -0500

commit 12d98d5a4e941c333ba355fa4c269bb217e41768
Merge: e4cd7d3 2aacb56
Author: David.Hall <david.hall@mariadb.com>
Date: Mon Jul 31 13:10:57 2017 -0500

1.1.0

commit 97284ea4ba429726fe9e3573590464b420501a89
Merge: 4074adf effb08d
Author: Andrew Hutchings <andrew@linuxjedi.co.uk>
Date: Thu Aug 3 10:14:21 2017 +0100

commit 630b113565a624c5a73438d51f2d3422ff7f2e92
Merge: 606846e 6aeb1bf
Author: David.Hall <david.hall@mariadb.com>
Date: Tue Aug 1 12:29:15 2017 -0500

The test case in the ticket worked. I added a test for the '\' and it return an internal error:

1.0.10:

MariaDB [test]> select * from test.mcol812b join test.mcol812a on test.mcol812b.a = test.mcol812a.a where test.mcol812a.b='
';
ERROR 1815 (HY000): Internal error: fatal error executing query in crossengine client lib(17)(17)

1.1.0

MariaDB [test]> select * from test.mcol812b join test.mcol812a on test.mcol812b.a = test.mcol812a.a where test.mcol812a.b='
';
ERROR 1815 (HY000): Internal error: fatal error reading result from crossengine client lib(4294967295)(null pointer)

Comment by Andrew Hutchings (Inactive) [ 2017-08-03 ]

Accidentally missed off a fix for the double slash in my first patch.

Comment by Andrew Hutchings (Inactive) [ 2017-08-03 ]

New pull requests for 1.0, 1.1 and regression suite. Covers the double slash escape.

Comment by Daniel Lee (Inactive) [ 2017-08-03 ]

Builds verified: Github source 1.0.10, 1.1.0

1.0.10

[root@localhost mariadb-columnstore-server]# git show
commit 948b27f00e26266aa6ece760e454195a0ecb10aa
Author: david hill <david.hill@mariadb.com>
Date: Fri Jul 28 10:51:30 2017 -0500

[root@localhost mariadb-columnstore-engine]# git show
commit f54ef0b08fc17972d788cc7ce85f2163c536a839
Merge: b4bc5bc eaf491c
Author: David.Hall <david.hall@mariadb.com>
Date: Thu Aug 3 14:50:01 2017 -0500

1.1.0

[root@localhost ~]# cd columnstore/mariadb-columnstore-server/
[root@localhost mariadb-columnstore-server]# git show
commit 6ed33d194819aaa5f2521c888639f44546fb7ce2
Merge: 97284ea 770537e
Author: Andrew Hutchings <andrew@linuxjedi.co.uk>
Date: Thu Aug 3 20:54:13 2017 +0100

[root@localhost mariadb-columnstore-server]# cd mariadb-columnstore-engine/
[root@localhost mariadb-columnstore-engine]# git show
commit 4f555ad8b3d5c1a2aa1eb67008bfcd93f2884db4
Merge: f2e7fef 2e2d7f3
Author: David.Hall <david.hall@mariadb.com>
Date: Thu Aug 3 14:47:32 2017 -0500

MariaDB [test]> CREATE TABLE test.mcol812a (
-> `a` int(11) DEFAULT NULL,
-> `b` varchar(10) DEFAULT NULL
-> ) ENGINE=InnoDB;
Query OK, 0 rows affected (0.00 sec)

MariaDB [test]> CREATE TABLE test.mcol812b (
-> `a` int(11) DEFAULT NULL
-> ) ENGINE=Columnstore;
Query OK, 0 rows affected (0.20 sec)

MariaDB [test]>
MariaDB [test]> insert into test.mcol812a values (1, '\'');
Query OK, 1 row affected (0.00 sec)

MariaDB [test]> insert into test.mcol812a values (1, '
');
Query OK, 1 row affected (0.01 sec)

MariaDB [test]> insert into test.mcol812b values (1);
Query OK, 1 row affected (0.20 sec)

MariaDB [test]>
MariaDB [test]> select * from test.mcol812b join test.mcol812a on test.mcol812b.a = test.mcol812a.a where test.mcol812a.b='\'';
--------------

a a b

--------------

1 1 '

--------------
1 row in set (0.05 sec)

MariaDB [test]> select * from test.mcol812b join test.mcol812a on test.mcol812b.a = test.mcol812a.a where test.mcol812a.b='
';
--------------

a a b

--------------

1 1 \

--------------
1 row in set (0.02 sec)

MariaDB [test]>
MariaDB [test]>
MariaDB [test]> DROP TABLE test.mcol812a;
Query OK, 0 rows affected (0.01 sec)

MariaDB [test]> DROP TABLE test.mcol812b;
Query OK, 0 rows affected (0.22 sec)

Generated at Thu Feb 08 02:24:00 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.