[MDEV-22855] Assertion `!field->prefix_len || field->fixed_len == field->prefix_len' failed in btr_node_ptr_max_size and in dict_index_node_ptr_max_size Created: 2020-06-10  Updated: 2023-11-28

Status: Confirmed
Project: MariaDB Server
Component/s: Character Sets, Storage Engine - InnoDB
Affects Version/s: 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11, 11.0
Fix Version/s: 10.4, 10.5, 10.6, 10.11

Type: Bug Priority: Major
Reporter: Roel Van de Paar Assignee: Marko Mäkelä
Resolution: Unresolved Votes: 0
Labels: not-10.1, upstream-5.7, upstream-8.0


 Description   

USE test;
CREATE TABLE t(c CHAR(255) CHARACTER SET UTF32, KEY k1(c)) ENGINE=MyISAM;
INSERT INTO t VALUES(100000);
ALTER TABLE t ENGINE=InnoDB;

Leads to:

10.5.4 6877ef9a7c9c7ee55d67e4baaf4e8f7b874c9f89

mysqld: /test/10.5_dbg/storage/innobase/btr/btr0cur.cc:1099: ulint btr_node_ptr_max_size(const dict_index_t*): Assertion `!field->prefix_len || field->fixed_len == field->prefix_len' failed.

10.5.4 6877ef9a7c9c7ee55d67e4baaf4e8f7b874c9f89

