[MDEV-33103] LOCK TABLE t1 AS t2 -- alias is not case sensitive with lower-case-table-names=0 Created: 2023-12-21  Updated: 2024-01-19

Status: Open
Project: MariaDB Server
Component/s: Locking
Affects Version/s: 10.4, 11.4
Fix Version/s: 10.4, 11.4

Type: Bug Priority: Major
Reporter: Alexander Barkov Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-31340 Remove MY_COLLATION_HANDLER::strcasec... In Review

 Description   

I execute this SQL script with a Linux server running with --lower-case-table-names=0:

CREATE OR REPLACE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1);
LOCK TABLE t1 AS t2 READ;
SELECT * FROM t1 AS t2;
UNLOCK TABLES;

+------+
| a    |
+------+
|    1 |
+------+

Now I run this script

LOCK TABLE t1 AS t2 READ;
SELECT * FROM t1 AS T2;
UNLOCK TABLES;

It returns a result set without errors:

+------+
| a    |
+------+
|    1 |
+------+

Looks wrong. The expected behavior would be to return this error:

Table `T2` was not locked with LOCK TABLES"


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