[MDEV-29503] Assertion `share->tdc->flushed' failed in void close_all_tables_for_name(THD*, TABLE_SHARE*, ha_extra_function, TABLE*) Created: 2022-09-09  Updated: 2024-02-02

Status: Confirmed
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11
Fix Version/s: 10.5, 10.6, 10.11, 11.0, 11.1, 11.2, 11.3

Type: Bug Priority: Major
Reporter: Ramesh Sivaraman Assignee: Oleksandr Byelkin
Resolution: Unresolved Votes: 0
Labels: not-10.3, not-10.4


 Description   

SET sql_mode=ORACLE;
CREATE TABLE t1 (a INT, b CHAR(8)) ENGINE=InnoDB;
LOCK TABLE t1 WRITE WAIT 10;
INSERT INTO t1 (a) VALUES (GEOMETRYcollection (POINT(10,9), LINESTRING (POINT(2305843009213693955,-1125899906842621), POINT(78,15)), multiPOINT(POINT(-1,3), POINT(4,-6))));
ALTER TABLE t1 ENGINE=InnoDB PARTITION BY KEY(a) (PARTITION p0 ENGINE=InnoDB, PARTITION p1);
INSERT INTO t1 VALUES (15, 'b');
ALTER TABLE t1 CHANGE a a ENUM ('x','y','z','d','e');
ALTER TABLE t1 ADD UNIQUE INDEX t1_unq_idx (a);
ALTER TABLE t1 ADD PARTITION (PARTITION p3 DATA DIRECTORY='/tmp/DATA' INDEX DIRECTORY='/tmp/idx');

Leads to:

10.11.0 12c236415930c789a422b313c3bd9b9b5fe494af (Debug)

mysqld: /test/10.11_dbg/sql/sql_base.cc:737: void close_all_tables_for_name(THD*, TABLE_SHARE*, ha_extra_function, TABLE*): Assertion `share->tdc->flushed' failed.

10.11.0 12c236415930c789a422b313c3bd9b9b5fe494af (Debug)

Core was generated by `/test/MD050922-mariadb-10.11.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core'.
Program terminated with signal SIGABRT, Aborted.
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
[Current thread is 1 (Thread 0x14a06d8c6700 (LWP 2336824))]
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x000014a086047859 in __GI_abort () at abort.c:79
#2  0x000014a086047729 in __assert_fail_base (fmt=0x14a0861dd588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55b4673874fd "share->tdc->flushed", file=0x55b467384a98 "/test/10.11_dbg/sql/sql_base.cc", line=737, function=<optimized out>) at assert.c:92
#3  0x000014a086058fd6 in __GI___assert_fail (assertion=assertion@entry=0x55b4673874fd "share->tdc->flushed", file=file@entry=0x55b467384a98 "/test/10.11_dbg/sql/sql_base.cc", line=line@entry=737, function=function@entry=0x55b467385678 "void close_all_tables_for_name(THD*, TABLE_SHARE*, ha_extra_function, TABLE*)") at assert.c:101
#4  0x000055b46670d12c in close_all_tables_for_name (thd=thd@entry=0x14a034000d48, share=0x14a03407d690, extra=extra@entry=HA_EXTRA_NOT_USED, skip_table=skip_table@entry=0x0) at /test/10.11_dbg/sql/sql_base.cc:737
#5  0x000055b4667a8a81 in handle_alter_part_error (lpt=lpt@entry=0x14a06d8c1060, action_completed=action_completed@entry=false, drop_partition=drop_partition@entry=false, frm_install=frm_install@entry=false, reopen=reopen@entry=true) at /test/10.11_dbg/sql/sql_partition.cc:7121
#6  0x000055b4667b6f01 in fast_alter_partition_table (thd=thd@entry=0x14a034000d48, table=table@entry=0x14a034026918, alter_info=alter_info@entry=0x14a06d8c40f0, alter_ctx=alter_ctx@entry=0x14a06d8c33f0, create_info=create_info@entry=0x14a06d8c41e0, table_list=0x14a034013368) at /test/10.11_dbg/sql/sql_partition.cc:7821
#7  0x000055b466880d7e in mysql_alter_table (thd=thd@entry=0x14a034000d48, new_db=new_db@entry=0x14a034005820, new_name=new_name@entry=0x14a034005c30, create_info=create_info@entry=0x14a06d8c41e0, table_list=<optimized out>, table_list@entry=0x14a034013368, alter_info=alter_info@entry=0x14a06d8c40f0, order_num=<optimized out>, order=<optimized out>, ignore=<optimized out>, if_exists=<optimized out>) at /test/10.11_dbg/sql/sql_table.cc:10870
#8  0x000055b466907bad in Sql_cmd_alter_table::execute (this=<optimized out>, thd=0x14a034000d48) at /test/10.11_dbg/sql/structs.h:569
#9  0x000055b4667a46e7 in mysql_execute_command (thd=thd@entry=0x14a034000d48, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.11_dbg/sql/sql_parse.cc:5997
#10 0x000055b46678cceb in mysql_parse (thd=thd@entry=0x14a034000d48, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14a06d8c5330) at /test/10.11_dbg/sql/sql_parse.cc:8037
#11 0x000055b46679a2b6 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14a034000d48, packet=packet@entry=0x14a03400aed9 "ALTER TABLE t1 ADD PARTITION (PARTITION p3 DATA DIRECTORY='/tmp/DATA' INDEX DIRECTORY='/tmp/idx')", packet_length=packet_length@entry=97, blocking=blocking@entry=true) at /test/10.11_dbg/sql/sql_class.h:1339
#12 0x000055b46679c9c5 in do_command (thd=0x14a034000d48, blocking=blocking@entry=true) at /test/10.11_dbg/sql/sql_parse.cc:1407
#13 0x000055b466900756 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55b469a2e2b8, put_in_cache=put_in_cache@entry=true) at /test/10.11_dbg/sql/sql_connect.cc:1418
#14 0x000055b466900c5f in handle_one_connection (arg=0x55b469a2e2b8) at /test/10.11_dbg/sql/sql_connect.cc:1312
#15 0x000014a086558609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#16 0x000014a086144133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Bug confirmed present in:
MariaDB: 10.5.18 (dbg), 10.6.10 (dbg), 10.7.6 (dbg), 10.8.5 (dbg), 10.9.2 (dbg), 10.10.2 (dbg), 10.11.0 (dbg)

Bug (or feature/syntax) confirmed not present in:
MariaDB: 10.2.44 (dbg), 10.3.37 (dbg), 10.4.27 (dbg), 10.9.2 (opt)
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.39 (dbg), 5.7.39 (opt)



 Comments   
Comment by Alice Sherepa [ 2024-02-02 ]

I'm getting something related:

mysqld: /11.3/sql/sql_base.cc:742: void close_all_tables_for_name(THD*, TABLE_SHARE*, ha_extra_function, TABLE*): Assertion `share->tdc->flushed' failed.
240201 16:04:37 [ERROR] mysqld got signal 6 ;
 
 
Server version: 11.3.2-MariaDB-debug-log source revision: 29f5901c8a95ece33d0fb9b61f4e2c16543979e1
 