Core was generated by `/test/MD060620-mariadb-10.5.4-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:57
[Current thread is 1 (Thread 0x154e9e4c1700 (LWP 3147773))]
(gdb) bt
(gdb) (gdb) #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
#1  0x000055a4d822000d in my_write_core (sig=sig@entry=6) at /test/10.5_dbg/mysys/stacktrace.c:518
#2  0x000055a4d79c9bbc 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:51
#5  0x0000154ea6e0f801 in __GI_abort () at abort.c:79
#6  0x0000154ea6dff39a in __assert_fail_base (fmt=0x154ea6f867d8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x55a4d86ad5e8 "!field->prefix_len || field->fixed_len == field->prefix_len", file=file@entry=0x55a4d86ad558 "/test/10.5_dbg/storage/innobase/btr/btr0cur.cc", line=line@entry=1099, function=function@entry=0x55a4d86b3960 <btr_node_ptr_max_size(dict_index_t const*)::__PRETTY_FUNCTION__> "ulint btr_node_ptr_max_size(const dict_index_t*)") at assert.c:92
#7  0x0000154ea6dff412 in __GI___assert_fail (assertion=assertion@entry=0x55a4d86ad5e8 "!field->prefix_len || field->fixed_len == field->prefix_len", file=file@entry=0x55a4d86ad558 "/test/10.5_dbg/storage/innobase/btr/btr0cur.cc", line=line@entry=1099, function=function@entry=0x55a4d86b3960 <btr_node_ptr_max_size(dict_index_t const*)::__PRETTY_FUNCTION__> "ulint btr_node_ptr_max_size(const dict_index_t*)") at assert.c:101
#8  0x000055a4d8009c76 in btr_node_ptr_max_size (index=index@entry=0x154e864bda18) at /test/10.5_dbg/storage/innobase/btr/btr0cur.cc:1099
#9  0x000055a4d802284d in btr_cur_search_to_nth_level_func (index=index@entry=0x154e864bda18, level=level@entry=0, tuple=tuple@entry=0x154e864b4930, mode=mode@entry=PAGE_CUR_LE, latch_mode=<optimized out>, latch_mode@entry=514, cursor=cursor@entry=0x154e9e4baf80, ahi_latch=0x0, file=0x55a4d8663680 "/test/10.5_dbg/storage/innobase/row/row0ins.cc", line=2947, mtr=0x154e9e4bb500, autoinc=0) at /test/10.5_dbg/storage/innobase/btr/btr0cur.cc:1524
#10 0x000055a4d7edc7ee in row_ins_sec_index_entry_low (flags=flags@entry=3, mode=mode@entry=2, index=index@entry=0x154e864bda18, offsets_heap=<optimized out>, offsets_heap@entry=0x154e86457a18, heap=heap@entry=0x154e86458418, entry=entry@entry=0x154e864b4930, trx_id=29, thr=0x154e86558bb0) at /test/10.5_dbg/storage/innobase/row/row0ins.cc:2944
#11 0x000055a4d7ee2051 in row_ins_sec_index_entry (index=index@entry=0x154e864bda18, entry=entry@entry=0x154e864b4930, thr=thr@entry=0x154e86558bb0, check_foreign=check_foreign@entry=true) at /test/10.5_dbg/storage/innobase/row/row0ins.cc:3266
#12 0x000055a4d7ee3acf in row_ins_index_entry (thr=0x154e86558bb0, entry=0x154e864b4930, index=0x154e864bda18) at /test/10.5_dbg/storage/innobase/row/row0ins.cc:3313
#13 row_ins_index_entry_step (thr=0x154e86558bb0, node=0x154e86558590) at /test/10.5_dbg/storage/innobase/row/row0ins.cc:3480
#14 row_ins (thr=0x154e86558bb0, node=0x154e86558590) at /test/10.5_dbg/storage/innobase/row/row0ins.cc:3617
#15 row_ins_step (thr=thr@entry=0x154e86558bb0) at /test/10.5_dbg/storage/innobase/row/row0ins.cc:3756
#16 0x000055a4d7f039f1 in row_insert_for_mysql (mysql_rec=mysql_rec@entry=0x154e86525ca0 <incomplete sequence \375>, prebuilt=0x154e86558098, ins_mode=ROW_INS_NORMAL) at /test/10.5_dbg/storage/innobase/row/row0mysql.cc:1461
#17 0x000055a4d7d9c8d8 in ha_innobase::write_row (this=0x154e865248a0, record=0x154e86525ca0 <incomplete sequence \375>) at /test/10.5_dbg/storage/innobase/handler/ha_innodb.cc:7729
#18 0x000055a4d79dda26 in handler::ha_write_row (this=0x154e865248a0, buf=0x154e86525ca0 <incomplete sequence \375>) at /test/10.5_dbg/sql/handler.cc:6999
#19 0x000055a4d77f8025 in copy_data_between_tables (alter_ctx=0x154e9e4be630, keys_onoff=<optimized out>, deleted=<synthetic pointer>, copied=<synthetic pointer>, order=<optimized out>, order_num=0, ignore=false, create=@0x154e9e4be750: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x0, last = 0x0, elements = 0}, <No data fields>}, to=0x154e86557088, from=0x154e864aa088, thd=0x154e86415088) at /test/10.5_dbg/sql/sql_table.cc:11231
#20 mysql_alter_table (thd=thd@entry=0x154e86415088, new_db=new_db@entry=0x154e86419950, new_name=new_name@entry=0x154e86419d58, create_info=create_info@entry=0x154e9e4bf220, table_list=<optimized out>, table_list@entry=0x154e86474188, alter_info=alter_info@entry=0x154e9e4bf150, order_num=0, order=0x0, ignore=false, if_exists=false) at /test/10.5_dbg/sql/sql_table.cc:10610
#21 0x000055a4d787a82c in Sql_cmd_alter_table::execute (this=<optimized out>, thd=0x154e86415088) at /test/10.5_dbg/sql/sql_alter.cc:532
#22 0x000055a4d7724a13 in mysql_execute_command (thd=thd@entry=0x154e86415088) at /test/10.5_dbg/sql/sql_parse.cc:5950
#23 0x000055a4d772c322 in mysql_parse (thd=thd@entry=0x154e86415088, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x154e9e4c0350, 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:7992
#24 0x000055a4d7718e1c in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x154e86415088, packet=packet@entry=0x154e86467089 "ALTER TABLE t ENGINE=InnoDB", packet_length=packet_length@entry=27, 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:1874
#25 0x000055a4d77175f6 in do_command (thd=0x154e86415088) at /test/10.5_dbg/sql/sql_parse.cc:1355
#26 0x000055a4d78729f9 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x154e88515808, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1411
#27 0x000055a4d7873115 in handle_one_connection (arg=arg@entry=0x154e88515808) at /test/10.5_dbg/sql/sql_connect.cc:1313
#28 0x000055a4d7cd2104 in pfs_spawn_thread (arg=0x154ea5845888) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
#29 0x0000154ea7af26db in start_thread (arg=0x154e9e4c1700) at pthread_create.c:463
#30 0x0000154ea6ef088f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Bug confirmed present in:
MariaDB: 10.2.33 (dbg), 10.3.24 (dbg), 10.4.14 (dbg), 10.5.4 (dbg)

Bug confirmed not present in:
MariaDB: 10.1.46 (dbg), 10.1.46 (opt), 10.2.33 (opt), 10.3.24 (opt), 10.4.14 (opt), 10.5.4 (opt)
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.47 (dbg), 5.6.47 (opt), 5.7.29 (dbg), 5.7.29 (opt), 8.0.19 (dbg), 8.0.19 (opt)



 Comments   
Comment by Roel Van de Paar [ 2022-08-08 ]

Similar but not identical testcase and stack.

SET foreign_key_checks=0,unique_checks=0;
CREATE TABLE t (a CHAR(255) CHARACTER SET UTF32,KEY k (a (200))) ENGINE=InnoDB;
INSERT INTO t VALUES (0xAEDB);
DELETE t2.* FROM t t2;

Leads to:

10.10.0 e1caa4bd5e8b4645944b85d4b603bf9fc9ef6ca4 (Debug)

mysqld: /test/10.10_dbg/storage/innobase/btr/btr0cur.cc:1091: ulint btr_node_ptr_max_size(const dict_index_t*): Assertion `!field->prefix_len || field->fixed_len == field->prefix_len' failed.

