Bug #88269 dict0dict.cc:2286:!field->prefix_len || field->fixed_len == field->prefix_len
Submitted: 28 Oct 2017 1:21 Modified: 28 Oct 2017 18:51
Reporter: Roel Van de Paar Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S6 (Debug Builds)
Version:8.0.3 RC/5.7 OS:Any
Assigned to: CPU Architecture:Any
Tags: debug

[28 Oct 2017 1:21] Roel Van de Paar
Description:
2017-10-28T00:47:31.255124Z 0 [Note] /sda/MS201017-mysql-8.0.3-rc-linux-x86_64-debug/bin/mysqld: ready for connections. Version: '8.0.3-rc-debug-log'  socket: '/sda/MS201017-mysql-8.0.3-rc-linux-x86_64-debug/socket.sock'  port: 16654  MySQL Community Server (GPL)
2017-10-28T00:47:48.225164Z 7 [ERROR] InnoDB: Assertion failure: dict0dict.cc:2286:!field->prefix_len || field->fixed_len == field->prefix_len
InnoDB: thread 140721048045312

Core was generated by `/sda/MS201017-mysql-8.0.3-rc-linux-x86_64-debug/bin/mysqld --no-defaults --core'.
Program terminated with signal 6, Aborted.
#0  0x00007ffc2bba59b1 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
61	  val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid),
(gdb) bt
#0  0x00007ffc2bba59b1 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
#1  0x000000000369e428 in my_write_core (sig=6) at /git/mysql-server_dbg/mysys/stacktrace.cc:291
#2  0x000000000286b8f6 in handle_fatal_signal (sig=6) at /git/mysql-server_dbg/sql/signal_handler.cc:234
#3  <signal handler called>
#4  0x00007ffc29ebd1f7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#5  0x00007ffc29ebe8e8 in __GI_abort () at abort.c:90
#6  0x0000000003a8b8f9 in ut_dbg_assertion_failed (expr=0x490f430 "!field->prefix_len || field->fixed_len == field->prefix_len", 
    file=0x490eac8 "/git/mysql-server_dbg/storage/innobase/dict/dict0dict.cc", line=2286)
    at /git/mysql-server_dbg/storage/innobase/ut/ut0dbg.cc:60
#7  0x0000000003b562e0 in dict_index_node_ptr_max_size (index=0x7ffbe3ca1bb8)
    at /git/mysql-server_dbg/storage/innobase/dict/dict0dict.cc:2285
#8  0x0000000003ad275a in btr_cur_search_to_nth_level (index=0x7ffbe3ca1bb8, level=0, tuple=0x7ffbe3ca2e00, mode=PAGE_CUR_LE, 
    latch_mode=2, cursor=0x7ffc2c147d50, has_search_latch=0, file=0x48a2b80 "/git/mysql-server_dbg/storage/innobase/row/row0ins.cc", 
    line=3213, mtr=0x7ffc2c148110) at /git/mysql-server_dbg/storage/innobase/btr/btr0cur.cc:959
#9  0x0000000003995d75 in row_ins_sec_index_entry_low (flags=0, mode=2, index=0x7ffbe3ca1bb8, offsets_heap=0x7ffbe3c37918, 
    heap=0x7ffbe3c37e18, entry=0x7ffbe3ca2e00, trx_id=0, thr=0x7ffbe3e52d90, dup_chk_only=false)
    at /git/mysql-server_dbg/storage/innobase/row/row0ins.cc:3213
#10 0x0000000003996cf5 in row_ins_sec_index_entry (index=0x7ffbe3ca1bb8, entry=0x7ffbe3ca2e00, thr=0x7ffbe3e52d90, dup_chk_only=false)
    at /git/mysql-server_dbg/storage/innobase/row/row0ins.cc:3593
#11 0x0000000003996e9f in row_ins_index_entry (index=0x7ffbe3ca1bb8, entry=0x7ffbe3ca2e00, thr=0x7ffbe3e52d90)
    at /git/mysql-server_dbg/storage/innobase/row/row0ins.cc:3642
#12 0x000000000399741d in row_ins_index_entry_step (node=0x7ffbe3e526c0, thr=0x7ffbe3e52d90)
    at /git/mysql-server_dbg/storage/innobase/row/row0ins.cc:3797
#13 0x0000000003997799 in row_ins (node=0x7ffbe3e526c0, thr=0x7ffbe3e52d90)
    at /git/mysql-server_dbg/storage/innobase/row/row0ins.cc:3939
#14 0x0000000003997dbc in row_ins_step (thr=0x7ffbe3e52d90) at /git/mysql-server_dbg/storage/innobase/row/row0ins.cc:4123
#15 0x00000000039b43af in row_insert_for_mysql_using_ins_graph (mysql_rec=0x7ffbe3c66630 "\377", prebuilt=0x7ffbe3e520b8)
    at /git/mysql-server_dbg/storage/innobase/row/row0mysql.cc:1713
#16 0x00000000039b49bc in row_insert_for_mysql (mysql_rec=0x7ffbe3c66630 "\377", prebuilt=0x7ffbe3e520b8)
    at /git/mysql-server_dbg/storage/innobase/row/row0mysql.cc:1851
#17 0x0000000003829dbe in ha_innobase::write_row (this=0x7ffbe3cba030, record=0x7ffbe3c66630 "\377")
    at /git/mysql-server_dbg/storage/innobase/handler/ha_innodb.cc:8385
#18 0x00000000029d73e3 in handler::ha_write_row (this=0x7ffbe3cba030, buf=0x7ffbe3c66630 "\377")
    at /git/mysql-server_dbg/sql/handler.cc:8343
#19 0x0000000002c14132 in write_record (thd=0x7ffbe3c19000, table=0x7ffbe3c65c20, info=0x7ffc2c149e70, update=0x7ffc2c149ef0)
    at /git/mysql-server_dbg/sql/sql_insert.cc:2013
#20 0x0000000002c10c04 in Sql_cmd_insert_values::execute_inner (this=0x7ffbe3c30040, thd=0x7ffbe3c19000)
    at /git/mysql-server_dbg/sql/sql_insert.cc:664
#21 0x0000000002512627 in Sql_cmd_dml::execute (this=0x7ffbe3c30040, thd=0x7ffbe3c19000) at /git/mysql-server_dbg/sql/sql_select.cc:605
#22 0x00000000024bad4d in mysql_execute_command (thd=0x7ffbe3c19000, first_level=true) at /git/mysql-server_dbg/sql/sql_parse.cc:3441
#23 0x00000000024c042b in mysql_parse (thd=0x7ffbe3c19000, parser_state=0x7ffc2c14b2f0) at /git/mysql-server_dbg/sql/sql_parse.cc:5414
#24 0x00000000024b68e7 in dispatch_command (thd=0x7ffbe3c19000, com_data=0x7ffc2c14bb80, command=COM_QUERY)
    at /git/mysql-server_dbg/sql/sql_parse.cc:1708
#25 0x00000000024b53f5 in do_command (thd=0x7ffbe3c19000) at /git/mysql-server_dbg/sql/sql_parse.cc:1291
#26 0x000000000285b2d6 in handle_connection (arg=0x7ffc182eb3c0)
    at /git/mysql-server_dbg/sql/conn_handler/connection_handler_per_thread.cc:328
#27 0x00000000036ec54d in pfs_spawn_thread (arg=0x7ffc18391620) at /git/mysql-server_dbg/storage/perfschema/pfs.cc:2985
#28 0x00007ffc2bba0e25 in start_thread (arg=0x7ffc2c14c700) at pthread_create.c:308
#29 0x00007ffc29f8034d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

How to repeat:
CREATE DATABASE test;
USE test;
CREATE TABLE t1(a CHAR(255)CHARACTER SET UTF32,KEY k1(a(254))) ENGINE=INNODB;
INSERT INTO t1 VALUES();
[21 Dec 2017 8:50] MySQL Verification Team
Strange I'm only seeing this bug now. Still occurs on current:

mysqld-debug.exe: Version: '9.0.0-dmr-debug'  (Built on 2017/12/20).
InnoDB: Assertion failure: dict0dict.cc:2340:!field->prefix_len || field->fixed_len == field->prefix_len
mysqld-debug.exe!my_sigabrt_handler()[my_thr_init.cc:415]
  ucrtbased.dll!raise()
  ucrtbased.dll!abort()
mysqld-debug.exe!ut_dbg_assertion_failed()[ut0dbg.cc:76]
mysqld-debug.exe!dict_index_node_ptr_max_size()[dict0dict.cc:2339]
mysqld-debug.exe!btr_cur_search_to_nth_level()[btr0cur.cc:964]
mysqld-debug.exe!row_ins_sec_index_entry_low()[row0ins.cc:3221]
mysqld-debug.exe!row_ins_sec_index_entry()[row0ins.cc:3595]
mysqld-debug.exe!row_ins_index_entry()[row0ins.cc:3648]
mysqld-debug.exe!row_ins_index_entry_step()[row0ins.cc:3801]
mysqld-debug.exe!row_ins()[row0ins.cc:3943]
mysqld-debug.exe!row_ins_step()[row0ins.cc:4127]
mysqld-debug.exe!row_insert_for_mysql_using_ins_graph()[row0mysql.cc:1715]
mysqld-debug.exe!row_insert_for_mysql()[row0mysql.cc:1853]
mysqld-debug.exe!ha_innobase::write_row()[ha_innodb.cc:8773]
mysqld-debug.exe!handler::ha_write_row()[handler.cc:8404]
mysqld-debug.exe!write_record()[sql_insert.cc:2034]
mysqld-debug.exe!Sql_cmd_insert_values::execute_inner()[sql_insert.cc:671]
mysqld-debug.exe!Sql_cmd_dml::execute()[sql_select.cc:614]
mysqld-debug.exe!mysql_execute_command()[sql_parse.cc:3523]
mysqld-debug.exe!mysql_parse()[sql_parse.cc:5463]
mysqld-debug.exe!dispatch_command()[sql_parse.cc:1736]
mysqld-debug.exe!do_command()[sql_parse.cc:1314]
mysqld-debug.exe!handle_connection()[connection_handler_per_thread.cc:329]
mysqld-debug.exe!pfs_spawn_thread()[pfs.cc:2987]
mysqld-debug.exe!win_thread_start()[my_thread.cc:42]
[4 Feb 2021 6:58] MySQL Verification Team
I hit this bug again which made me find this report.
create database if not exists test;
use test;
drop table if exists t;
create table t (
  `c0000` decimal(9,6) default null,
  `c0001` decimal(50,26) default null,
  `c0002` json default null,
  `c0003` char(231) character set utf32 collate utf32_slovenian_ci not null,
  `c0004` time(4) default null,
  key `i0000` (`c0001`,`c0000`),
  key `i0001` (`c0000`,`c0003`(225)),
  key `i0002` (`c0000`,`c0001`),
  key `i0003` (`c0000`,`c0001`),
  key `i0004` (`c0001`)
) engine=innodb default charset=utf8mb4 collate=utf8mb4_0900_ai_ci row_format=compressed key_block_size=16;

insert into t set `c0000` = -1, `c0001` = 8335, `c0002` = '{ }', `c0003` = 'ocnr', `c0004` = '16:35:14';

[Server] mysqld: Version: '8.0.25-tr-debug' (Built on 03 February 2021, 
commit 2ebc995d7307594c0183971a44524bb768136ad0 
with gcc (GCC) 10.2.1 20201125 (Red Hat 10.2.1-9)).

[InnoDB] Assertion failure: dict0dict.cc:2091:!field->prefix_len || field->fixed_len == field->prefix_len thread 140736666855168
InnoDB: We intentionally generate a memory trap.
[23 Jun 2021 11:04] MySQL Verification Team
Seen again today...

drop table if exists `t0026`;
create table `t0026` (
  `c0000` tinyblob not null,
  `c0001` longblob,
  `c0002` mediumint not null,
  `c0003` varbinary(64332) not null,
  `c0004` char(205) character set utf32 collate utf32_danish_ci not null,
  primary key (`c0004`(48),`c0000`(13),`c0002`,`c0003`(46)),
  key `i0001` (`c0004`(200)),
  key `i0002` (`c0004`(68),`c0000`(29),`c0002`),
  key `i0003` (`c0000`(12)),
  key `i0004` (`c0002`)
) engine=innodb default charset=utf8mb4 collate=utf8mb4_0900_ai_ci row_format=dynamic;

insert into `t0026` set
`c0000` = '�',
`c0001` = '�kq',
`c0002` = 4045596,
`c0003` = '��',
`c0004` = '';

2021-06-23T11:03:35.740271Z 0 [System] [MY-010931] [Server] /home/anon/mysql/debug/trunk/bin/mysqld: ready for connections. Version: '8.0.27-tr-debug'  socket: '/tmp/mysql.sock'  port: 3306  (Built on 23 June 2021, commit 3a85f2ae2ad7b160610cb05c32ddd256f2e3a5d8 with gcc (GCC) 11.1.1 20210531 (Red Hat 11.1.1-3)).
[New LWP 2013707]
2021-06-23T11:03:52.418883Z 7 [ERROR] [MY-013183] [InnoDB] Assertion failure: dict0dict.cc:2087:!field->prefix_len || field->fixed_len == field->prefix_len thread 140731706484288
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.

Thread 58 "connection" received signal SIGABRT, Aborted.
[Switching to LWP 2013707]
0x00007ffff73402a2 in raise () from /lib64/libc.so.6
Missing separate debuginfos, use: dnf debuginfo-install glibc-2.33-16.fc34.x86_64 libgcc-11.1.1-3.fc34.x86_64 libstdc++-11.1.1-3.fc34.x86_64 sssd-client-2.5.1-1.fc34.x86_64
(gdb) bt
#0  0x00007ffff73402a2 in raise () from /lib64/libc.so.6
#1  0x00007ffff73298a4 in abort () from /lib64/libc.so.6
#2  0x0000000004d2f2cd in ut_dbg_assertion_failed (expr=0x6b6e868 "!field->prefix_len || field->fixed_len == field->prefix_len", file=0x6b6e0a0 "./storage/innobase/dict/dict0dict.cc", line=2087) at ./storage/innobase/ut/ut0dbg.cc:99
#3  0x0000000004e8543a in dict_index_node_ptr_max_size (index=0x7ffec4740d38) at ./storage/innobase/dict/dict0dict.cc:2087
#4  0x0000000004d9f938 in btr_cur_search_to_nth_level (index=0x7ffec4740d38, level=0, tuple=0x7ffec473fd08, mode=PAGE_CUR_LE, latch_mode=2, cursor=0x7ffea75f4500, has_search_latch=0, file=0x6aabb20 "./storage/innobase/row/row0ins.cc", line=2902, mtr=0x7ffea75f4000) at ./storage/innobase/btr/btr0cur.cc:881
#5  0x0000000004bec917 in row_ins_sec_index_entry_low (flags=0, mode=2, index=0x7ffec4740d38, offsets_heap=0x7fffe20d6620, heap=0x7fffe20d6b20, entry=0x7ffec473fd08, trx_id=0, thr=0x7fffe1faaac8, dup_chk_only=false) at ./storage/innobase/row/row0ins.cc:2901
#6  0x0000000004bed769 in row_ins_sec_index_entry (index=0x7ffec4740d38, entry=0x7ffec473fd08, thr=0x7fffe1faaac8, dup_chk_only=false) at ./storage/innobase/row/row0ins.cc:3212
#7  0x0000000004bedb57 in row_ins_index_entry (index=0x7ffec4740d38, entry=0x7ffec473fd08, multi_val_pos=@0x7fffe21b4ac0: 0, thr=0x7fffe1faaac8) at ./storage/innobase/row/row0ins.cc:3312
#8  0x0000000004bee12c in row_ins_index_entry_step (node=0x7fffe21b4a08, thr=0x7fffe1faaac8) at ./storage/innobase/row/row0ins.cc:3443
#9  0x0000000004bee4ae in row_ins (node=0x7fffe21b4a08, thr=0x7fffe1faaac8) at ./storage/innobase/row/row0ins.cc:3562
#10 0x0000000004bee941 in row_ins_step (thr=0x7fffe1faaac8) at ./storage/innobase/row/row0ins.cc:3686
#11 0x0000000004bf9719 in row_insert_for_mysql_using_ins_graph (mysql_rec=0x7fffe2241768 "\376\003`Xw\304\376\177", prebuilt=0x7fffe21b40b8) at ./storage/innobase/row/row0mysql.cc:1583
#12 0x0000000004bf9d19 in row_insert_for_mysql (mysql_rec=0x7fffe2241768 "\376\003`Xw\304\376\177", prebuilt=0x7fffe21b40b8) at ./storage/innobase/row/row0mysql.cc:1713
#13 0x00000000049f163d in ha_innobase::write_row (this=0x7fffe21a7028, record=0x7fffe2241768 "\376\003`Xw\304\376\177") at ./storage/innobase/handler/ha_innodb.cc:8835
#14 0x00000000036f8342 in handler::ha_write_row (this=0x7fffe21a7028, buf=0x7fffe2241768 "\376\003`Xw\304\376\177") at ./sql/handler.cc:7891
#15 0x0000000003a24ef9 in write_record (thd=0x7fff4fd03000, table=0x7fffe21ad220, info=0x7ffea75f5990, update=0x7ffea75f5910) at ./sql/sql_insert.cc:2162
#16 0x0000000003a20ad9 in Sql_cmd_insert_values::execute_inner (this=0x7fffe20cf198, thd=0x7fff4fd03000) at ./sql/sql_insert.cc:635
#17 0x00000000033ea972 in Sql_cmd_dml::execute (this=0x7fffe20cf198, thd=0x7fff4fd03000) at ./sql/sql_select.cc:578
#18 0x000000000336ae67 in mysql_execute_command (thd=0x7fff4fd03000, first_level=true) at ./sql/sql_parse.cc:3513
#19 0x000000000336ff13 in dispatch_sql_command (thd=0x7fff4fd03000, parser_state=0x7ffea75f7280) at ./sql/sql_parse.cc:5095
#20 0x0000000003366500 in dispatch_command (thd=0x7fff4fd03000, com_data=0x7ffea75f8340, command=COM_QUERY) at ./sql/sql_parse.cc:1919
#21 0x0000000003364725 in do_command (thd=0x7fff4fd03000) at ./sql/sql_parse.cc:1342
#22 0x00000000035458e3 in handle_connection (arg=0x7fffe56298a0) at ./sql/conn_handler/connection_handler_per_thread.cc:302
#23 0x000000000514000b in pfs_spawn_thread (arg=0x7ffff6e2fa60) at ./storage/perfschema/pfs.cc:2946
#24 0x00007ffff7cfd299 in start_thread () from /lib64/libpthread.so.0
#25 0x00007ffff7403353 in clone () from /lib64/libc.so.6
(gdb)