Bug #85060 InnoDB: Failing assertion: !field->prefix_len || field->fixed_len == field->pref

Submitted: 18 Feb 2017 8:33 Modified: 21 Apr 10:34
Reporter: Roel Van de Paar Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: DML Severity:S6 (Debug Builds)
Version:5.7.17, 5.7.42 OS:Any
Assigned to: CPU Architecture:Any

[18 Feb 2017 8:33] Roel Van de Paar
Description:
Core was generated by `/sda/MS010217-mysql-5.7.17-linux-x86_64-debug/bin/mysqld --no-defaults --core-f'.
Program terminated with signal 6, Aborted.
#0  0x00007f6338c20741 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  0x00007f6338c20741 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
#1  0x0000000001826d71 in my_write_core (sig=6) at /git/mysql-server_dbg/mysys/stacktrace.c:249
#2  0x0000000000e75574 in handle_fatal_signal (sig=6) at /git/mysql-server_dbg/sql/signal_handler.cc:220
#3  <signal handler called>
#4  0x00007f6336fb41d7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#5  0x00007f6336fb58c8 in __GI_abort () at abort.c:90
#6  0x0000000001b8d79a in ut_dbg_assertion_failed (expr=0x213e4d8 "!field->prefix_len || field->fixed_len == field->prefix_len",
    file=0x213db80 "/git/mysql-server_dbg/storage/innobase/dict/dict0dict.cc", line=2328) at /git/mysql-server_dbg/storage/innobase/ut/ut0dbg.cc:67
#7  0x0000000001c3621a in dict_index_node_ptr_max_size (index=0x7f62fb07a2a0) at /git/mysql-server_dbg/storage/innobase/dict/dict0dict.cc:2327
#8  0x0000000001bb95cc in btr_cur_search_to_nth_level (index=0x7f62fb07a2a0, level=0, tuple=0x7f62fb079d48, mode=PAGE_CUR_LE, latch_mode=2, cursor=0x7f633920ef10,
    has_search_latch=0, file=0x20e20d0 "/git/mysql-server_dbg/storage/innobase/row/row0ins.cc", line=2975, mtr=0x7f633920f2d0)
    at /git/mysql-server_dbg/storage/innobase/btr/btr0cur.cc:1029
#9  0x0000000001a91c7b in row_ins_sec_index_entry_low (flags=0, mode=2, index=0x7f62fb07a2a0, offsets_heap=0x7f62fb037018, heap=0x7f62fb037518, entry=0x7f62fb079d48, trx_id=0,
    thr=0x7f62fb09ec30, dup_chk_only=false) at /git/mysql-server_dbg/storage/innobase/row/row0ins.cc:2975
#10 0x0000000001a92eb9 in row_ins_sec_index_entry (index=0x7f62fb07a2a0, entry=0x7f62fb079d48, thr=0x7f62fb09ec30, dup_chk_only=false)
    at /git/mysql-server_dbg/storage/innobase/row/row0ins.cc:3385
#11 0x0000000001a93035 in row_ins_index_entry (index=0x7f62fb07a2a0, entry=0x7f62fb079d48, thr=0x7f62fb09ec30) at /git/mysql-server_dbg/storage/innobase/row/row0ins.cc:3431
#12 0x0000000001a9355a in row_ins_index_entry_step (node=0x7f62fb09e5e0, thr=0x7f62fb09ec30) at /git/mysql-server_dbg/storage/innobase/row/row0ins.cc:3579
#13 0x0000000001a938e4 in row_ins (node=0x7f62fb09e5e0, thr=0x7f62fb09ec30) at /git/mysql-server_dbg/storage/innobase/row/row0ins.cc:3721
#14 0x0000000001a93f08 in row_ins_step (thr=0x7f62fb09ec30) at /git/mysql-server_dbg/storage/innobase/row/row0ins.cc:3906
#15 0x0000000001ab2443 in row_insert_for_mysql_using_ins_graph (mysql_rec=0x7f62fb05ba30 <incomplete sequence \375>, prebuilt=0x7f62fb09e0a0)
    at /git/mysql-server_dbg/storage/innobase/row/row0mysql.cc:1733
#16 0x0000000001ab29da in row_insert_for_mysql (mysql_rec=0x7f62fb05ba30 <incomplete sequence \375>, prebuilt=0x7f62fb09e0a0)
    at /git/mysql-server_dbg/storage/innobase/row/row0mysql.cc:1857
#17 0x000000000195f716 in ha_innobase::write_row (this=0x7f62fb0aa830, record=0x7f62fb05ba30 <incomplete sequence \375>)
    at /git/mysql-server_dbg/storage/innobase/handler/ha_innodb.cc:7494
#18 0x0000000000efd2f6 in handler::ha_write_row (this=0x7f62fb0aa830, buf=0x7f62fb05ba30 <incomplete sequence \375>) at /git/mysql-server_dbg/sql/handler.cc:7923
#19 0x0000000001717bfe in write_record (thd=0x7f62fb019000, table=0x7f62fb05b020, info=0x7f63392110a0, update=0x7f6339211120) at /git/mysql-server_dbg/sql/sql_insert.cc:1871
#20 0x0000000001714de7 in Sql_cmd_insert::mysql_insert (this=0x7f62fb02c1d8, thd=0x7f62fb019000, table_list=0x7f62fb02bc48) at /git/mysql-server_dbg/sql/sql_insert.cc:769
#21 0x000000000171b652 in Sql_cmd_insert::execute (this=0x7f62fb02c1d8, thd=0x7f62fb019000) at /git/mysql-server_dbg/sql/sql_insert.cc:3103
#22 0x00000000014f5d69 in mysql_execute_command (thd=0x7f62fb019000, first_level=true) at /git/mysql-server_dbg/sql/sql_parse.cc:3606
#23 0x00000000014fb5f5 in mysql_parse (thd=0x7f62fb019000, parser_state=0x7f6339212550) at /git/mysql-server_dbg/sql/sql_parse.cc:5611
#24 0x00000000014f0c1d in dispatch_command (thd=0x7f62fb019000, com_data=0x7f6339212cb0, command=COM_QUERY) at /git/mysql-server_dbg/sql/sql_parse.cc:1461
#25 0x00000000014efa44 in do_command (thd=0x7f62fb019000) at /git/mysql-server_dbg/sql/sql_parse.cc:999
#26 0x000000000161f9d0 in handle_connection (arg=0x7f630e3ec860) at /git/mysql-server_dbg/sql/conn_handler/connection_handler_per_thread.cc:300
#27 0x00000000018534f9 in pfs_spawn_thread (arg=0x7f631ca76120) at /git/mysql-server_dbg/storage/perfschema/pfs.cc:2188
#28 0x00007f6338c1bdc5 in start_thread (arg=0x7f6339213700) at pthread_create.c:308
#29 0x00007f633707673d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

How to repeat:
DROP DATABASE test;CREATE DATABASE test;USE test;
CREATE TABLE t1(a CHAR(255)CHARACTER SET UTF32,KEY k1(a(195))) ENGINE=INNODB;
INSERT INTO t1 VALUES(-233);
[18 Feb 2017 11:34] MySQL Verification Team
Hello Roel,

Thank you for the report and test case.
Observed that 5.7.17 debug build is affected.

Thanks,
Umesh
[10 May 2017 1:13] Roel Van de Paar
DROP DATABASE test;CREATE DATABASE test;USE test;
CREATE TABLE t1(a CHAR(255)CHARACTER SET UTF32,KEY k1(a(195))) ENGINE=INNODB;
INSERT INTO t1 VALUES(7828);

Works just as well
[1 May 2018 22:05] Roel Van de Paar
DROP DATABASE test; CREATE DATABASE test; USE test;
CREATE TABLE t1(a CHAR(255) CHARACTER SET UTF32, KEY k1(a(254))) ENGINE=INNODB;
INSERT INTO t1 VALUES ('a');
[1 Aug 2018 2:21] Roel Van de Paar
Any updates?
[13 Feb 11:27] Yichang Song
Hi Team,
I can confirm this issue is still reproducible on a recent MySQL 9.6.0 debug build.

It looks like MariaDB addressed a closely related problem; their fix may be helpful as a reference:

Commit: https://github.com/MariaDB/server/commit/a586b6dbc81b788106cee0f88416c389ae79d26c
Jira: https://jira.mariadb.org/browse/MDEV-22855

Thanks.
[13 Feb 11:52] Yichang Song
Hi Team,

Additional note: MySQL previously fixed a very similar assertion in Bug#21880445 (!field->prefix_len || field->fixed_len == field->prefix_len) in dict_index_too_big_for_tree(). The fix approach is the same as MariaDB MDEV-22855, and may be useful as a reference here as well.

Thanks.
[21 Apr 10:34] Edward Gilmore
Posted by developer:
 
Added the following note to the MySQL Server 8.0.46, 8.4.9, and 9.7.0 release notes:
		
Under certain circumstances, when calculating the maximum possible index record size,
an assertion could occur.
[22 Apr 17:55] Shane Bester
Did this fix cause a regression?
https://bugs.mysql.com/bug.php?id=120323

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.064 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.