[MDEV-33058] Table names have wrong case when created with LIKE Created: 2023-12-18  Updated: 2023-12-18

Status: Open
Project: MariaDB Server
Component/s: Data Definition - Create Table
Affects Version/s: 11.2.2
Fix Version/s: 10.11, 11.0, 11.1, 11.2

Type: Bug Priority: Minor
Reporter: June Wallace Assignee: Oleksandr Byelkin
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Windows 10 Pro x64


Attachments: PNG File screenshot.PNG    

 Description   

I have "lower_case_table_names=2" in my.ini. When I create a table and specify its columns, the table is created with my requested capitalization. But when I create a table using "LIKE", the table is created an all lowercase name. In both cases, the columns have the correct case.

Run this script:

CREATE TABLE TestTableA (`ID` INT PRIMARY KEY,`Name` VARCHAR(255));
CREATE TABLE TestTableB LIKE TestTableA;
SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_NAME LIKE 'TestTable%';
DESCRIBE TestTableA;
DESCRIBE TestTableB;

The result says:

+------------+
| TABLE_NAME |
+------------+
| TestTableA |
| testtableb |
+------------+

+-------+--------------+------+-----+---------+-------+
| Field | Type         | Null | Key | Default | Extra |
+-------+--------------+------+-----+---------+-------+
| ID    | int(11)      | NO   | PRI | NULL    |       |
| Name  | varchar(255) | YES  |     | NULL    |       |
+-------+--------------+------+-----+---------+-------+

+-------+--------------+------+-----+---------+-------+
| Field | Type         | Null | Key | Default | Extra |
+-------+--------------+------+-----+---------+-------+
| ID    | int(11)      | NO   | PRI | NULL    |       |
| Name  | varchar(255) | YES  |     | NULL    |       |
+-------+--------------+------+-----+---------+-------+


Generated at Thu Feb 08 10:36:04 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.