[MCOL-1309] SystemCatalog.getTable doesn't support escaped databases with `` Created: 2018-03-27  Updated: 2023-10-26  Resolved: 2019-07-10

Status: Closed
Project: MariaDB ColumnStore
Component/s: MariaDB Server
Affects Version/s: 1.1.3
Fix Version/s: Icebox

Type: Bug Priority: Major
Reporter: Jens Röwekamp (Inactive) Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None

Attachments: File MCSAPITest.cxx     File t1.sql    
Issue Links:
Blocks
blocks MCOL-1307 Adapter can't recognize database sche... Closed

 Description   

sysCat.getTable("`escaped database`","table") throws `escaped database`.table not found error.

Provided SQL file and C++ file to reproduce the error.

In addition mcsmyql has a strange behaviour regarding escaped database names too.

--initialization to reproduce
CREATE DATABASE `'test'`;
USE `'test'`
CREATE TABLE t1 (i int) engine=COLUMNSTORE;
CREATE TABLE test.t1 (i int) engine=COLUMNSTORE;
 
--Why does this not work?
CREATE TABLE `'test'`.t2 (i int) engine=COLUMNSTORE;
 
--But this works
CREATE TABLE `'test'`.t3 (i int);
SELECT * FROM `'test'`.t3;
SELECT * FROM `'test'`.t1;



 Comments   
Comment by Andrew Hutchings (Inactive) [ 2018-03-28 ]

I believe the failed CREATE TABLE statement should be fixed in 1.2 amongst the DDL parsing fixes that drrtuy has implemented.

As for the sysCat command, yes, that will fail as we are doing a basic string match. Is this behaviour required for one of the connectors?

Comment by Jens Röwekamp (Inactive) [ 2018-03-28 ]

elena.kotsinova mentioned it in her test cases for the PDI plugin in MCOL-1307.

There we currently don't support databases that need escaping like `'test'`.

Comment by Jens Röwekamp (Inactive) [ 2018-03-28 ]

Never mind, sysCat.getTable("'test'","table") without escaping characters works.

So its not a functionality bugfix but just a usability bugfix.

I could as well just simply fix it only in the PDI plugin by not allowing escaping characters for database names.

Just depends where we want to fix this issue, in the PDI plugin or bulk write sdk.

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