linux/raise.c:51(__GI_raise)[0x7f622931d8eb]
stdlib/abort.c:81(__GI_abort)[0x7f6229308535]
intl/loadmsgcat.c:1177(_nl_load_domain)[0x7f622930840f]
/lib/x86_64-linux-gnu/libc.so.6(+0x301a2)[0x7f62293161a2]
sql/sql_base.cc:745(close_all_tables_for_name(THD*, TABLE_SHARE*, ha_extra_function, TABLE*))[0x55f1aab789c9]
sql/sql_partition.cc:7177(handle_alter_part_error(st_lock_param_type*, bool, bool, bool, bool))[0x55f1aad95270]
sql/sql_partition.cc:7779(fast_alter_partition_table(THD*, TABLE*, Alter_info*, Alter_table_ctx*, HA_CREATE_INFO*, TABLE_LIST*))[0x55f1aad99169]
sql/partition_info.cc:992(vers_create_partitions(THD*, TABLE_LIST*, unsigned int))[0x55f1ab1922d4]
sql/sql_base.cc:3539(Open_table_context::recover_from_failed_open())[0x55f1aab88583]
sql/sql_base.cc:4684(open_tables(THD*, DDL_options_st const&, TABLE_LIST**, unsigned int*, unsigned int, Prelocking_strategy*))[0x55f1aab8e83f]
sql/sql_base.h:272(open_tables(THD*, TABLE_LIST**, unsigned int*, unsigned int, Prelocking_strategy*))[0x55f1aab754fb]
sql/sql_base.cc:5768(open_tables_for_query(THD*, TABLE_LIST*, unsigned int*, unsigned int, DML_prelocking_strategy*))[0x55f1aab94711]
sql/sql_select.cc:33493(Sql_cmd_dml::prepare(THD*))[0x55f1aaf1c24c]
sql/sql_select.cc:33555(Sql_cmd_dml::execute(THD*))[0x55f1aaf1c58c]
sql/sql_parse.cc:4375(mysql_execute_command(THD*, bool))[0x55f1aad3c2be]
sql/sql_parse.cc:7798(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x55f1aad542c2]
sql/sql_parse.cc:1895(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x55f1aad2be50]
sql/sql_parse.cc:1406(do_command(THD*, bool))[0x55f1aad28b3e]
sql/sql_connect.cc:1417(do_handle_one_connection(CONNECT*, bool))[0x55f1ab1f6890]
sql/sql_connect.cc:1321(handle_one_connection)[0x55f1ab1f61e6]
perfschema/pfs.cc:2203(pfs_spawn_thread)[0x55f1abed5d31]
nptl/pthread_create.c:487(start_thread)[0x7f62297d5fa3]
x86_64/clone.S:97(clone)[0x7f62293df06f]

Generated at Thu Feb 08 10:09:06 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.