10.10.0 e1caa4bd5e8b4645944b85d4b603bf9fc9ef6ca4 (Debug)

Core was generated by `/test/MD290722-mariadb-10.10.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 0x153e2c059700 (LWP 1671381))]
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x0000153e463db859 in __GI_abort () at abort.c:79
#2  0x0000153e463db729 in __assert_fail_base (fmt=0x153e46571588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x56281d6ff9c0 "!field->prefix_len || field->fixed_len == field->prefix_len", file=0x56281d6ff8b0 "/test/10.10_dbg/storage/innobase/btr/btr0cur.cc", line=1091, function=<optimized out>) at assert.c:92
#3  0x0000153e463ecfd6 in __GI___assert_fail (assertion=assertion@entry=0x56281d6ff9c0 "!field->prefix_len || field->fixed_len == field->prefix_len", file=file@entry=0x56281d6ff8b0 "/test/10.10_dbg/storage/innobase/btr/btr0cur.cc", line=line@entry=1091, function=function@entry=0x56281d6ff988 "ulint btr_node_ptr_max_size(const dict_index_t*)") at assert.c:101
#4  0x000056281d105989 in btr_node_ptr_max_size (index=index@entry=0x153d94025080) at /test/10.10_dbg/storage/innobase/btr/btr0cur.cc:1091
#5  0x000056281d11ec96 in btr_cur_search_to_nth_level_func (index=index@entry=0x153d94025080, level=level@entry=0, tuple=tuple@entry=0x153d94073560, mode=mode@entry=PAGE_CUR_LE, latch_mode=<optimized out>, latch_mode@entry=130, cursor=cursor@entry=0x153e2c056f00, ahi_latch=0x0, mtr=0x153e2c057170, autoinc=0) at /test/10.10_dbg/storage/innobase/btr/btr0cur.cc:1495
#6  0x000056281d051b60 in btr_pcur_open_low (mtr=0x153e2c057170, autoinc=0, cursor=0x153e2c056f00, latch_mode=130, mode=PAGE_CUR_LE, tuple=0x153d94073560, level=0, index=0x153d94025080) at /test/10.10_dbg/storage/innobase/include/btr0pcur.inl:346
#7  row_search_index_entry (index=index@entry=0x153d94025080, entry=entry@entry=0x153d94073560, mode=130, pcur=pcur@entry=0x153e2c056f00, mtr=mtr@entry=0x153e2c057170) at /test/10.10_dbg/storage/innobase/row/row0row.cc:1304
#8  0x000056281d0784a2 in row_upd_sec_index_entry (node=node@entry=0x153d94070b80, thr=thr@entry=0x153d94070e48) at /test/10.10_dbg/storage/innobase/row/row0upd.cc:1939
#9  0x000056281d07ba62 in row_upd_sec_step (thr=0x153d94070e48, node=0x153d94070b80) at /test/10.10_dbg/storage/innobase/row/row0upd.cc:2094
#10 row_upd (thr=0x153d94070e48, node=0x153d94070b80) at /test/10.10_dbg/storage/innobase/row/row0upd.cc:2818
#11 row_upd_step (thr=thr@entry=0x153d94070e48) at /test/10.10_dbg/storage/innobase/row/row0upd.cc:2933
#12 0x000056281d022cce in row_update_for_mysql (prebuilt=0x153d9402a3a0) at /test/10.10_dbg/storage/innobase/row/row0mysql.cc:1689
#13 0x000056281ce9b636 in ha_innobase::delete_row (this=0x153d940292a0, record=0x153d94029b10 <incomplete sequence \375>) at /test/10.10_dbg/storage/innobase/handler/ha_innodb.cc:8706
#14 0x000056281cb99af3 in handler::ha_delete_row (this=0x153d940292a0, buf=0x153d94029b10 <incomplete sequence \375>) at /test/10.10_dbg/sql/handler.cc:7683
#15 0x000056281c84936c in TABLE::delete_row (this=0x153d94028a58) at /test/10.10_dbg/sql/sql_delete.cc:281
#16 multi_delete::send_data (this=0x153d94014c08, values=<optimized out>) at /test/10.10_dbg/sql/sql_delete.cc:1376
#17 0x000056281c914ff9 in select_result_sink::send_data_with_check (sent=<optimized out>, u=<optimized out>, items=@0x153d94005a90: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x153d94014bb8, last = 0x153d94014bb8, elements = 1}, <No data fields>}, this=<optimized out>) at /test/10.10_dbg/sql/sql_class.h:5699
#18 end_send (join=0x153d94014c70, join_tab=0x153d940163c8, end_of_records=<optimized out>) at /test/10.10_dbg/sql/sql_select.cc:22976
#19 0x000056281c8e5d13 in evaluate_join_record (join=join@entry=0x153d94014c70, join_tab=join_tab@entry=0x153d94016010, error=error@entry=0) at /test/10.10_dbg/sql/sql_select.cc:21970
#20 0x000056281c8fa1bb in sub_select (join=0x153d94014c70, join_tab=0x153d94016010, end_of_records=false) at /test/10.10_dbg/sql/sql_select.cc:21740
#21 0x000056281c930397 in do_select (procedure=<optimized out>, join=0x153d94014c70) at /test/10.10_dbg/sql/sql_select.cc:21285
#22 JOIN::exec_inner (this=this@entry=0x153d94014c70) at /test/10.10_dbg/sql/sql_select.cc:4804
#23 0x000056281c930930 in JOIN::exec (this=this@entry=0x153d94014c70) at /test/10.10_dbg/sql/sql_select.cc:4582
#24 0x000056281c92e6b4 in mysql_select (thd=thd@entry=0x153d94000db8, tables=0x153d94014448, fields=@0x153d94005a90: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x153d94014bb8, last = 0x153d94014bb8, elements = 1}, <No data fields>}, conds=conds@entry=0x0, og_num=og_num@entry=0, order=order@entry=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2202446072704, result=0x153d94014c08, unit=0x153d94004ff0, select_lex=0x153d940057f0) at /test/10.10_dbg/sql/sql_select.cc:5062
#25 0x000056281c8a7e91 in mysql_execute_command (thd=thd@entry=0x153d94000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.10_dbg/sql/sql_parse.cc:4862
#26 0x000056281c893534 in mysql_parse (thd=thd@entry=0x153d94000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x153e2c058330) at /test/10.10_dbg/sql/sql_parse.cc:8037
#27 0x000056281c8a0b1c in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x153d94000db8, packet=packet@entry=0x153d9400b6e9 "DELETE t2.* FROM t t2", packet_length=packet_length@entry=21, blocking=blocking@entry=true) at /test/10.10_dbg/sql/sql_class.h:1366
#28 0x000056281c8a3226 in do_command (thd=0x153d94000db8, blocking=blocking@entry=true) at /test/10.10_dbg/sql/sql_parse.cc:1407
#29 0x000056281ca04744 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x56281ff84498, put_in_cache=put_in_cache@entry=true) at /test/10.10_dbg/sql/sql_connect.cc:1418
#30 0x000056281ca04c4d in handle_one_connection (arg=0x56281ff84498) at /test/10.10_dbg/sql/sql_connect.cc:1312
#31 0x0000153e468ec609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#32 0x0000153e464d8133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

MySQL 5.7.38 (Debug)

InnoDB: Failing assertion: !field->prefix_len || field->fixed_len == field->prefix_len

MySQL 5.7.38 (Debug)

Core was generated by `/test/MS310522-mysql-5.7.38-linux-x86_64-dbg/bin/mysqld --no-defaults --core-fi'.
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 0x14e905a49700 (LWP 1675662))]
(gdb) bt
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
#1  0x000055bfe3ba9315 in my_write_core (sig=sig@entry=6) at /test/5.7_dbg/include/my_thread.h:105
#2  0x000055bfe325552d in handle_fatal_signal (sig=6) at /test/5.7_dbg/sql/signal_handler.cc:227
#3  <signal handler called>
#4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#5  0x000014e921a00859 in __GI_abort () at abort.c:79
#6  0x000055bfe3e71906 in ut_dbg_assertion_failed (expr=expr@entry=0x55bfe43fcf08 "!field->prefix_len || field->fixed_len == field->prefix_len", file=file@entry=0x55bfe43fce70 "/test/5.7_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=2376) at /test/5.7_dbg/storage/innobase/ut/ut0dbg.cc:75
#7  0x000055bfe3f44419 in dict_index_node_ptr_max_size (index=index@entry=0x14e8c800b1a0) at /test/5.7_dbg/storage/innobase/dict/dict0dict.cc:2376
#8  0x000055bfe3eaa351 in btr_cur_search_to_nth_level (index=index@entry=0x14e8c800b1a0, level=level@entry=0, tuple=tuple@entry=0x14e8c800c420, mode=mode@entry=PAGE_CUR_LE, latch_mode=<optimized out>, latch_mode@entry=2562, cursor=cursor@entry=0x14e905a45990, has_search_latch=0, file=0x55bfe43d34c0 "/test/5.7_dbg/storage/innobase/row/row0ins.cc", line=3033, mtr=0x14e905a45d50) at /test/5.7_dbg/storage/innobase/btr/btr0cur.cc:1032
#9  0x000055bfe3d410c5 in row_ins_sec_index_entry_low (flags=flags@entry=0, mode=mode@entry=2, index=index@entry=0x14e8c800b1a0, offsets_heap=<optimized out>, offsets_heap@entry=0x14e8c801f958, heap=heap@entry=0x14e8c80220d8, entry=entry@entry=0x14e8c800c420, trx_id=0, thr=0x14e8c8024198, dup_chk_only=false) at /test/5.7_dbg/storage/innobase/row/row0ins.cc:3030
#10 0x000055bfe3d424e9 in row_ins_sec_index_entry (index=index@entry=0x14e8c800b1a0, entry=entry@entry=0x14e8c800c420, thr=thr@entry=0x14e8c8024198, dup_chk_only=dup_chk_only@entry=false) at /test/5.7_dbg/storage/innobase/row/row0ins.cc:3415
#11 0x000055bfe3d42907 in row_ins_index_entry (index=0x14e8c800b1a0, entry=0x14e8c800c420, thr=thr@entry=0x14e8c8024198) at /test/5.7_dbg/storage/innobase/row/row0ins.cc:3466
#12 0x000055bfe3d429d6 in row_ins_index_entry_step (node=node@entry=0x14e8c8023b48, thr=thr@entry=0x14e8c8024198) at /test/5.7_dbg/storage/innobase/row/row0ins.cc:3614
#13 0x000055bfe3d42aca in row_ins (node=node@entry=0x14e8c8023b48, thr=thr@entry=0x14e8c8024198) at /test/5.7_dbg/storage/innobase/row/row0ins.cc:3752
#14 0x000055bfe3d43546 in row_ins_step (thr=thr@entry=0x14e8c8024198) at /test/5.7_dbg/storage/innobase/row/row0ins.cc:3888
#15 0x000055bfe3d5ecfb in row_insert_for_mysql_using_ins_graph (mysql_rec=<optimized out>, prebuilt=<optimized out>) at /test/5.7_dbg/storage/innobase/row/row0mysql.cc:1746
#16 0x000055bfe3d62c0c in row_insert_for_mysql (mysql_rec=mysql_rec@entry=0x14e8c80218b0 <incomplete sequence \375>, prebuilt=<optimized out>) at /test/5.7_dbg/storage/innobase/row/row0mysql.cc:1866
#17 0x000055bfe3bfdf72 in ha_innobase::write_row (this=0x14e8c8019fc0, record=0x14e8c80218b0 <incomplete sequence \375>) at /test/5.7_dbg/storage/innobase/handler/ha_innodb.cc:7667
#18 0x000055bfe32c9f8d in handler::ha_write_row (this=0x14e8c8019fc0, buf=0x14e8c80218b0 <incomplete sequence \375>) at /test/5.7_dbg/sql/handler.cc:8173
#19 0x000055bfe3a93052 in write_record (thd=thd@entry=0x14e8c8000e10, table=table@entry=0x14e8c8020ef0, info=info@entry=0x14e905a472a0, update=update@entry=0x14e905a47320) at /test/5.7_dbg/sql/sql_insert.cc:1895
#20 0x000055bfe3a945a5 in Sql_cmd_insert::mysql_insert (this=this@entry=0x14e8c8005bd8, thd=thd@entry=0x14e8c8000e10, table_list=table_list@entry=0x14e8c8005648) at /test/5.7_dbg/sql/sql_insert.cc:776
#21 0x000055bfe3a94b02 in Sql_cmd_insert::execute (this=0x14e8c8005bd8, thd=0x14e8c8000e10) at /test/5.7_dbg/sql/sql_insert.cc:3142
#22 0x000055bfe38aaa97 in mysql_execute_command (thd=thd@entry=0x14e8c8000e10, first_level=first_level@entry=true) at /test/5.7_dbg/sql/sql_parse.cc:3609
#23 0x000055bfe38affd9 in mysql_parse (thd=thd@entry=0x14e8c8000e10, parser_state=parser_state@entry=0x14e905a48530) at /test/5.7_dbg/sql/sql_parse.cc:5600
#24 0x000055bfe38b2231 in dispatch_command (thd=thd@entry=0x14e8c8000e10, com_data=com_data@entry=0x14e905a48df0, command=COM_QUERY) at /test/5.7_dbg/sql/sql_parse.cc:1493
#25 0x000055bfe38b430e in do_command (thd=thd@entry=0x14e8c8000e10) at /test/5.7_dbg/sql/sql_parse.cc:1032
#26 0x000055bfe39af428 in handle_connection (arg=arg@entry=0x55bfe6c5e080) at /test/5.7_dbg/sql/conn_handler/connection_handler_per_thread.cc:313
#27 0x000055bfe40b6535 in pfs_spawn_thread (arg=0x55bfe6a09810) at /test/5.7_dbg/storage/perfschema/pfs.cc:2197
#28 0x000014e921f26609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#29 0x000014e921afd133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

