[MCOL-1855] ColumnStore table whose name contains $ cannot be renamed Created: 2018-11-04  Updated: 2018-11-20  Resolved: 2018-11-20

Status: Closed
Project: MariaDB ColumnStore
Component/s: None
Affects Version/s: 1.1.6
Fix Version/s: 1.2.2

Type: Bug Priority: Major
Reporter: Keita Yaegashi Assignee: Daniel Lee (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Environment:

CentOS Linux release 7.5.1804 (Core)
Server version: 10.2.17-MariaDB-log Columnstore 1.1.6-1


Issue Links:
Problem/Incident
causes MCOL-1883 RENAME crashes when tablename contain... Closed
Sprint: 2018-20

 Description   

MariaDB [testdatabase]> CREATE TABLE rename_able (test INT(11)) ENGINE=Columnstore;
Query OK, 0 rows affected (0.15 sec)
 
MariaDB [testdatabase]> RENAME TABLE rename_able TO yes_renamed;
Query OK, 0 rows affected (0.08 sec)
 
MariaDB [testdatabase]> DROP TABLE yes_renamed;
Query OK, 0 rows affected (1.22 sec)
 
MariaDB [testdatabase]> CREATE TABLE dollar$_table (test INT(11)) ENGINE=Columnstore;
Query OK, 0 rows affected (0.19 sec)
 
MariaDB [testdatabase]> RENAME TABLE dollar$_table TO dollar$_also_renamed;
ERROR 1178 (42000): The storage engine for the table doesn't support The syntax or the data type(s) is not supported by Columnstore. Please check the Columnstore syntax guide for supported syntax or data types.
MariaDB [testdatabase]> DROP TABLE dollar$_table;
Query OK, 0 rows affected (1.66 sec)
 
MariaDB [testdatabase]> CREATE TABLE rename_able (test INT(11)) ENGINE=Columnstore;
Query OK, 0 rows affected (0.17 sec)
 
MariaDB [testdatabase]> RENAME TABLE rename_able TO dollar$;
ERROR 1178 (42000): The storage engine for the table doesn't support The syntax or the data type(s) is not supported by Columnstore. Please check the Columnstore syntax guide for supported syntax or data types.
MariaDB [testdatabase]> DROP TABLE rename_able;
Query OK, 0 rows affected (1.35 sec)
 
MariaDB [testdatabase]> status;
--------------
/usr/local/mariadb/columnstore/mysql/bin/mysql  Ver 15.1 Distrib 10.2.17-MariaDB, for Linux (x86_64) using readline 5.1
 
Connection id:		2607
Current database:	testdatabase
Current user:		testdatabaseadmin@localhost
SSL:			Not in use
Current pager:		stdout
Using outfile:		''
Using delimiter:	;
Server:			MariaDB
Server version:		10.2.17-MariaDB-log Columnstore 1.1.6-1
Protocol version:	10
Connection:		Localhost via UNIX socket
Server characterset:	latin1
Db     characterset:	latin1
Client characterset:	utf8
Conn.  characterset:	utf8
UNIX socket:		/usr/local/mariadb/columnstore/mysql/lib/mysql/mysql.sock
Uptime:			17 days 40 min 19 sec
 
Threads: 10  Questions: 22504  Slow queries: 0  Opens: 5984  Flush tables: 1  Open tables: 52  Queries per second avg: 0.015
--------------
 
MariaDB [testdatabase]> 

The reasons why this issue should be fixed are:

  • In MySQL syntax, $ is available for table name without ` same as _.
  • As CREATE TABLE works with $, RENAME TABLE and ALTER TABLE RENAME also have to work.


 Comments   
Comment by Andrew Hutchings (Inactive) [ 2018-11-04 ]

The second failure is fixed in 1.2.0. The first one generates a different error:

MariaDB [test]> RENAME TABLE dollar$_table TO dollar$_also_renamed;
ERROR 1815 (HY000): Internal error: CAL0001: Alter table Failed:  IDB-2006: 'test.dollar@0024_table' does not exist in Columnstore. 

Comment by Keita Yaegashi [ 2018-11-05 ]

Additionally, this also fails in the same environment (1.1.6-1).

MariaDB [databasetest]> RENAME TABLE dollar$_table TO without_dollar;
ERROR 1178 (42000): The storage engine for the table doesn't support The syntax or the data type(s) is not supported by Columnstore. Please check the Columnstore syntax guide for supported syntax or data types.

Comment by Andrew Hutchings (Inactive) [ 2018-11-05 ]

This is the same problem as the first one and generates the same error as the first one in 1.2.0.

Comment by Roman [ 2018-11-09 ]

The way CS saves table names in Information Schema is crappy. For now it puts the names literally. The stament:

CREATE TABLE t$ (i int) engine=columnstore;

produces

| test         | t$             |      4021 | 2018-11-09    |            1 |          NULL |

in COLUMSTORE_TABLES
Server code doesn't account for this when calling for handler API rename function and it pushes down the stack escaped table names 't@0024' in this case. So the system wise solution is to use escaped table names.

Comment by Roman [ 2018-11-12 ]

Please review.

Comment by Roman [ 2018-11-12 ]

JFYI I've added a pair of additional SQLs for testing purposes in test023. The readme.txt in the test023 has all details.

Comment by Daniel Lee (Inactive) [ 2018-11-20 ]

Build verified: 1.2.2-1 source
/root/columnstore/mariadb-columnstore-server
commit 6bd66f5df21c6a8aa638ca92051bb833f2a8479f
Author: david hill <david.hill@mariadb.com>
Date: Thu Nov 15 09:22:34 2018 -0600
update version
/root/columnstore/mariadb-columnstore-server/mariadb-columnstore-engine
commit 77a3890fb0806bb263feaa53c2994ef86b95f8a0
Merge: ca55a80 a4f4580
Author: Andrew Hutchings <andrew@linuxjedi.co.uk>
Date: Tue Nov 20 15:44:24 2018 +0000
Merge pull request #630 from pleblanc1976/mcol-1847
Mcol 1847. Added ability to specify an absolute value for PM cache size

Verified mentioned test cases. Also verified DDL, DML and queries still work after rename.

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