Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5
-
None
Description
Note: While it currently fails for me every time, the test case is still non-deterministic, try to run with --repeat=N if it doesn't fail for you right away.
--source include/have_innodb.inc
|
|
SET @stats.save= @@innodb_stats_persistent; |
SET GLOBAL innodb_stats_persistent= ON; |
|
CREATE TABLE t1 (pk INT, a INT, PRIMARY KEY (pk), KEY (a)) ENGINE=InnoDB; |
INSERT INTO t1 VALUES (1,1),(2,2),(3,3),(4,4); |
|
CREATE TABLE t2 (b INT, FOREIGN KEY (b) REFERENCES t1 (a) ON DELETE CASCADE) ENGINE=InnoDB; |
INSERT INTO t2 VALUES (1),(2),(3),(4); |
|
--connect (con1,localhost,root,,test)
|
--send
|
RENAME TABLE t2 TO tmp, tmp TO t2; |
|
--connection default
|
SELECT * INTO OUTFILE 'load_t1' FROM t1; |
LOAD DATA INFILE 'load_t1' REPLACE INTO TABLE t1; |
|
# Cleanup
|
--connection con1
|
--reap
|
--disconnect con1
|
--connection default
|
--let $datadir= `SELECT @@datadir`
|
--remove_file $datadir/test/load_t1
|
DROP TABLE t2, t1; |
SET GLOBAL innodb_stats_persistent= @stats.save; |
10.2 d752a97e |
mysqld: /data/src/10.2/storage/innobase/dict/dict0stats_bg.cc:156: void dict_stats_update_if_needed(dict_table_t*, THD*): Assertion `table->stat_initialized' failed.
|
191029 23:41:29 [ERROR] mysqld got signal 6 ;
|
|
#7 0x00007f9b71f36f12 in __GI___assert_fail (assertion=0x5617ea6adb45 "table->stat_initialized", file=0x5617ea6adcb0 "/data/src/10.2/storage/innobase/dict/dict0stats_bg.cc", line=156, function=0x5617ea6ae360 <dict_stats_update_if_needed(dict_table_t*, THD*)::__PRETTY_FUNCTION__> "void dict_stats_update_if_needed(dict_table_t*, THD*)") at assert.c:101
|
#8 0x00005617ea169a0d in dict_stats_update_if_needed (table=0x7f9b1800c108, thd=0x7f9b18000b00) at /data/src/10.2/storage/innobase/dict/dict0stats_bg.cc:156
|
#9 0x00005617e9fc596f in row_update_cascade_for_mysql (thr=0x7f9b18073f88, node=0x7f9b1808b1c8, table=0x7f9b1800c108) at /data/src/10.2/storage/innobase/row/row0mysql.cc:2155
|
#10 0x00005617e9fa1b20 in row_ins_foreign_check_on_constraint (thr=0x7f9b18073f88, foreign=0x7f9b18087f48, pcur=0x7f9b6c580540, entry=0x7f9b18084ac8, mtr=0x7f9b6c5809a0) at /data/src/10.2/storage/innobase/row/row0ins.cc:1430
|
#11 0x00005617e9fa290b in row_ins_check_foreign_constraint (check_ref=0, foreign=0x7f9b18087f48, table=0x7f9b180311e8, entry=0x7f9b18084ac8, thr=0x7f9b18073f88) at /data/src/10.2/storage/innobase/row/row0ins.cc:1819
|
#12 0x00005617ea016029 in row_upd_check_references_constraints (node=0x7f9b18073c80, pcur=0x7f9b6c581050, table=0x7f9b180311e8, index=0x7f9b18070b88, offsets=0x7f9b18086070, thr=0x7f9b18073f88, mtr=0x7f9b6c5815d0) at /data/src/10.2/storage/innobase/row/row0upd.cc:326
|
#13 0x00005617ea01a8d0 in row_upd_sec_index_entry (node=0x7f9b18073c80, thr=0x7f9b18073f88) at /data/src/10.2/storage/innobase/row/row0upd.cc:2505
|
#14 0x00005617ea01ab63 in row_upd_sec_step (node=0x7f9b18073c80, thr=0x7f9b18073f88) at /data/src/10.2/storage/innobase/row/row0upd.cc:2554
|
#15 0x00005617ea01cdec in row_upd (node=0x7f9b18073c80, thr=0x7f9b18073f88) at /data/src/10.2/storage/innobase/row/row0upd.cc:3310
|
#16 0x00005617ea01d140 in row_upd_step (thr=0x7f9b18073f88) at /data/src/10.2/storage/innobase/row/row0upd.cc:3427
|
#17 0x00005617e9fc4e5a in row_update_for_mysql (prebuilt=0x7f9b18073168) at /data/src/10.2/storage/innobase/row/row0mysql.cc:1828
|
#18 0x00005617e9e87633 in ha_innobase::delete_row (this=0x7f9b180729d8, record=0x7f9b18006650 "\245\001") at /data/src/10.2/storage/innobase/handler/ha_innodb.cc:9136
|
#19 0x00005617e9c82bc8 in handler::ha_delete_row (this=0x7f9b180729d8, buf=0x7f9b18006650 "\245\001") at /data/src/10.2/sql/handler.cc:6149
|
#20 0x00005617e99d1a7c in write_record (thd=0x7f9b18000b00, table=0x7f9b18071dd0, info=0x7f9b6c582090) at /data/src/10.2/sql/sql_insert.cc:1905
|
#21 0x00005617e9e19d0d in read_sep_field (thd=0x7f9b18000b00, info=..., table_list=0x7f9b180125d0, fields_vars=..., set_fields=..., set_values=..., read_info=..., enclosed=..., skip_lines=0, ignore_check_option_errors=false) at /data/src/10.2/sql/sql_load.cc:1175
|
#22 0x00005617e9e18378 in mysql_load (thd=0x7f9b18000b00, ex=0x7f9b18012548, table_list=0x7f9b180125d0, fields_vars=..., set_fields=..., set_values=..., handle_duplicates=DUP_REPLACE, ignore=false, read_file_from_client=false) at /data/src/10.2/sql/sql_load.cc:682
|
#23 0x00005617e99f7d3e in mysql_execute_command (thd=0x7f9b18000b00) at /data/src/10.2/sql/sql_parse.cc:4580
|
#24 0x00005617e9a01d20 in mysql_parse (thd=0x7f9b18000b00, rawbuf=0x7f9b18012468 "LOAD DATA INFILE 'load_t1' REPLACE INTO TABLE t1", length=48, parser_state=0x7f9b6c583200, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7759
|
#25 0x00005617e99f0029 in dispatch_command (command=COM_QUERY, thd=0x7f9b18000b00, packet=0x7f9b18095fc1 "LOAD DATA INFILE 'load_t1' REPLACE INTO TABLE t1", packet_length=48, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1831
|
#26 0x00005617e99ee97d in do_command (thd=0x7f9b18000b00) at /data/src/10.2/sql/sql_parse.cc:1384
|
#27 0x00005617e9b43f57 in do_handle_one_connection (connect=0x5617ebf67170) at /data/src/10.2/sql/sql_connect.cc:1336
|
#28 0x00005617e9b43cc2 in handle_one_connection (arg=0x5617ebf67170) at /data/src/10.2/sql/sql_connect.cc:1241
|
#29 0x00005617ea37656e in pfs_spawn_thread (arg=0x5617ebf8a420) at /data/src/10.2/storage/perfschema/pfs.cc:1862
|
#30 0x00007f9b73aac4a4 in start_thread (arg=0x7f9b6c584700) at pthread_create.c:456
|
#31 0x00007f9b71ff3d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
|
Reproducible on 10.2-10.5 debug builds. Couldn't reproduce on 10.1, MySQL 5.6, 5.7, 8.0. No obvious effect on a non-debug build.
Attachments
Issue Links
- is duplicated by
-
MDEV-24379 Assertion `table->stat_initialized' failed in dict0stats_bg.cc
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Affects Version/s | 10.4 [ 22408 ] |
Comment | [ On 10.4: https://travis-ci.org/elenst/travis-tests/jobs/511625660 [3077 32 3] ] |
Fix Version/s | 10.2 [ 14601 ] | |
Fix Version/s | 10.3 [ 22126 ] | |
Fix Version/s | 10.4 [ 22408 ] | |
Affects Version/s | 10.3 [ 22126 ] | |
Assignee | Elena Stepanova [ elenst ] | Marko Mäkelä [ marko ] |
Description |
https://travis-ci.org/elenst/travis-tests/jobs/499939968
{noformat:title=10.2 003b507} mysqld: /home/travis/src/storage/innobase/dict/dict0stats_bg.cc:156: void dict_stats_update_if_needed(dict_table_t*, THD*): Assertion `table->stat_initialized' failed. 190301 8:59:17 [ERROR] mysqld got signal 6 ; This could be because you hit a bug. It is also possible that this binary or one of the libraries it was linked against is corrupt, improperly built, or misconfigured. This error can also be caused by malfunctioning hardware. To report this bug, see https://mariadb.com/kb/en/reporting-bugs We will try our best to scrape up some info that will hopefully help diagnose the problem, but since we have already crashed, something is definitely wrong and this may fail. Server version: 10.2.23-MariaDB-debug-log key_buffer_size=134217728 read_buffer_size=131072 max_used_connections=7 max_threads=153 thread_count=14 It is possible that mysqld could use up to key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 467328 K bytes of memory Hope that's ok; if not, decrease some variables in the equation. Thread pointer: 0x7f0adc0088c0 Attempting backtrace. You can use the following information to find out where mysqld died. If you see no messages after this, something went terribly wrong... stack_bottom = 0x7f0b20b33ec0 thread_stack 0x49000 /home/travis/server/bin/mysqld(my_print_stacktrace+0x38)[0x55ca46ecce82] mysys/stacktrace.c:267(my_print_stacktrace)[0x55ca46767ae3] /lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7f0b24067390] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7f0b23420428] /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7f0b2342202a] /lib/x86_64-linux-gnu/libc.so.6(+0x2dbd7)[0x7f0b23418bd7] /lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x7f0b23418c82] /home/travis/server/bin/mysqld(+0xd2eb35)[0x55ca46c64b35] dict/dict0stats_bg.cc:157(dict_stats_update_if_needed(dict_table_t*, THD*))[0x55ca46abd498] row/row0mysql.cc:2157(row_update_cascade_for_mysql(que_thr_t*, upd_node_t*, dict_table_t*))[0x55ca46a988d4] row/row0ins.cc:1435(row_ins_foreign_check_on_constraint(que_thr_t*, dict_foreign_t*, btr_pcur_t*, dtuple_t*, mtr_t*))[0x55ca46a9955f] row/row0ins.cc:1803(row_ins_check_foreign_constraint(unsigned long, dict_foreign_t*, dict_table_t*, dtuple_t*, que_thr_t*))[0x55ca46b0fd63] row/row0upd.cc:327(row_upd_check_references_constraints(upd_node_t*, btr_pcur_t*, dict_table_t*, dict_index_t*, unsigned long*, que_thr_t*, mtr_t*))[0x55ca46b145dd] row/row0upd.cc:2509(row_upd_sec_index_entry(upd_node_t*, que_thr_t*))[0x55ca46b1486d] row/row0upd.cc:2556(row_upd_sec_step(upd_node_t*, que_thr_t*))[0x55ca46b16b5e] row/row0upd.cc:3315(row_upd(upd_node_t*, que_thr_t*))[0x55ca46b16eb0] row/row0upd.cc:3432(row_upd_step(que_thr_t*))[0x55ca46abc969] row/row0mysql.cc:1832(row_update_for_mysql(row_prebuilt_t*))[0x55ca4697eeff] handler/ha_innodb.cc:9141(ha_innobase::delete_row(unsigned char const*))[0x55ca46777a1a] sql/handler.cc:6103(handler::ha_delete_row(unsigned char const*))[0x55ca464ca426] sql/sql_insert.cc:1892(write_record(THD*, TABLE*, st_copy_info*))[0x55ca46911b90] sql/sql_load.cc:1143(read_sep_field(THD*, st_copy_info&, TABLE_LIST*, List<Item>&, List<Item>&, List<Item>&, READ_INFO&, String&, unsigned long, bool))[0x55ca4691021b] sql/sql_load.cc:652(mysql_load(THD*, sql_exchange*, TABLE_LIST*, List<Item>&, List<Item>&, List<Item>&, enum_duplicates, bool, bool))[0x55ca464f10e4] sql/sql_parse.cc:4839(mysql_execute_command(THD*))[0x55ca464fb0ed] sql/sql_parse.cc:8018(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x55ca464e873e] sql/sql_parse.cc:1831(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x55ca464e7042] sql/sql_parse.cc:1379(do_command(THD*))[0x55ca4663a0af] sql/sql_connect.cc:1336(do_handle_one_connection(CONNECT*))[0x55ca46639e2f] /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f0b2405d6ba] /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f0b234f241d] Trying to get some variables. Some pointers may be invalid and cause the dump to abort. Query (0x7f0adc01af18): LOAD DATA INFILE 'load_E' REPLACE INTO TABLE E /* QNO 161 CON_ID 19 */ Connection ID (thread ID): 19 Status: NOT_KILLED Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on {noformat} {noformat:title=elenst-dev 8350673 Toolbox: 6cb3c0a} perl ./runall-new.pl --basedir=/home/travis/server --vardir=/home/travis/logs/vardir --duration=350 --threads=6 --seed=1551430745 --reporters=Backtrace,ErrorLog,Deadlock --validators=TransformerNoComparator --views --redefine=conf/mariadb/alter_table.yy --redefine=conf/mariadb/sp.yy --redefine=conf/mariadb/bulk_insert.yy --redefine=conf/mariadb/modules/foreign_keys.yy --redefine=conf/mariadb/modules/admin.yy --redefine=conf/mariadb/modules/sql_mode.yy --mysqld=--log_output=FILE --mysqld=--max-statement-time=30 --mysqld=--lock-wait-timeout=10 --mysqld=--loose-innodb-lock-wait-timeout=5 --mysqld=--loose-debug_assert_on_not_freed_memory=0 --grammar=conf/partitioning/partitions.yy --ps-protocol --transformers=ExecuteAsCTE,ExecuteAsExecuteImmediate,ExecuteAsDeleteReturning,ExecuteAsInsertSelect,ExecuteAsUnion,ExecuteAsUpdateDelete,ExecuteAsView {noformat} Not reproducible so far. |
_Note: While it currently fails for me every time, the test case is still non-deterministic, try to run with {{--repeat=N}} if it doesn't fail for you right away._
{code:sql} --source include/have_innodb.inc SET @stats.save= @@innodb_stats_persistent; SET GLOBAL innodb_stats_persistent= ON; CREATE TABLE t1 (pk INT, a INT, PRIMARY KEY (pk), KEY (a)) ENGINE=InnoDB; INSERT INTO t1 VALUES (1,1),(2,2),(3,3),(4,4); CREATE TABLE t2 (b INT, FOREIGN KEY (b) REFERENCES t1 (a) ON DELETE CASCADE) ENGINE=InnoDB; INSERT INTO t2 VALUES (1),(2),(3),(4); --connect (con1,localhost,root,,test) --send RENAME TABLE t2 TO tmp, tmp TO t2; --connection default SELECT * INTO OUTFILE 'load_t1' FROM t1; LOAD DATA INFILE 'load_t1' REPLACE INTO TABLE t1; # Cleanup --connection con1 --reap --disconnect con1 --connection default --let $datadir= `SELECT @@datadir` --remove_file $datadir/test/load_t1 DROP TABLE t2, t1; SET GLOBAL innodb_stats_persistent= @stats.save; {code} {noformat:title=10.2 d752a97e} mysqld: /data/src/10.2/storage/innobase/dict/dict0stats_bg.cc:156: void dict_stats_update_if_needed(dict_table_t*, THD*): Assertion `table->stat_initialized' failed. 191029 23:41:29 [ERROR] mysqld got signal 6 ; #7 0x00007f9b71f36f12 in __GI___assert_fail (assertion=0x5617ea6adb45 "table->stat_initialized", file=0x5617ea6adcb0 "/data/src/10.2/storage/innobase/dict/dict0stats_bg.cc", line=156, function=0x5617ea6ae360 <dict_stats_update_if_needed(dict_table_t*, THD*)::__PRETTY_FUNCTION__> "void dict_stats_update_if_needed(dict_table_t*, THD*)") at assert.c:101 #8 0x00005617ea169a0d in dict_stats_update_if_needed (table=0x7f9b1800c108, thd=0x7f9b18000b00) at /data/src/10.2/storage/innobase/dict/dict0stats_bg.cc:156 #9 0x00005617e9fc596f in row_update_cascade_for_mysql (thr=0x7f9b18073f88, node=0x7f9b1808b1c8, table=0x7f9b1800c108) at /data/src/10.2/storage/innobase/row/row0mysql.cc:2155 #10 0x00005617e9fa1b20 in row_ins_foreign_check_on_constraint (thr=0x7f9b18073f88, foreign=0x7f9b18087f48, pcur=0x7f9b6c580540, entry=0x7f9b18084ac8, mtr=0x7f9b6c5809a0) at /data/src/10.2/storage/innobase/row/row0ins.cc:1430 #11 0x00005617e9fa290b in row_ins_check_foreign_constraint (check_ref=0, foreign=0x7f9b18087f48, table=0x7f9b180311e8, entry=0x7f9b18084ac8, thr=0x7f9b18073f88) at /data/src/10.2/storage/innobase/row/row0ins.cc:1819 #12 0x00005617ea016029 in row_upd_check_references_constraints (node=0x7f9b18073c80, pcur=0x7f9b6c581050, table=0x7f9b180311e8, index=0x7f9b18070b88, offsets=0x7f9b18086070, thr=0x7f9b18073f88, mtr=0x7f9b6c5815d0) at /data/src/10.2/storage/innobase/row/row0upd.cc:326 #13 0x00005617ea01a8d0 in row_upd_sec_index_entry (node=0x7f9b18073c80, thr=0x7f9b18073f88) at /data/src/10.2/storage/innobase/row/row0upd.cc:2505 #14 0x00005617ea01ab63 in row_upd_sec_step (node=0x7f9b18073c80, thr=0x7f9b18073f88) at /data/src/10.2/storage/innobase/row/row0upd.cc:2554 #15 0x00005617ea01cdec in row_upd (node=0x7f9b18073c80, thr=0x7f9b18073f88) at /data/src/10.2/storage/innobase/row/row0upd.cc:3310 #16 0x00005617ea01d140 in row_upd_step (thr=0x7f9b18073f88) at /data/src/10.2/storage/innobase/row/row0upd.cc:3427 #17 0x00005617e9fc4e5a in row_update_for_mysql (prebuilt=0x7f9b18073168) at /data/src/10.2/storage/innobase/row/row0mysql.cc:1828 #18 0x00005617e9e87633 in ha_innobase::delete_row (this=0x7f9b180729d8, record=0x7f9b18006650 "\245\001") at /data/src/10.2/storage/innobase/handler/ha_innodb.cc:9136 #19 0x00005617e9c82bc8 in handler::ha_delete_row (this=0x7f9b180729d8, buf=0x7f9b18006650 "\245\001") at /data/src/10.2/sql/handler.cc:6149 #20 0x00005617e99d1a7c in write_record (thd=0x7f9b18000b00, table=0x7f9b18071dd0, info=0x7f9b6c582090) at /data/src/10.2/sql/sql_insert.cc:1905 #21 0x00005617e9e19d0d in read_sep_field (thd=0x7f9b18000b00, info=..., table_list=0x7f9b180125d0, fields_vars=..., set_fields=..., set_values=..., read_info=..., enclosed=..., skip_lines=0, ignore_check_option_errors=false) at /data/src/10.2/sql/sql_load.cc:1175 #22 0x00005617e9e18378 in mysql_load (thd=0x7f9b18000b00, ex=0x7f9b18012548, table_list=0x7f9b180125d0, fields_vars=..., set_fields=..., set_values=..., handle_duplicates=DUP_REPLACE, ignore=false, read_file_from_client=false) at /data/src/10.2/sql/sql_load.cc:682 #23 0x00005617e99f7d3e in mysql_execute_command (thd=0x7f9b18000b00) at /data/src/10.2/sql/sql_parse.cc:4580 #24 0x00005617e9a01d20 in mysql_parse (thd=0x7f9b18000b00, rawbuf=0x7f9b18012468 "LOAD DATA INFILE 'load_t1' REPLACE INTO TABLE t1", length=48, parser_state=0x7f9b6c583200, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7759 #25 0x00005617e99f0029 in dispatch_command (command=COM_QUERY, thd=0x7f9b18000b00, packet=0x7f9b18095fc1 "LOAD DATA INFILE 'load_t1' REPLACE INTO TABLE t1", packet_length=48, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1831 #26 0x00005617e99ee97d in do_command (thd=0x7f9b18000b00) at /data/src/10.2/sql/sql_parse.cc:1384 #27 0x00005617e9b43f57 in do_handle_one_connection (connect=0x5617ebf67170) at /data/src/10.2/sql/sql_connect.cc:1336 #28 0x00005617e9b43cc2 in handle_one_connection (arg=0x5617ebf67170) at /data/src/10.2/sql/sql_connect.cc:1241 #29 0x00005617ea37656e in pfs_spawn_thread (arg=0x5617ebf8a420) at /data/src/10.2/storage/perfschema/pfs.cc:1862 #30 0x00007f9b73aac4a4 in start_thread (arg=0x7f9b6c584700) at pthread_create.c:456 #31 0x00007f9b71ff3d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97 {noformat} Reproducible on 10.2-10.5 debug builds. Couldn't reproduce on 10.1, MySQL 5.6, 5.7, 8.0. No obvious effect on a non-debug build. |
Summary | [Draft] Assertion `table->stat_initialized' failed in dict_stats_update_if_needed | Assertion `table->stat_initialized' failed in dict_stats_update_if_needed |
Affects Version/s | 10.5 [ 23123 ] |
Fix Version/s | 10.5 [ 23123 ] |
Status | Open [ 1 ] | Confirmed [ 10101 ] |
Link |
This issue is duplicated by |
Status | Confirmed [ 10101 ] | In Progress [ 3 ] |
issue.field.resolutiondate | 2021-04-12 08:54:16.0 | 2021-04-12 08:54:16.536 |
Fix Version/s | 10.2.38 [ 25207 ] | |
Fix Version/s | 10.3.29 [ 25206 ] | |
Fix Version/s | 10.4.19 [ 25205 ] | |
Fix Version/s | 10.5.10 [ 25204 ] | |
Fix Version/s | 10.2 [ 14601 ] | |
Fix Version/s | 10.3 [ 22126 ] | |
Fix Version/s | 10.4 [ 22408 ] | |
Fix Version/s | 10.5 [ 23123 ] | |
Resolution | Fixed [ 1 ] | |
Status | In Progress [ 3 ] | Closed [ 6 ] |
Workflow | MariaDB v3 [ 92943 ] | MariaDB v4 [ 155844 ] |
I can reproduce this with some iterations of
./mtr --parallel=auto --rr=-h MDEV-18802{,,,,,,,,,,,,,,,}; do :; done
The flag was cleared some time earlier:
10.2 75dd7a048315affc0c5986b6e955965d46621c6a
#0 0x0000562b60de9d0e in dict_stats_deinit (table=0x1cac7816bc00) at /mariadb/10.2o/storage/innobase/include/dict0stats.ic:185
#1 0x0000562b60dea647 in dict_table_close (table=0x1cac7816bc00, dict_locked=0, try_drop=0) at /mariadb/10.2o/storage/innobase/dict/dict0dict.cc:369
#2 0x0000562b60c8711a in row_prebuilt_free (prebuilt=0x1cac78081db0, dict_locked=0) at /mariadb/10.2o/storage/innobase/row/row0mysql.cc:1030
#3 0x0000562b60b51e04 in ha_innobase::close (this=0x1cac78081630) at /mariadb/10.2o/storage/innobase/handler/ha_innodb.cc:6669
#4 0x0000562b60977603 in handler::ha_close (this=0x1cac78081630) at /mariadb/10.2o/sql/handler.cc:2657
#5 0x0000562b6081a8ba in closefrm (table=0x1cac78080a98) at /mariadb/10.2o/sql/table.cc:3525
#6 0x0000562b608f1901 in intern_close_table (table=0x1cac78080a98) at /mariadb/10.2o/sql/table_cache.cc:222
#7 0x0000562b608f3de9 in tdc_remove_table (thd=0x7f15ec000d28, remove_type=TDC_RT_REMOVE_ALL, db=0x7f15ec010d70 "test", table_name=0x7f15ec0106f0 "t2", kill_delayed_threads=false)
at /mariadb/10.2o/sql/table_cache.cc:1132
#8 0x0000562b6074b7b0 in do_rename (thd=0x7f15ec000d28, ren_table=0x7f15ec010758, new_db=0x7f15ec011398 "test", new_table_name=0x7f15ec010720 "tmp", new_table_alias=0x7f15ec010d78 "tmp", skip_error=false)
at /mariadb/10.2o/sql/sql_rename.cc:286
#9 0x0000562b6074ba40 in rename_tables (thd=0x7f15ec000d28, table_list=0x7f15ec010758, skip_error=false) at /mariadb/10.2o/sql/sql_rename.cc:380
#10 0x0000562b6074b415 in mysql_rename_tables (thd=0x7f15ec000d28, table_list=0x7f15ec010758, silent=false) at /mariadb/10.2o/sql/sql_rename.cc:152
#11 0x0000562b60722f1d in mysql_execute_command (thd=0x7f15ec000d28) at /mariadb/10.2o/sql/sql_parse.cc:3977
#12 0x0000562b6072eb41 in mysql_parse (thd=0x7f15ec000d28, rawbuf=0x7f15ec010640 "RENAME TABLE t2 TO tmp, tmp TO t2", length=33, parser_state=0x6649380495f0, is_com_multi=false, is_next_command=false)
at /mariadb/10.2o/sql/sql_parse.cc:7794
#13 0x0000562b6071d590 in dispatch_command (command=COM_QUERY, thd=0x7f15ec000d28, packet=0x7f15ec008329 "RENAME TABLE t2 TO tmp, tmp TO t2", packet_length=33, is_com_multi=false, is_next_command=false)
at /mariadb/10.2o/sql/sql_parse.cc:1827
The assertion fails in:
#5 0x0000562b60c89974 in row_update_cascade_for_mysql (thr=0x1cac78169860, node=0x1cac78182d30, table=0x1cac7816bc00) at /mariadb/10.2o/storage/innobase/row/row0mysql.cc:2148
#6 0x0000562b60c664f2 in row_ins_foreign_check_on_constraint (thr=0x1cac78169860, foreign=0x1cac78161630, pcur=0x4417765f6030, entry=0x1cac7816b860, mtr=0x4417765f63d0)
at /mariadb/10.2o/storage/innobase/row/row0ins.cc:1360
#7 0x0000562b60c6728a in row_ins_check_foreign_constraint (check_ref=0, foreign=0x1cac78161630, table=0x1cac781714b0, entry=0x1cac7816b860, thr=0x1cac78169860)
at /mariadb/10.2o/storage/innobase/row/row0ins.cc:1749
#8 0x0000562b60cd5eb3 in row_upd_check_references_constraints (node=0x1cac78169558, pcur=0x4417765f6a00, table=0x1cac781714b0, index=0x1cac78172040, offsets=0x1cac78082bb8, thr=0x1cac78169860,
mtr=0x4417765f6c80) at /mariadb/10.2o/storage/innobase/row/row0upd.cc:323
#9 0x0000562b60cda8f2 in row_upd_sec_index_entry (node=0x1cac78169558, thr=0x1cac78169860) at /mariadb/10.2o/storage/innobase/row/row0upd.cc:2503
…
#20 0x0000562b6072eb41 in mysql_parse (thd=0x1cac78000d28, rawbuf=0x1cac78011710 "LOAD DATA INFILE 'load_t1' REPLACE INTO TABLE t1", length=48, parser_state=0x4417765f85f0, is_com_multi=false,
is_next_command=false) at /mariadb/10.2o/sql/sql_parse.cc:7794
I think that the easiest fix is to replace the assertion with an if and early return.