Commit 0ccba62d authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-16465 Invalid (old?) table or database name or hang in...

MDEV-16465 Invalid (old?) table or database name or hang in ha_innobase::delete_table and log semaphore wait upon concurrent DDL with foreign keys

lowercase db and table names before prelocking.

Post-fix for 9180e866

This fixes failures on main.lowercase_table4 on Windows
parent 4cf75706
......@@ -24577,7 +24577,7 @@ void TABLE_LIST::print(THD *thd, table_map eliminated_tables, String *str,
const char *t_alias= alias;
str->append(' ');
if (lower_case_table_names== 1)
if (lower_case_table_names == 1)
{
if (alias && alias[0])
{
......
......@@ -9095,6 +9095,17 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
new_table->file->get_foreign_key_list(thd, &fk_list);
while ((fk= fk_list_it++))
{
if (lower_case_table_names)
{
char buf[NAME_LEN];
uint len;
strmake_buf(buf, fk->referenced_db->str);
len = my_casedn_str(files_charset_info, buf);
thd->make_lex_string(fk->referenced_db, buf, len);
strmake_buf(buf, fk->referenced_table->str);
len = my_casedn_str(files_charset_info, buf);
thd->make_lex_string(fk->referenced_table, buf, len);
}
if (table_already_fk_prelocked(table_list, fk->referenced_db,
fk->referenced_table, TL_READ_NO_INSERT))
continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment