1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-30765 SHOW TABLES not working properly with lower_case_table_names=2

lower_case_table_names=2 means "table names and database names are
stored as declared, but they are compared in lowercase".
But names of objects in grants are stored in lowercase for any value
of lower_case_table_names. This caused an error when checking grants
for objects containing uppercase letters since table_hash_search()
didn't take into account lower_case_table_names value
This commit is contained in:
Oleg Smirnov
2023-04-24 18:38:42 +07:00
parent 8c6e314ba9
commit 7e7e12e747
4 changed files with 58 additions and 7 deletions

View File

@ -288,3 +288,29 @@ show create database mysql_TEST;
show create table mysql_TEST.T1;
show create table mysql_test.t1;
drop database mysql_TEST;
--echo # MDEV-30765 SHOW TABLES not working properly with
--echo # lower_case_table_names=2
--echo #
create database db1;
use db1;
--echo # lowercase table name
create table `a` (a int);
--echo # uppercase table name
create table `B` (a int);
create user 'mysqltest_1'@'localhost' identified by 'password';
grant select, show view on db1.`a` to 'mysqltest_1'@'localhost';
grant select, show view on db1.`B` to 'mysqltest_1'@'localhost';
connect (conn1, localhost, mysqltest_1, password, test);
connection conn1;
use db1;
show tables;
connection default;
disconnect conn1;
drop user 'mysqltest_1'@'localhost';
drop tables a, B;
drop database db1;