1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-32025 Crashes in MDL_key::mdl_key_init with lower-case-table-names=2

Backporting a part of MDEV-32026 (which also fixed MDEV-32025 in 11.3)
from 11.3 to 10.4.

The reported crash happened with --lower-case-table-names=2
on statements like:

ALTER DATABASE Db1 DEFAULT CHARACTER SET utf8;
ALTER DATABASE `#mysql50#D+b1` UPGRADE DATA DIRECTORY NAME;

lock_schema_name() expects a normalized database name
and assert if a non-normalized name comes.

mysql_alter_db_internal() and mysql_upgrade_db() get
a non-normalized database name in the parameter.
Fixing them to normalize the database name before passing
it to lock_schema_name().
This commit is contained in:
Alexander Barkov
2023-09-04 14:12:12 +04:00
parent e913f4e11e
commit 179424db5f
3 changed files with 47 additions and 3 deletions

View File

@ -313,4 +313,20 @@ connection default;
disconnect conn1;
drop user 'mysqltest_1'@'localhost';
drop tables a, B;
drop database db1;
drop database db1;
--echo #
--echo # MDEV-32025 Crashes in MDL_key::mdl_key_init with lower-case-table-names=2
--echo #
CREATE DATABASE `#mysql50#D+b1`;
ALTER DATABASE `#mysql50#D+b1` UPGRADE DATA DIRECTORY NAME;
SHOW CREATE DATABASE `D+b1`;
SHOW CREATE DATABASE `d+b1`;
DROP DATABASE `D+b1`;
CREATE DATABASE Db1;
ALTER DATABASE Db1 DEFAULT CHARACTER SET utf8;
SHOW CREATE DATABASE Db1;
SHOW CREATE DATABASE db1;
DROP DATABASE Db1;