Skip to content

Commit d831cef

Browse files
committed
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
Disable "Invalid (old?) table or database name" warning when converting table names in InnoDB's get_foreign_key_info(). Because a name can be a temporary table name during the ALTER TABLE, and some other thread can do SHOW CREATE TABLE for the other table in the FK relationships _anytime_.
1 parent 9180e86 commit d831cef

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

storage/innobase/handler/ha_innodb.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12429,7 +12429,7 @@ get_foreign_key_info(
1242912429

1243012430
/* Referenced (parent) table name */
1243112431
ptr = dict_remove_db_name(foreign->referenced_table_name);
12432-
len = filename_to_tablename(ptr, name_buff, sizeof(name_buff));
12432+
len = filename_to_tablename(ptr, name_buff, sizeof(name_buff), 1);
1243312433
f_key_info.referenced_table = thd_make_lex_string(
1243412434
thd, 0, name_buff, static_cast<unsigned int>(len), 1);
1243512435

@@ -12445,7 +12445,7 @@ get_foreign_key_info(
1244512445

1244612446
/* Dependent (child) table name */
1244712447
ptr = dict_remove_db_name(foreign->foreign_table_name);
12448-
len = filename_to_tablename(ptr, name_buff, sizeof(name_buff));
12448+
len = filename_to_tablename(ptr, name_buff, sizeof(name_buff), 1);
1244912449
f_key_info.foreign_table = thd_make_lex_string(
1245012450
thd, 0, name_buff, static_cast<unsigned int>(len), 1);
1245112451

storage/xtradb/handler/ha_innodb.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13295,7 +13295,7 @@ get_foreign_key_info(
1329513295

1329613296
/* Referenced (parent) table name */
1329713297
ptr = dict_remove_db_name(foreign->referenced_table_name);
13298-
len = filename_to_tablename(ptr, name_buff, sizeof(name_buff));
13298+
len = filename_to_tablename(ptr, name_buff, sizeof(name_buff), 1);
1329913299
f_key_info.referenced_table = thd_make_lex_string(
1330013300
thd, 0, name_buff, static_cast<unsigned int>(len), 1);
1330113301

@@ -13311,7 +13311,7 @@ get_foreign_key_info(
1331113311

1331213312
/* Dependent (child) table name */
1331313313
ptr = dict_remove_db_name(foreign->foreign_table_name);
13314-
len = filename_to_tablename(ptr, name_buff, sizeof(name_buff));
13314+
len = filename_to_tablename(ptr, name_buff, sizeof(name_buff), 1);
1331513315
f_key_info.foreign_table = thd_make_lex_string(
1331613316
thd, 0, name_buff, static_cast<unsigned int>(len), 1);
1331713317

0 commit comments

Comments
 (0)