mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-32026 lowercase_table2.test failures in 11.3
Also fixes MDEV-32025 Crashes in MDL_key::mdl_key_init with lower-case-table-names=2 Change overview: - In changes made in MDEV-31948, MDEV-31982 the code path which originaly worked only in case of lower-case-table-names==1 also started to work in case of lower-case-table-names==2 in a mistake. Restoring the original check_db_name() compatible behavior (but without re-using check_db_name() itself). - MDEV-31978 erroneously added a wrong DBUG_ASSERT. Removing. Details: - In mysql_change_db() the database name should be lower-cased only in case of lower_case_table_names==1. It should not be lower-cased for lower_case_table_names==2. The problem was caused by MDEV-31948. The new code version restored the pre-MDEV-31948 behavior, which used check_db_name() behavior. - Passing lower_case_table_names==1 instead of just lower_case_table_names to the "casedn" parameter to DBNameBuffer constructor in sql_parse.cc The database name should not be lower-cased for lower_case_table_names==2. This restores pre-MDEV-31982 behavioir which used check_db_name() here. - Adding a new data type Lex_ident_db_normalized, it stores database names which are both checked and normalized to lower case in case lower_case_table_names==1 and lower_case_table_names==2. - Changing the data type for the "db" parameter to Lex_ident_db_normalized in lock_schema_name(), lock_db_routines(), find_db_tables_and_rm_known_files(). This is to avoid incorrectly passing a non-normalized name in the future. - Restoring the database name normalization in mysql_create_db_internal() and mysql_rm_db_internal() before calling lock_schema_name(). The problem was caused MDEV-31982. - Adding database name normalization in mysql_alter_db_internal() and mysql_upgrade_db(). This fixes MDEV-32026. - Removing a wrong assert in Create_sp_func::create_with_db() was incorrect: DBUG_ASSERT(Lex_ident_fs(*db).ok_for_lower_case_names()); The database name comes to here checked, but not normalized to lower case with lower-case-table-names=2. The assert was erroneously added by MDEV-31978. - Recording lowercase_tables2.results and lowercase_tables4.results according to MDEV-29446 Change SHOW CREATE TABLE to display default collations These tests are skipped on buildbot on all platforms, so this change was forgotten in the patch for MDEV-29446.
This commit is contained in:
57
mysql-test/main/lowercase_table2.result
Normal file → Executable file
57
mysql-test/main/lowercase_table2.result
Normal file → Executable file
@ -14,7 +14,7 @@ SHOW CREATE TABLE T1;
|
||||
Table Create Table
|
||||
T1 CREATE TABLE `T1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
RENAME TABLE T1 TO T2;
|
||||
SHOW TABLES LIKE "T2";
|
||||
Tables_in_test (T2)
|
||||
@ -70,7 +70,7 @@ SHOW CREATE TABLE T1;
|
||||
Table Create Table
|
||||
T1 CREATE TABLE `T1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
RENAME TABLE T1 TO T2;
|
||||
SHOW TABLES LIKE "T2";
|
||||
Tables_in_test (T2)
|
||||
@ -319,18 +319,63 @@ Database (mysql_t%)
|
||||
mysql_TEST
|
||||
show create database mysql_test;
|
||||
Database Create Database
|
||||
mysql_test CREATE DATABASE `mysql_test` /*!40100 DEFAULT CHARACTER SET latin1 */
|
||||
mysql_test CREATE DATABASE `mysql_test` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci */
|
||||
show create database mysql_TEST;
|
||||
Database Create Database
|
||||
mysql_TEST CREATE DATABASE `mysql_TEST` /*!40100 DEFAULT CHARACTER SET latin1 */
|
||||
mysql_TEST CREATE DATABASE `mysql_TEST` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci */
|
||||
show create table mysql_TEST.T1;
|
||||
Table Create Table
|
||||
T1 CREATE TABLE `T1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
show create table mysql_test.t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
drop database mysql_TEST;
|
||||
#
|
||||
# MDEV-32026 lowercase_table2.test failures in 11.3
|
||||
#
|
||||
CREATE DATABASE Db1;
|
||||
SHOW CREATE DATABASE Db1;
|
||||
Database Create Database
|
||||
Db1 CREATE DATABASE `Db1` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci */
|
||||
USE Db1;
|
||||
SELECT DATABASE();
|
||||
DATABASE()
|
||||
Db1
|
||||
DROP DATABASE Db1;
|
||||
CREATE DATABASE Db1;
|
||||
CREATE FUNCTION Db1.f1() RETURNS INT RETURN 10;
|
||||
CREATE FUNCTION db1.f2() RETURNS INT RETURN 10;
|
||||
SELECT db, name FROM mysql.proc WHERE name LIKE '^f[12]';
|
||||
db name
|
||||
SELECT Db1.f1();
|
||||
Db1.f1()
|
||||
10
|
||||
SELECT db1.f2();
|
||||
db1.f2()
|
||||
10
|
||||
DROP DATABASE Db1;
|
||||
#
|
||||
# MDEV-32025 Crashes in MDL_key::mdl_key_init with lower-case-table-names=2
|
||||
#
|
||||
CREATE DATABASE `#mysql50#D+b1`;
|
||||
ALTER DATABASE `#mysql50#D+b1` UPGRADE DATA DIRECTORY NAME;
|
||||
SHOW CREATE DATABASE `D+b1`;
|
||||
Database Create Database
|
||||
D+b1 CREATE DATABASE `D+b1` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci */
|
||||
SHOW CREATE DATABASE `d+b1`;
|
||||
Database Create Database
|
||||
d+b1 CREATE DATABASE `d+b1` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci */
|
||||
DROP DATABASE `D+b1`;
|
||||
CREATE DATABASE Db1;
|
||||
ALTER DATABASE Db1 DEFAULT CHARACTER SET utf8;
|
||||
SHOW CREATE DATABASE Db1;
|
||||
Database Create Database
|
||||
Db1 CREATE DATABASE `Db1` /*!40100 DEFAULT CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci */
|
||||
SHOW CREATE DATABASE db1;
|
||||
Database Create Database
|
||||
db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci */
|
||||
DROP DATABASE Db1;
|
||||
|
Reference in New Issue
Block a user