summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-09-05 19:47:37 +0200
committerSergei Golubchik <serg@mariadb.org>2018-09-06 01:30:10 +0200
commit0ccba62db385139caae514f70b31187bdce0de88 (patch)
tree05ba6a1154d457910cc8534e414ddbf82b16368d /sql/sql_table.cc
parent4cf75706b3893398de515e4ab7b2a95e25cd1a9f (diff)
downloadmariadb-git-0ccba62db385139caae514f70b31187bdce0de88.tar.gz
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 9180e8666b8 This fixes failures on main.lowercase_table4 on Windows
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 640c6b50fbb..5d20ad3967c 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -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;