#00x000000000141c738 in PFS_atomic::store_u32 (ptr=0x7f290f3dc9c0, value=4) at /home/midenok/src/mariadb/10.3/src/storage/perfschema/pfs_atomic.h:76
#10x000000000141c60f in pfs_lock::allocated_to_free (this=0x7f290f3dc9c0) at /home/midenok/src/mariadb/10.3/src/storage/perfschema/pfs_lock.h:209
#20x000000000142da65 in drop_table_share (thread=0x7f290e14db40, temporary=false, schema_name=0x7f289c014370"test", schema_name_length=4, table_name=0x7f289c013ce0"yt4", table_name_length=3) at /home/midenok/src/mariadb/10.3/src/storage/perfschema/pfs_instr_class.cc:1422
#30x000000000145612c in drop_table_share_v1 (temporary=0'\000', schema_name=0x7f289c014370"test", schema_name_length=4, table_name=0x7f289c013ce0"yt4", table_name_length=3) at /home/midenok/src/mariadb/10.3/src/storage/perfschema/pfs.cc:1612
#40x000000000089aaf4 in mysql_rename_table (base=0x33f67d8, old_db=0x7f28d00f4338, old_name=0x7f28d00f4348, new_db=0x7f28d00f4338, new_name=0x7f28d00f38d0, flags=2) at /home/midenok/src/mariadb/10.3/src/sql/sql_table.cc:5564
#50x00000000008a3333 in mysql_alter_table (thd=0x7f289c000d28, new_db=0x7f289c005400, new_name=0x7f289c0057c8, create_info=0x7f28d00f5648, table_list=0x7f289c013d18, alter_info=0x7f28d00f5590, order_num=0, order=0x0, ignore=false) at /home/midenok/src/mariadb/10.3/src/sql/sql_table.cc:10161
#60x0000000000950bf5 in Sql_cmd_alter_table::execute (this=0x7f289c0143b8, thd=0x7f289c000d28) at /home/midenok/src/mariadb/10.3/src/sql/sql_alter.cc:512
#70x00000000007a31be in mysql_execute_command (thd=0x7f289c000d28) at /home/midenok/src/mariadb/10.3/src/sql/sql_parse.cc:6052
#80x0000000000795206 in mysql_parse (thd=0x7f289c000d28, rawbuf=0x7f289c013c10"alter table yt4 rename to t1, algorithm=copy", length=44, parser_state=0x7f28d00f85e8, is_com_multi=false, is_next_command=false) at /home/midenok/src/mariadb/10.3/src/sql/sql_parse.cc:7837
frame 4
5558 /*
5559 Remove the old table share from the pfs table share array. The new table
5560 share will be created when the renamed table is first accessed.
Good (10.3): PFS share released
frame 4
5559 Remove the old table share from the pfs table share array. The new table
5560 share will be created when the renamed table is first accessed.
5561 */
5563 {
5564 PSI_CALL_drop_table_share(flags & FN_FROM_IS_TMP,
5565 old_db->str, (uint)old_db->length,
5566 old_name->str, (uint)old_name->length);
5567 }
frame 5
10162 &alter_ctx.db, &backup_name, FN_TO_IS_TMP))
10163 {
10166 &alter_ctx.tmp_name, FN_IS_TMP);
10168 }
Bad (10.5): mysql_rename_table() on old table is not called:
10931 {
10934 current_pid, thd->thread_id);
10936 my_casedn_str(files_charset_info, backup_name_buff);
10938 &alter_ctx.db, &backup_name,
10939 FN_TO_IS_TMP |
10940 (engine_changed ? NO_HA_TABLE | NO_PAR_TABLE : 0)))
10941 {
10944 &alter_ctx.tmp_name, FN_IS_TMP);
10946 }
10947 }
10949 {
10951 backup_name= alter_ctx.table_name;
10952 }
Fix
Do PSI_CALL_drop_table_share() in "The original table is the backup" branch.
Notes
Caused by 043a3a0176e2