MySQL 8.0.29 (Debug)

Core was generated by `/test/MS310522-mysql-8.0.29-linux-x86_64-dbg/bin/mysqld --no-defaults --core-fi'.
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 0x151690e5a700 (LWP 4070692))]
(gdb) bt
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
#1  0x000056100f851553 in my_write_core (sig=sig@entry=6) at /test/8.0_dbg/include/my_thread.h:78
#2  0x000056100e484038 in handle_fatal_signal (sig=6) at /test/8.0_dbg/sql/signal_handler.cc:202
#3  <signal handler called>
#4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#5  0x00001516b4efd859 in __GI_abort () at abort.c:79
#6  0x000056100e48410d in my_server_abort () at /test/8.0_dbg/sql/signal_handler.cc:258
#7  0x000056100f849b59 in my_abort () at /test/8.0_dbg/mysys/my_init.cc:258
#8  0x000056100fc9412e in ut_dbg_assertion_failed (expr=expr@entry=0x561010f6d720 "!field->prefix_len || field->fixed_len == field->prefix_len", file=file@entry=0x561010f6d4c8 "/test/8.0_dbg/storage/innobase/dict/dict0dict.cc", line=line@entry=2072) at /test/8.0_dbg/storage/innobase/ut/ut0dbg.cc:99
#9  0x000056100fdfdfbe in dict_index_node_ptr_max_size (index=index@entry=0x1516040bc8b8) at /test/8.0_dbg/storage/innobase/dict/dict0dict.cc:2072
#10 0x000056100fd1a4fd in btr_cur_search_to_nth_level (index=index@entry=0x1516040bc8b8, level=level@entry=0, tuple=tuple@entry=0x151604026b78, mode=mode@entry=PAGE_CUR_LE, latch_mode=<optimized out>, latch_mode@entry=2562, cursor=cursor@entry=0x151690e55bb0, has_search_latch=0, file=0x561010f48e68 "/test/8.0_dbg/storage/innobase/row/row0ins.cc", line=2891, mtr=0x151690e55f70) at /test/8.0_dbg/storage/innobase/btr/btr0cur.cc:888
#11 0x000056100fb36fd8 in row_ins_sec_index_entry_low (flags=flags@entry=0, mode=<optimized out>, mode@entry=2, index=index@entry=0x1516040bc8b8, offsets_heap=<optimized out>, offsets_heap@entry=0x151604120200, heap=heap@entry=0x151604095a10, entry=entry@entry=0x151604026b78, trx_id=0, thr=0x151604124368, dup_chk_only=false) at /test/8.0_dbg/storage/innobase/row/row0ins.cc:2890
#12 0x000056100fb3c6ca in row_ins_sec_index_entry (index=index@entry=0x1516040bc8b8, entry=entry@entry=0x151604026b78, thr=thr@entry=0x151604124368, dup_chk_only=dup_chk_only@entry=false) at /test/8.0_dbg/storage/innobase/row/row0ins.cc:3201
#13 0x000056100fb3d04e in row_ins_index_entry (index=0x1516040bc8b8, entry=0x151604026b78, multi_val_pos=@0x151604123d68: 0, thr=thr@entry=0x151604124368) at /test/8.0_dbg/storage/innobase/row/row0ins.cc:3301
#14 0x000056100fb3d175 in row_ins_index_entry_step (node=node@entry=0x151604123cb0, thr=thr@entry=0x151604124368) at /test/8.0_dbg/storage/innobase/row/row0ins.cc:3433
#15 0x000056100fb3d7fa in row_ins (node=node@entry=0x151604123cb0, thr=thr@entry=0x151604124368) at /test/8.0_dbg/storage/innobase/row/row0ins.cc:3552
#16 0x000056100fb3dcbe in row_ins_step (thr=thr@entry=0x151604124368) at /test/8.0_dbg/storage/innobase/row/row0ins.cc:3676
#17 0x000056100fb4d13c in row_insert_for_mysql_using_ins_graph (mysql_rec=<optimized out>, prebuilt=<optimized out>) at /test/8.0_dbg/storage/innobase/row/row0mysql.cc:1582
#18 0x000056100fb4d4f2 in row_insert_for_mysql (mysql_rec=mysql_rec@entry=0x151604122350 <incomplete sequence \375>, prebuilt=<optimized out>) at /test/8.0_dbg/storage/innobase/row/row0mysql.cc:1712
#19 0x000056100f949a2d in ha_innobase::write_row (this=0x151604120c80, record=0x151604122350 <incomplete sequence \375>) at /test/8.0_dbg/storage/innobase/handler/ha_innodb.cc:8912
#20 0x000056100e5e3f55 in handler::ha_write_row (this=0x151604120c80, buf=0x151604122350 <incomplete sequence \375>) at /test/8.0_dbg/sql/handler.cc:7969
#21 0x000056100e9578ea in write_record (thd=thd@entry=0x151604000be0, table=table@entry=0x15160411f880, info=info@entry=0x151690e57530, update=update@entry=0x151690e575b0) at /test/8.0_dbg/sql/sql_insert.cc:2165
#22 0x000056100e958380 in Sql_cmd_insert_values::execute_inner (this=0x151604099330, thd=0x151604000be0) at /test/8.0_dbg/sql/sql_insert.cc:635
#23 0x000056100e33d031 in Sql_cmd_dml::execute (this=0x151604099330, thd=0x151604000be0) at /test/8.0_dbg/sql/sql_select.cc:584
#24 0x000056100e2b4417 in mysql_execute_command (thd=thd@entry=0x151604000be0, first_level=first_level@entry=true) at /test/8.0_dbg/sql/sql_parse.cc:3575
#25 0x000056100e2b8495 in dispatch_sql_command (thd=0x151604000be0, parser_state=parser_state@entry=0x151690e58b50) at /test/8.0_dbg/sql/sql_parse.cc:5207
#26 0x000056100e2bae87 in dispatch_command (thd=<optimized out>, thd@entry=0x151604000be0, com_data=com_data@entry=0x151690e59b60, command=COM_QUERY) at /test/8.0_dbg/sql/sql_parse.cc:1957
#27 0x000056100e2bdf2c in do_command (thd=thd@entry=0x151604000be0) at /test/8.0_dbg/sql/sql_parse.cc:1352
#28 0x000056100e471fe0 in handle_connection (arg=arg@entry=0x5610151d1a10) at /test/8.0_dbg/sql/conn_handler/connection_handler_per_thread.cc:302
#29 0x00005610100c3ecc in pfs_spawn_thread (arg=0x5610151d7110) at /test/8.0_dbg/storage/perfschema/pfs.cc:2942
#30 0x00001516b58af609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#31 0x00001516b4ffa133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Bug confirmed present in:
MariaDB: 10.3.36 (dbg), 10.4.26 (dbg), 10.5.17 (dbg), 10.6.9 (dbg), 10.7.5 (dbg), 10.8.4 (dbg), 10.9.2 (dbg), 10.10.0 (dbg)
MySQL: 5.7.38 (dbg), 8.0.29 (dbg)

Bug (or feature/syntax) confirmed not present in:
MariaDB: 10.3.36 (opt), 10.4.26 (opt), 10.5.17 (opt), 10.6.9 (opt), 10.7.5 (opt), 10.8.4 (opt), 10.9.2 (opt), 10.10.0 (opt)
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.38 (opt), 8.0.29 (opt)

UniqueID's/stacks seen for this testcase across versions (MariaDB + MySQL)

!field->prefix_len || field->fixed_len == field->prefix_len|SIGABRT|btr_node_ptr_max_size|btr_cur_search_to_nth_level_func|btr_pcur_open_low|row_search_index_entry
!field->prefix_len || field->fixed_len == field->prefix_len|SIGABRT|btr_node_ptr_max_size|btr_cur_search_to_nth_level_func|row_ins_sec_index_entry_low|row_ins_sec_index_entry
!field->prefix_len || field->fixed_len == field->prefix_len|SIGABRT|ut_dbg_assertion_failed|dict_index_node_ptr_max_size|btr_cur_search_to_nth_level|row_ins_sec_index_entry_low
SIGABRT|my_server_abort|my_abort|ut_dbg_assertion_failed|dict_index_node_ptr_max_size

The second one of this list is also the one for the original testcase of this bug. Please add both testcases to MTR. Thank you

Comment by Roel Van de Paar [ 2022-11-08 ]

A slightly different stack with this testcase:

CREATE TABLE t (a CHAR(255) CHARACTER SET UTF32,KEY k1 (a (254))) ENGINE=InnoDB;
INSERT INTO t VALUES();

!field->prefix_len || field->fixed_len == field->prefix_len|SIGABRT|btr_node_ptr_max_size|btr_cur_search_to_nth_level|row_ins_sec_index_entry_low|row_ins_sec_index_entry

Comment by Roel Van de Paar [ 2023-02-24 ]

Found an additional stack with this testcase:

CREATE TABLE t (c CHAR(255) CHARACTER SET UTF32,KEY(c(254))) ENGINE=InnoDB ;
INSERT INTO t VALUES (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23),(27);
INSERT INTO t VALUES (0xA9DB);

Leads to:

!field->prefix_len || field->fixed_len == field->prefix_len|SIGABRT|btr_node_ptr_max_size|btr_cur_t::search_leaf|row_ins_sec_index_entry_low|row_ins_sec_index_entry

Comment by Roel Van de Paar [ 2023-02-24 ]

FYI, the testcase in the last comment provides a wide variety of the stacks across versions:

!field->prefix_len || field->fixed_len == field->prefix_len|SIGABRT|btr_node_ptr_max_size|btr_cur_search_to_nth_level|row_ins_sec_index_entry_low|row_ins_sec_index_entry
!field->prefix_len || field->fixed_len == field->prefix_len|SIGABRT|btr_node_ptr_max_size|btr_cur_t::search_leaf|row_ins_sec_index_entry_low|row_ins_sec_index_entry
!field->prefix_len || field->fixed_len == field->prefix_len|SIGABRT|ut_dbg_assertion_failed|dict_index_node_ptr_max_size|btr_cur_search_to_nth_level|row_ins_sec_index_entry_low
SIGABRT|my_server_abort|my_abort|ut_dbg_assertion_failed|dict_index_node_ptr_max_size

So it is likely a good candidate as main MTR test.

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