Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.4(EOL), 10.5, 10.6
Description
SET GLOBAL innodb_limit_optimistic_insert_debug=2;
|
CREATE TABLE t1 (c TEXT, UNIQUE(c(2))) ENGINE=InnoDB;
|
ALTER TABLE t1 ADD c2 TINYBLOB NOT NULL FIRST;
|
INSERT INTO t1 VALUES (1,'x'),(1,'d'),(1,'r'),(1,'f'),(1,'y'),(1,'u'),(1,'m'),(1,'b'),(1,'o'),(1,'w'),(1,'m'),(1,'q'),(1,'a'),(1,'d'),(1,'g'),(1,'x'),(1,'f'),(1,'p'),(1,'j'),(1,'c');
|
Leads to:
10.6.0 9118fd360a3da0bba521caf2a35c424968235ac4 (Debug) |
mysqld: /test/10.6_dbg/storage/innobase/include/rem0rec.h:721: bool rec_is_metadata(const rec_t*, ulint): Assertion `!is || !comp || rec_get_status(rec) == REC_STATUS_INSTANT' failed.
|
10.6.0 9118fd360a3da0bba521caf2a35c424968235ac4 (Debug) |
Core was generated by `/test/MD010121-mariadb-10.6.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
|
Program terminated with signal SIGABRT, Aborted.
|
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
|
at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
|
[Current thread is 1 (Thread 0x14e434115700 (LWP 1807444))]
|
(gdb) bt
|
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
|
#1 0x000056012a27d0d7 in my_write_core (sig=sig@entry=6) at /test/10.6_dbg/mysys/stacktrace.c:424
|
#2 0x0000560129a11ab1 in handle_fatal_signal (sig=6) at /test/10.6_dbg/sql/signal_handler.cc:330
|
#3 <signal handler called>
|
#4 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
|
#5 0x000014e434f77859 in __GI_abort () at abort.c:79
|
#6 0x000014e434f77729 in __assert_fail_base (fmt=0x14e43510d588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x56012a633668 "!is || !comp || rec_get_status(rec) == REC_STATUS_INSTANT", file=0x56012a633520 "/test/10.6_dbg/storage/innobase/include/rem0rec.h", line=721, function=<optimized out>) at assert.c:92
|
#7 0x000014e434f88f36 in __GI___assert_fail (assertion=assertion@entry=0x56012a633668 "!is || !comp || rec_get_status(rec) == REC_STATUS_INSTANT", file=file@entry=0x56012a633520 "/test/10.6_dbg/storage/innobase/include/rem0rec.h", line=line@entry=721, function=function@entry=0x56012a6336a8 "bool rec_is_metadata(const rec_t*, ulint)") at assert.c:101
|
#8 0x0000560129eb5d11 in rec_is_metadata (comp=<optimized out>, rec=0x14e4144c007f "x") at /test/10.6_dbg/storage/innobase/include/rem0rec.h:721
|
#9 rec_is_metadata (rec=rec@entry=0x14e4144c007f "x", index=@0x14e3f0021708: {static MAX_N_FIELDS = 1023, id = 24, heap = 0x14e3f0021578, name = {m_name = 0x14e3f00218a8 "c"}, table = 0x14e3f001e898, page = 4, merge_threshold = 50, type = 2, trx_id_offset = 0, n_user_defined_cols = 1, nulls_equal = 0, n_uniq = 1, n_def = 2, n_fields = 2, n_nullable = 1, n_core_fields = 2, n_core_null_bytes = 1, static NO_CORE_NULL_BYTES = 255, static DICT_INDEXES_ID = 3, cached = 1, to_be_dropped = 0, online_status = 0, uncommitted = 0, is_dummy = false, in_instant_init = false, magic_n = 76789786, fields = 0x14e3f00235d8, parser = 0x0, has_new_v_col = false, indexes = {prev = 0x14e3f0021388, next = 0x0}, search_info = 0x14e3f0023640, online_log = 0x0, stat_n_diff_key_vals = 0x14e3f0023628, stat_n_sample_sizes = 0x14e3f0023630, stat_n_non_null_key_vals = 0x14e3f0023638, stat_index_size = 3, stat_n_leaf_pages = 1, stats_error_printed = false, stat_defrag_modified_counter = 4, stat_defrag_n_pages_freed = 0, stat_defrag_n_page_split = 4, stat_defrag_data_size_sample = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, stat_defrag_sample_next_slot = 0, rtr_ssn = {m = {<std::__atomic_base<unsigned int>> = {static _S_alignment = 4, _M_i = 0}, <No data fields>}}, rtr_track = 0x0, trx_id = 19, zip_pad = {mutex = {<std::__mutex_base> = {_M_mutex = pthread_mutex_t = {
|
Type = Normal,
|
Status = Not acquired,
|
Robust = No,
|
Shared = No,
|
Protocol = None
|
}}, <No data fields>}, pad = {m = {<std::__atomic_base<unsigned long>> = {static _S_alignment = 8, _M_i = 0}, <No data fields>}}, success = 0, failure = 0, n_rounds = 0}, lock = {lock = {pfs_psi = 0x0, lock = {<rw_lock> = {lock = {<std::__atomic_base<unsigned int>> = {static _S_alignment = 4, _M_i = 536870912}, <No data fields>}, static UNLOCKED = 0, static WRITER = 2147483648, static WRITER_WAITING = 1073741824, static WRITER_PENDING = 3221225472, static UPDATER = 536870912}, <No data fields>}}, recursive = 131072, writer = {<std::__atomic_base<unsigned long>> = {static _S_alignment = 8, _M_i = 22970358650624}, <No data fields>}, static FOR_IO = 18446744073709551615, readers_lock = {<rw_lock> = {lock = {<std::__atomic_base<unsigned int>> = {static _S_alignment = 4, _M_i = 0}, <No data fields>}, static UNLOCKED = 0, static WRITER = 2147483648, static WRITER_WAITING = 1073741824, static WRITER_PENDING = 3221225472, static UPDATER = 536870912}, <No data fields>}, readers = {_M_b = {_M_p = 0x14e3f001e2c0}}, static RECURSIVE_X = 1, static RECURSIVE_U = 65536, static RECURSIVE_MAX = 65535}}) at /test/10.6_dbg/storage/innobase/include/rem0rec.h:732
|
#10 0x000056012a06cf00 in btr_discard_only_page_on_level (mtr=0x14e434112c20, block=0x14e413e108e0, index=0x14e3f0021708) at /test/10.6_dbg/storage/innobase/btr/btr0btr.cc:3897
|
#11 btr_discard_page (cursor=cursor@entry=0x14e4341129a0, mtr=mtr@entry=0x14e434112c20) at /test/10.6_dbg/storage/innobase/btr/btr0btr.cc:4012
|
#12 0x000056012a0aa41a in btr_cur_pessimistic_delete (err=err@entry=0x14e434112994, has_reserved_extents=has_reserved_extents@entry=0, cursor=cursor@entry=0x14e4341129a0, flags=flags@entry=0, rollback=rollback@entry=false, mtr=mtr@entry=0x14e434112c20) at /test/10.6_dbg/storage/innobase/btr/btr0cur.cc:5755
|
#13 0x000056012a1f0d98 in row_undo_ins_remove_sec_low (mode=<optimized out>, mode@entry=65569, index=index@entry=0x14e3f0021708, entry=entry@entry=0x14e3f00811e8, thr=thr@entry=0x14e3f007ead8) at /test/10.6_dbg/storage/innobase/row/row0uins.cc:287
|
#14 0x000056012a1f1a90 in row_undo_ins_remove_sec (thr=0x14e3f007ead8, entry=0x14e3f00811e8, index=0x14e3f0021708) at /test/10.6_dbg/storage/innobase/row/row0uins.cc:339
|
#15 row_undo_ins_remove_sec_rec (thr=0x14e3f007ead8, node=0x14e3f0080c48) at /test/10.6_dbg/storage/innobase/row/row0uins.cc:503
|
#16 row_undo_ins (node=node@entry=0x14e3f0080c48, thr=thr@entry=0x14e3f007ead8) at /test/10.6_dbg/storage/innobase/row/row0uins.cc:555
|
#17 0x0000560129fe64a1 in row_undo (thr=0x14e3f007ead8, node=0x14e3f0080c48) at /test/10.6_dbg/storage/innobase/row/row0undo.cc:432
|
#18 row_undo_step (thr=thr@entry=0x14e3f007ead8) at /test/10.6_dbg/storage/innobase/row/row0undo.cc:488
|
#19 0x0000560129f2c27f in que_thr_step (thr=0x14e3f007ead8) at /test/10.6_dbg/storage/innobase/que/que0que.cc:934
|
#20 que_run_threads_low (thr=0x14e3f007ead8) at /test/10.6_dbg/storage/innobase/que/que0que.cc:997
|
#21 que_run_threads (thr=<optimized out>) at /test/10.6_dbg/storage/innobase/que/que0que.cc:1030
|
#22 0x000056012a03786b in trx_t::rollback_low (this=this@entry=0x14e4201fc260, savept=savept@entry=0x0) at /test/10.6_dbg/storage/innobase/trx/trx0roll.cc:119
|
#23 0x000056012a0333fe in trx_rollback_for_mysql_low (trx=0x14e4201fc260) at /test/10.6_dbg/storage/innobase/trx/trx0roll.cc:186
|
#24 trx_rollback_for_mysql (trx=trx@entry=0x14e4201fc260) at /test/10.6_dbg/storage/innobase/trx/trx0roll.cc:216
|
#25 0x0000560129e06a0a in innobase_rollback (hton=<optimized out>, thd=0x14e3f0000db8, rollback_trx=<optimized out>) at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:4106
|
#26 0x0000560129a17294 in ha_rollback_trans (thd=thd@entry=0x14e3f0000db8, all=all@entry=false) at /test/10.6_dbg/sql/handler.cc:2053
|
#27 0x00005601298bcd7d in trans_rollback_stmt (thd=thd@entry=0x14e3f0000db8) at /test/10.6_dbg/sql/transaction.cc:535
|
#28 0x0000560129752f20 in mysql_execute_command (thd=thd@entry=0x14e3f0000db8) at /test/10.6_dbg/sql/sql_parse.cc:5911
|
#29 0x0000560129739072 in mysql_parse (thd=thd@entry=0x14e3f0000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14e4341143d0) at /test/10.6_dbg/sql/sql_parse.cc:7881
|
#30 0x00005601297471ec in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14e3f0000db8, packet=packet@entry=0x14e3f0008d39 "INSERT INTO t1 VALUES (1,'x'),(1,'d'),(1,'r'),(1,'f'),(1,'y'),(1,'u'),(1,'m'),(1,'b'),(1,'o'),(1,'w'),(1,'m'),(1,'q'),(1,'a'),(1,'d'),(1,'g'),(1,'x'),(1,'f'),(1,'p'),(1,'j'),(1,'c')", packet_length=packet_length@entry=181) at /test/10.6_dbg/sql/sql_class.h:1293
|
#31 0x000056012974a52d in do_command (thd=0x14e3f0000db8) at /test/10.6_dbg/sql/sql_parse.cc:1348
|
#32 0x00005601298a67fc in do_handle_one_connection (connect=<optimized out>, connect@entry=0x56012d3239c8, put_in_cache=put_in_cache@entry=true) at /test/10.6_dbg/sql/sql_connect.cc:1410
|
#33 0x00005601298a6f03 in handle_one_connection (arg=arg@entry=0x56012d3239c8) at /test/10.6_dbg/sql/sql_connect.cc:1312
|
#34 0x0000560129d5c88f in pfs_spawn_thread (arg=0x56012d24b8b8) at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
|
#35 0x000014e435485609 in start_thread (arg=<optimized out>) at pthread_create.c:477
|
#36 0x000014e435074293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
|
Bug confirmed present in:
MariaDB: 10.4.18 (dbg), 10.5.9 (dbg), 10.6.0 (dbg)
Bug (or feature/syntax) confirmed not present in:
MariaDB: 10.2.37 (dbg), 10.2.37 (opt), 10.3.28 (dbg), 10.3.28 (opt), 10.4.18 (opt), 10.5.9 (opt), 10.6.0 (opt)
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.50 (dbg), 5.6.50 (opt), 5.7.32 (dbg), 5.7.32 (opt), 8.0.22 (dbg), 8.0.22 (opt)
10.3.28 (debug) does not show the issue:
10.3.28 e59c1cef3bc4016f9fa9d7a0f6935463b7283a58 (Debug) |
10.3.28>INSERT INTO t1 VALUES (1,'x'),(1,'d'),(1,'r'),(1,'f'),(1,'y'),(1,'u'),(1,'m'),(1,'b'),(1,'o'),(1,'w'),(1,'m'),(1,'q'),(1,'a'),(1,'d'),(1,'g'),(1,'x'),(1,'f'),(1,'p'),(1,'j'),(1,'c');
|
ERROR 1062 (23000): Duplicate entry 'm' for key 'c'
|
Issue not reproducible on optimized builds as innodb_limit_optimistic_insert_debug is not available
10.6.0 9118fd360a3da0bba521caf2a35c424968235ac4 (Optimized) |
10.6.0>SET GLOBAL innodb_limit_optimistic_insert_debug=2;
|
ERROR 1193 (HY000): Unknown system variable 'innodb_limit_optimistic_insert_debug'
|
10.6.0>CREATE TABLE t1 (c TEXT, UNIQUE(c(2))) ENGINE=InnoDB;
|
Query OK, 0 rows affected (0.014 sec)
|
|
10.6.0>ALTER TABLE t1 ADD c2 TINYBLOB NOT NULL FIRST;
|
Query OK, 0 rows affected (0.004 sec)
|
Records: 0 Duplicates: 0 Warnings: 0
|
|
10.6.0>INSERT INTO t1 VALUES (1,'x'),(1,'d'),(1,'r'),(1,'f'),(1,'y'),(1,'u'),(1,'m'),(1,'b'),(1,'o'),(1,'w'),(1,'m'),(1,'q'),(1,'a'),(1,'d'),(1,'g'),(1,'x'),(1,'f'),(1,'p'),(1,'j'),(1,'c');
|
ERROR 1062 (23000): Duplicate entry 'm' for key 'c'
|
10.5.9 Stack and version:
10.5.9 139c85aafd4e4938f95843d44a455265a49b572e (Debug) |
mysqld: /test/10.5_dbg/storage/innobase/include/rem0rec.h:721: bool rec_is_metadata(const rec_t*, ulint): Assertion `!is || !comp || rec_get_status(rec) == REC_STATUS_INSTANT' failed.
|
10.5.9 139c85aafd4e4938f95843d44a455265a49b572e (Debug) |
Core was generated by `/test/MD010121-mariadb-10.5.9-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
|
Program terminated with signal SIGABRT, Aborted.
|
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
|
at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
|
[Current thread is 1 (Thread 0x14865cf3c700 (LWP 1822781))]
|
(gdb) bt
|
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
|
#1 0x0000565307c0b955 in my_write_core (sig=sig@entry=6) at /test/10.5_dbg/mysys/stacktrace.c:424
|
#2 0x000056530735d879 in handle_fatal_signal (sig=6) at /test/10.5_dbg/sql/signal_handler.cc:330
|
#3 <signal handler called>
|
#4 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
|
#5 0x000014865fafa859 in __GI_abort () at abort.c:79
|
#6 0x000014865fafa729 in __assert_fail_base (fmt=0x14865fc90588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x565307fc31e8 "!is || !comp || rec_get_status(rec) == REC_STATUS_INSTANT", file=0x565307fc30a0 "/test/10.5_dbg/storage/innobase/include/rem0rec.h", line=721, function=<optimized out>) at assert.c:92
|
#7 0x000014865fb0bf36 in __GI___assert_fail (assertion=assertion@entry=0x565307fc31e8 "!is || !comp || rec_get_status(rec) == REC_STATUS_INSTANT", file=file@entry=0x565307fc30a0 "/test/10.5_dbg/storage/innobase/include/rem0rec.h", line=line@entry=721, function=function@entry=0x565307fc3228 "bool rec_is_metadata(const rec_t*, ulint)") at assert.c:101
|
#8 0x000056530780f794 in rec_is_metadata (comp=<optimized out>, rec=0x14863c7e407f "x") at /test/10.5_dbg/storage/innobase/include/rem0rec.h:721
|
#9 rec_is_metadata (rec=rec@entry=0x14863c7e407f "x", index=@0x148618024b28: {static MAX_N_FIELDS = 1023, id = 26, heap = 0x148618022748, name = {m_name = 0x1486180237b8 "c"}, table = 0x14861801ea48, page = 4, merge_threshold = 50, type = 2, trx_id_offset = 0, n_user_defined_cols = 1, nulls_equal = 0, n_uniq = 1, n_def = 2, n_fields = 2, n_nullable = 1, n_core_fields = 2, n_core_null_bytes = 1, static NO_CORE_NULL_BYTES = 255, static DICT_INDEXES_ID = 3, cached = 1, to_be_dropped = 0, online_status = 0, uncommitted = 0, is_dummy = false, in_instant_init = false, magic_n = 76789786, fields = 0x1486180237c0, parser = 0x0, has_new_v_col = false, indexes = {prev = 0x14861801f488, next = 0x0}, search_info = 0x148618023828, online_log = 0x0, stat_n_diff_key_vals = 0x148618023810, stat_n_sample_sizes = 0x148618023818, stat_n_non_null_key_vals = 0x148618023820, stat_index_size = 6, stat_n_leaf_pages = 1, stats_error_printed = false, stat_defrag_modified_counter = 4, stat_defrag_n_pages_freed = 0, stat_defrag_n_page_split = 4, stat_defrag_data_size_sample = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, stat_defrag_sample_next_slot = 0, rtr_ssn = {m = {<std::__atomic_base<unsigned int>> = {static _S_alignment = 4, _M_i = 0}, <No data fields>}}, rtr_track = 0x0, trx_id = 21, zip_pad = {mutex = {<std::__mutex_base> = {_M_mutex = pthread_mutex_t = {
|
Type = Normal,
|
Status = Not acquired,
|
Robust = No,
|
Shared = No,
|
Protocol = None
|
}}, <No data fields>}, pad = {m = {<std::__atomic_base<unsigned long>> = {static _S_alignment = 8, _M_i = 0}, <No data fields>}}, success = 0, failure = 0, n_rounds = 0}, lock = {<latch_t> = {_vptr.latch_t = 0x5653084b8318 <vtable for rw_lock_t+16>, m_id = LATCH_ID_INDEX_TREE, m_rw_lock = true}, <ilist_node<void>> = {next = 0x14861801f608, prev = 0x565308f779e0 <rw_lock_list>}, created = true, lock_word = {m = {<std::__atomic_base<int>> = {static _S_alignment = 4, _M_i = 268435456}, <No data fields>}}, waiters = {m = {<std::__atomic_base<unsigned int>> = {static _S_alignment = 4, _M_i = 0}, <No data fields>}}, sx_recursive = 2, writer_thread = 22567317653248, event = 0x1486180205d8, wait_ex_event = 0x148618022b58, cfile_name = 0x565308034b20 "/test/10.5_dbg/storage/innobase/dict/dict0dict.cc", last_x_file_name = 0x5653080252d8 "/test/10.5_dbg/storage/innobase/btr/btr0cur.cc", cline = 2160, is_block_lock = 0, last_x_line = 1480, count_os_wait = 0, pfs_psi = 0x0, debug_list = {count = 2, start = 0x14861807a8a8, end = 0x14861807b0a8, node = &rw_lock_debug_t::list, init = 51966}, level = SYNC_INDEX_TREE}}) at /test/10.5_dbg/storage/innobase/include/rem0rec.h:732
|
#10 0x00005653079eb1ac in btr_discard_only_page_on_level (mtr=0x14865cf39bb0, block=0x14863c01cd40, index=0x148618024b28) at /test/10.5_dbg/storage/innobase/btr/btr0btr.cc:3936
|
#11 btr_discard_page (cursor=cursor@entry=0x14865cf39930, mtr=mtr@entry=0x14865cf39bb0) at /test/10.5_dbg/storage/innobase/btr/btr0btr.cc:4051
|
#12 0x0000565307a20f3a in btr_cur_pessimistic_delete (err=err@entry=0x14865cf398fc, has_reserved_extents=has_reserved_extents@entry=0, cursor=cursor@entry=0x14865cf39930, flags=flags@entry=0, rollback=rollback@entry=false, mtr=mtr@entry=0x14865cf39bb0) at /test/10.5_dbg/storage/innobase/btr/btr0cur.cc:5772
|
#13 0x0000565307b7f23e in row_undo_ins_remove_sec_low (mode=<optimized out>, mode@entry=65569, index=index@entry=0x148618024b28, entry=entry@entry=0x14861807c028, thr=thr@entry=0x148618021cd8) at /test/10.5_dbg/storage/innobase/row/row0uins.cc:287
|
#14 0x0000565307b8088a in row_undo_ins_remove_sec (thr=0x148618021cd8, entry=0x14861807c028, index=0x148618024b28) at /test/10.5_dbg/storage/innobase/row/row0uins.cc:339
|
#15 row_undo_ins_remove_sec_rec (thr=0x148618021cd8, node=0x1486180797a8) at /test/10.5_dbg/storage/innobase/row/row0uins.cc:503
|
#16 row_undo_ins (node=node@entry=0x1486180797a8, thr=thr@entry=0x148618021cd8) at /test/10.5_dbg/storage/innobase/row/row0uins.cc:555
|
#17 0x00005653079437fc in row_undo (thr=0x148618021cd8, node=0x1486180797a8) at /test/10.5_dbg/storage/innobase/row/row0undo.cc:432
|
#18 row_undo_step (thr=thr@entry=0x148618021cd8) at /test/10.5_dbg/storage/innobase/row/row0undo.cc:488
|
#19 0x000056530788919c in que_thr_step (thr=0x148618021cd8) at /test/10.5_dbg/storage/innobase/que/que0que.cc:945
|
#20 que_run_threads_low (thr=0x148618021cd8) at /test/10.5_dbg/storage/innobase/que/que0que.cc:1009
|
#21 que_run_threads (thr=<optimized out>) at /test/10.5_dbg/storage/innobase/que/que0que.cc:1049
|
#22 0x00005653079ad00a in trx_t::rollback_low (this=this@entry=0x14865d1f7360, savept=savept@entry=0x0) at /test/10.5_dbg/storage/innobase/trx/trx0roll.cc:119
|
#23 0x00005653079a9f9d in trx_rollback_for_mysql_low (trx=0x14865d1f7360) at /test/10.5_dbg/storage/innobase/trx/trx0roll.cc:187
|
#24 trx_rollback_for_mysql (trx=trx@entry=0x14865d1f7360) at /test/10.5_dbg/storage/innobase/trx/trx0roll.cc:217
|
#25 0x000056530775377b in innobase_rollback (hton=<optimized out>, thd=0x148618000db8, rollback_trx=<optimized out>) at /test/10.5_dbg/storage/innobase/handler/ha_innodb.cc:4328
|
#26 0x000056530736305c in ha_rollback_trans (thd=thd@entry=0x148618000db8, all=all@entry=false) at /test/10.5_dbg/sql/handler.cc:2053
|
#27 0x0000565307208849 in trans_rollback_stmt (thd=thd@entry=0x148618000db8) at /test/10.5_dbg/sql/transaction.cc:535
|
#28 0x000056530709eda1 in mysql_execute_command (thd=thd@entry=0x148618000db8) at /test/10.5_dbg/sql/sql_parse.cc:6059
|
#29 0x00005653070848a5 in mysql_parse (thd=thd@entry=0x148618000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14865cf3b3d0, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:8042
|
#30 0x0000565307092c46 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x148618000db8, packet=packet@entry=0x148618008f99 "INSERT INTO t1 VALUES (1,'x'),(1,'d'),(1,'r'),(1,'f'),(1,'y'),(1,'u'),(1,'m'),(1,'b'),(1,'o'),(1,'w'),(1,'m'),(1,'q'),(1,'a'),(1,'d'),(1,'g'),(1,'x'),(1,'f'),(1,'p'),(1,'j'),(1,'c')", packet_length=packet_length@entry=181, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_class.h:1255
|
#31 0x00005653070963a7 in do_command (thd=0x148618000db8) at /test/10.5_dbg/sql/sql_parse.cc:1353
|
#32 0x00005653071f22c8 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x56530a6bdff8, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1410
|
#33 0x00005653071f29cf in handle_one_connection (arg=arg@entry=0x56530a6bdff8) at /test/10.5_dbg/sql/sql_connect.cc:1312
|
#34 0x00005653076a9aef in pfs_spawn_thread (arg=0x56530a5f4d48) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
|
#35 0x0000148660008609 in start_thread (arg=<optimized out>) at pthread_create.c:477
|
#36 0x000014865fbf7293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
|
10.4.18 Stack and version:
10.4.18 3454b5cf35a61e8f6cfab376638520dee4a50609 (Debug) |
mysqld: /test/10.4_dbg/storage/innobase/include/rem0rec.h:798: bool rec_is_metadata(const rec_t*, ulint): Assertion `!is || !comp || rec_get_status(rec) == REC_STATUS_INSTANT' failed.
|
10.4.18 3454b5cf35a61e8f6cfab376638520dee4a50609 (Debug) |
Core was generated by `/test/MD010121-mariadb-10.4.18-linux-x86_64-dbg/bin/mysqld --no-defaults --core'.
|
Program terminated with signal SIGABRT, Aborted.
|
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
|
at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
|
[Current thread is 1 (Thread 0x150020181700 (LWP 1828106))]
|
(gdb) bt
|
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
|
#1 0x0000556872d46ebd in my_write_core (sig=sig@entry=6) at /test/10.4_dbg/mysys/stacktrace.c:386
|
#2 0x000055687245dabf in handle_fatal_signal (sig=6) at /test/10.4_dbg/sql/signal_handler.cc:343
|
#3 <signal handler called>
|
#4 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
|
#5 0x0000150035c14859 in __GI_abort () at abort.c:79
|
#6 0x0000150035c14729 in __assert_fail_base (fmt=0x150035daa588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x556872fea530 "!is || !comp || rec_get_status(rec) == REC_STATUS_INSTANT", file=0x556872fea370 "/test/10.4_dbg/storage/innobase/include/rem0rec.h", line=798, function=<optimized out>) at assert.c:92
|
#7 0x0000150035c25f36 in __GI___assert_fail (assertion=assertion@entry=0x556872fea530 "!is || !comp || rec_get_status(rec) == REC_STATUS_INSTANT", file=file@entry=0x556872fea370 "/test/10.4_dbg/storage/innobase/include/rem0rec.h", line=line@entry=798, function=function@entry=0x556872fea570 "bool rec_is_metadata(const rec_t*, ulint)") at assert.c:101
|
#8 0x000055687276f70f in rec_is_metadata (comp=1, rec=0x15001498807f "x") at /test/10.4_dbg/storage/innobase/include/rem0rec.h:798
|
#9 rec_is_metadata (rec=rec@entry=0x15001498807f "x", index=@0x14ffc80224d0: {id = 26, heap = 0x14ffc80220c0, name = {m_name = 0x14ffc8023b50 "c"}, table = 0x14ffc801eb00, page = 4, merge_threshold = 50, type = 2, trx_id_offset = 0, n_user_defined_cols = 1, nulls_equal = 0, n_uniq = 1, n_def = 2, n_fields = 2, n_nullable = 1, n_core_fields = 2, n_core_null_bytes = 1, static NO_CORE_NULL_BYTES = 255, static DICT_INDEXES_ID = 3, cached = 1, to_be_dropped = 0, online_status = 0, uncommitted = 0, is_dummy = false, in_instant_init = false, magic_n = 76789786, fields = 0x14ffc8023b58, parser = 0x0, has_new_v_col = false, index_fts_syncing = false, indexes = {prev = 0x14ffc8021d70, next = 0x0}, search_info = 0x14ffc8023bc0, online_log = 0x0, stat_n_diff_key_vals = 0x14ffc8023ba8, stat_n_sample_sizes = 0x14ffc8023bb0, stat_n_non_null_key_vals = 0x14ffc8023bb8, stat_index_size = 3, stat_n_leaf_pages = 1, stats_error_printed = false, stat_defrag_modified_counter = 4, stat_defrag_n_pages_freed = 0, stat_defrag_n_page_split = 4, stat_defrag_data_size_sample = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, stat_defrag_sample_next_slot = 0, rtr_ssn = {m = {<std::__atomic_base<unsigned int>> = {static _S_alignment = 4, _M_i = 0}, <No data fields>}}, rtr_track = 0x0, trx_id = 21, zip_pad = {mutex = {<std::__mutex_base> = {_M_mutex = pthread_mutex_t = {
|
Type = Normal,
|
Status = Not acquired,
|
Robust = No,
|
Shared = No,
|
Protocol = None
|
}}, <No data fields>}, pad = {m = {<std::__atomic_base<unsigned long>> = {static _S_alignment = 8, _M_i = 0}, <No data fields>}}, success = 0, failure = 0, n_rounds = 0}, lock = {<latch_t> = {_vptr.latch_t = 0x556873512730 <vtable for rw_lock_t+16>, m_id = LATCH_ID_INDEX_TREE, m_rw_lock = true}, lock_word = {m = {<std::__atomic_base<int>> = {static _S_alignment = 4, _M_i = 268435456}, <No data fields>}}, waiters = {m = {<std::__atomic_base<unsigned int>> = {static _S_alignment = 4, _M_i = 0}, <No data fields>}}, sx_recursive = 2, writer_thread = 23090282632960, event = 0x14ffc80228a0, wait_ex_event = 0x14ffc801f580, cfile_name = 0x55687305e250 "/test/10.4_dbg/storage/innobase/dict/dict0dict.cc", last_x_file_name = 0x55687304ce60 "/test/10.4_dbg/storage/innobase/btr/btr0cur.cc", cline = 1953, is_block_lock = 0, last_x_line = 1492, count_os_wait = 0, list = {prev = 0x0, next = 0x14ffc8021ee0}, pfs_psi = 0x0, debug_list = {count = 2, start = 0x14ffc807a500, end = 0x14ffc8079520, node = &rw_lock_debug_t::list, init = 51966}, level = SYNC_INDEX_TREE}}) at /test/10.4_dbg/storage/innobase/include/rem0rec.h:809
|
#10 0x000055687295fc24 in btr_discard_only_page_on_level (mtr=0x15002017d920, block=0x15001402ec40, index=0x14ffc80224d0) at /test/10.4_dbg/storage/innobase/btr/btr0btr.cc:4159
|
#11 btr_discard_page (cursor=cursor@entry=0x15002017d6a0, mtr=mtr@entry=0x15002017d920) at /test/10.4_dbg/storage/innobase/btr/btr0btr.cc:4275
|
#12 0x000055687299ae72 in btr_cur_pessimistic_delete (err=err@entry=0x15002017d66c, has_reserved_extents=has_reserved_extents@entry=0, cursor=cursor@entry=0x15002017d6a0, flags=flags@entry=0, rollback=rollback@entry=false, mtr=mtr@entry=0x15002017d920) at /test/10.4_dbg/storage/innobase/btr/btr0cur.cc:6050
|
#13 0x0000556872b18793 in row_undo_ins_remove_sec_low (mode=<optimized out>, mode@entry=65569, index=index@entry=0x14ffc80224d0, entry=entry@entry=0x14ffc8078b80, thr=thr@entry=0x14ffc8020ed0) at /test/10.4_dbg/storage/innobase/row/row0uins.cc:309
|
#14 0x0000556872b19d9c in row_undo_ins_remove_sec (thr=0x14ffc8020ed0, entry=0x14ffc8078b80, index=0x14ffc80224d0) at /test/10.4_dbg/storage/innobase/row/row0uins.cc:361
|
#15 row_undo_ins_remove_sec_rec (thr=0x14ffc8020ed0, node=0x14ffc80785f0) at /test/10.4_dbg/storage/innobase/row/row0uins.cc:525
|
#16 row_undo_ins (node=node@entry=0x14ffc80785f0, thr=thr@entry=0x14ffc8020ed0) at /test/10.4_dbg/storage/innobase/row/row0uins.cc:577
|
#17 0x00005568728b82dc in row_undo (thr=0x14ffc8020ed0, node=0x14ffc80785f0) at /test/10.4_dbg/storage/innobase/row/row0undo.cc:439
|
#18 row_undo_step (thr=thr@entry=0x14ffc8020ed0) at /test/10.4_dbg/storage/innobase/row/row0undo.cc:501
|
#19 0x00005568727fb6fb in que_thr_step (thr=0x14ffc8020ed0) at /test/10.4_dbg/storage/innobase/que/que0que.cc:1037
|
#20 que_run_threads_low (thr=0x14ffc8020ed0) at /test/10.4_dbg/storage/innobase/que/que0que.cc:1101
|
#21 que_run_threads (thr=<optimized out>) at /test/10.4_dbg/storage/innobase/que/que0que.cc:1141
|
#22 0x0000556872922783 in trx_rollback_to_savepoint_low (trx=trx@entry=0x1500348ef228, savept=savept@entry=0x0) at /test/10.4_dbg/storage/innobase/trx/trx0roll.cc:136
|
#23 0x000055687292373a in trx_rollback_for_mysql_low (trx=0x1500348ef228) at /test/10.4_dbg/storage/innobase/trx/trx0roll.cc:210
|
#24 trx_rollback_for_mysql (trx=trx@entry=0x1500348ef228) at /test/10.4_dbg/storage/innobase/trx/trx0roll.cc:240
|
#25 0x00005568726ba362 in innobase_rollback (hton=<optimized out>, thd=0x14ffc8000d90, rollback_trx=<optimized out>) at /test/10.4_dbg/storage/innobase/handler/ha_innodb.cc:4671
|
#26 0x0000556872462d4e in ha_rollback_trans (thd=thd@entry=0x14ffc8000d90, all=all@entry=false) at /test/10.4_dbg/sql/handler.cc:1912
|
#27 0x00005568722e81a7 in trans_rollback_stmt (thd=thd@entry=0x14ffc8000d90) at /test/10.4_dbg/sql/transaction.cc:495
|
#28 0x0000556872192639 in mysql_execute_command (thd=thd@entry=0x14ffc8000d90) at /test/10.4_dbg/sql/sql_parse.cc:6211
|
#29 0x00005568721940d4 in mysql_parse (thd=thd@entry=0x14ffc8000d90, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x150020180490, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.4_dbg/sql/sql_parse.cc:7958
|
#30 0x0000556872196972 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14ffc8000d90, packet=packet@entry=0x14ffc801a271 "INSERT INTO t1 VALUES (1,'x'),(1,'d'),(1,'r'),(1,'f'),(1,'y'),(1,'u'),(1,'m'),(1,'b'),(1,'o'),(1,'w'),(1,'m'),(1,'q'),(1,'a'),(1,'d'),(1,'g'),(1,'x'),(1,'f'),(1,'p'),(1,'j'),(1,'c')", packet_length=packet_length@entry=181, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.4_dbg/sql/sql_class.h:1170
|
#31 0x000055687219a12b in do_command (thd=0x14ffc8000d90) at /test/10.4_dbg/sql/sql_parse.cc:1373
|
#32 0x00005568722d3e4f in do_handle_one_connection (connect=connect@entry=0x5568751a2ac0) at /test/10.4_dbg/sql/sql_connect.cc:1412
|
#33 0x00005568722d3f6e in handle_one_connection (arg=0x5568751a2ac0) at /test/10.4_dbg/sql/sql_connect.cc:1316
|
#34 0x00001500361d1609 in start_thread (arg=<optimized out>) at pthread_create.c:477
|
#35 0x0000150035d11293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
|
Attachments
Issue Links
- is caused by
-
MDEV-15562 Instant DROP COLUMN or changing the order of columns
-
- Closed
-
The assertion fails on the rollback of the INSERT statement, as part of handling a duplicate key error. Some code that was introduced in
MDEV-15562is wrongly being executed on the index root page, instead of the index leaf page. The intention was to preserve the metadata record in the primary key index. Instead, it is trying to preserve the leftmost node pointer record if it happens to carry the delete-mark flag (which is garbage on non-leaf pages).The impact of this bug seems to be that any index may become corrupted after the
MDEV-15562functionality was used (a column was dropped or the order of columns was changed, without rebuilding the table) and the table became empty. The instant operation is enabled by default, but it may be explicitly disabled by overriding the parameter innodb_instant_alter_column_allowed, which was introduced inMDEV-20590.As far as I can tell, the scenario should be rare: the table would not only have to become completely empty, but there should also be an intermediate step where the root page has exactly one child page. The function btr_discard_only_page_on_level() is only executed in that case. Normally, a non-leaf B-tree page should have at least 2 child pages.