Bug #79794 InnoDB: Failing assertion: len <= col->len || ((col->mtype) == 5 || (col->mtype)
Submitted: 29 Dec 2015 7:07 Modified: 22 Mar 2017 22:14
Reporter: Roel Van de Paar Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S6 (Debug Builds)
Version:5.7.10,5.7.17 OS:Any
Assigned to: CPU Architecture:Any
Tags: regression

[29 Dec 2015 7:07] Roel Van de Paar
Description:
Version: '5.7.10-debug'  socket: '/sdc/MS-mysql-5.7.10-linux-x86_64-debug/socket.sock'  port: 10357  MySQL Community Server (GPL)
2015-12-29 17:55:18 0x7f2a36b82700  InnoDB: Assertion failure in thread 139819283392256 in file rem0rec.cc line 867
InnoDB: Failing assertion: len <= col->len || ((col->mtype) == 5 || (col->mtype) == 16 || (col->mtype) == 14) || (((col->mtype) == 15 || (col->mtype) == 16) && len == 2 * 2 * sizeof(double)) || (col->len == 0 && col->mtype == 1)

+bt
#0  0x00007f2a3658e771 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
#1  0x00000000017ef4b0 in my_write_core (sig=6) at /git/mysql-server_dbg/mysys/stacktrace.c:247
#2  0x0000000000e58274 in handle_fatal_signal (sig=6) at /git/mysql-server_dbg/sql/signal_handler.cc:220
#3  <signal handler called>
#4  0x00007f2a349285d7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#5  0x00007f2a34929cc8 in __GI_abort () at abort.c:90
#6  0x0000000001b47a83 in ut_dbg_assertion_failed (expr=0x2095c90 "len <= col->len || ((col->mtype) == 5 || (col->mtype) == 16 || (col->mtype) == 14) || (((col->mtype) == 15 || (col->mtype) == 16) && len == 2 * 2 * sizeof(double)) || (col->len == 0 && col->mtype == 1)", file=0x20959c0 "/git/mysql-server_dbg/storage/innobase/rem/rem0rec.cc", line=867) at /git/mysql-server_dbg/storage/innobase/ut/ut0dbg.cc:67
#7  0x0000000001a296d7 in rec_get_converted_size_comp_prefix_low (index=0x7f296947a5a0, fields=0x7f296947a2e8, n_fields=4, v_entry=0x0, extra=0x0, temp=false) at /git/mysql-server_dbg/storage/innobase/rem/rem0rec.cc:864
#8  0x0000000001a29d43 in rec_get_converted_size_comp (index=0x7f296947a5a0, status=0, fields=0x7f296947a2e8, n_fields=4, extra=0x0) at /git/mysql-server_dbg/storage/innobase/rem/rem0rec.cc:1020
#9  0x0000000001b6e0c9 in rec_get_converted_size (index=0x7f296947a5a0, dtuple=0x7f296947a2a0, n_ext=0) at /git/mysql-server_dbg/storage/innobase/include/rem0rec.ic:1653
#10 0x0000000001b787e4 in btr_cur_optimistic_insert (flags=3, cursor=0x7f2a36b7f210, offsets=0x7f2a36b7f5e8, heap=0x7f2a36b7f5f0, entry=0x7f296947a2a0, rec=0x7f2a36b7f5e0, big_rec=0x7f2a36b7f5d8, n_ext=0, thr=0x7f29694a1840, mtr=0x7f29694db328) at /git/mysql-server_dbg/storage/innobase/btr/btr0cur.cc:3095
#11 0x0000000001a4e200 in row_ins_sorted_clust_index_entry (mode=2, index=0x7f296947a5a0, entry=0x7f296947a2a0, n_ext=0, thr=0x7f29694a1840) at /git/mysql-server_dbg/storage/innobase/row/row0ins.cc:2586
#12 0x0000000001a4fbdf in row_ins_clust_index_entry (index=0x7f296947a5a0, entry=0x7f296947a2a0, thr=0x7f29694a1840, n_ext=0, dup_chk_only=false) at /git/mysql-server_dbg/storage/innobase/row/row0ins.cc:3154
#13 0x0000000001a6ece1 in row_insert_for_mysql_using_cursor (mysql_rec=0x7f29694ab200 "\376\024\060\060\060\060-00-00 00:00:0", prebuilt=0x7f29694a10a0) at /git/mysql-server_dbg/storage/innobase/row/row0mysql.cc:1588
#14 0x0000000001a6f878 in row_insert_for_mysql (mysql_rec=0x7f29694ab200 "\376\024\060\060\060\060-00-00 00:00:0", prebuilt=0x7f29694a10a0) at /git/mysql-server_dbg/storage/innobase/row/row0mysql.cc:1846
#15 0x0000000001924863 in ha_innobase::intrinsic_table_write_row (this=0x7f29694ab430, record=0x7f29694ab200 "\376\024\060\060\060\060-00-00 00:00:0") at /git/mysql-server_dbg/storage/innobase/handler/ha_innodb.cc:7021
#16 0x0000000001924928 in ha_innobase::write_row (this=0x7f29694ab430, record=0x7f29694ab200 "\376\024\060\060\060\060-00-00 00:00:0") at /git/mysql-server_dbg/storage/innobase/handler/ha_innodb.cc:7045
#17 0x0000000000edf1d3 in handler::ha_write_row (this=0x7f29694ab430, buf=0x7f29694ab200 "\376\024\060\060\060\060-00-00 00:00:0") at /git/mysql-server_dbg/sql/handler.cc:7764
#18 0x00000000014a2939 in end_write_group (join=0x7f296949b2f8, qep_tab=0x7f296949be50, end_of_records=true) at /git/mysql-server_dbg/sql/sql_executor.cc:3543
#19 0x00000000014a560f in QEP_tmp_table::put_record (this=0x7f296949c438, end_of_records=true) at /git/mysql-server_dbg/sql/sql_executor.cc:4620
#20 0x00000000014a5673 in QEP_tmp_table::end_send (this=0x7f296949c438) at /git/mysql-server_dbg/sql/sql_executor.cc:4641
#21 0x000000000149cb0b in sub_select_op (join=0x7f296949b2f8, qep_tab=0x7f296949be50, end_of_records=true) at /git/mysql-server_dbg/sql/sql_executor.cc:1063
#22 0x000000000149cc3e in sub_select (join=0x7f296949b2f8, qep_tab=0x7f296949bcd8, end_of_records=true) at /git/mysql-server_dbg/sql/sql_executor.cc:1220
#23 0x000000000149c7be in do_select (join=0x7f296949b2f8) at /git/mysql-server_dbg/sql/sql_executor.cc:946
#24 0x000000000149a713 in JOIN::exec (this=0x7f296949b2f8) at /git/mysql-server_dbg/sql/sql_executor.cc:199
#25 0x00000000015339ca in handle_query (thd=0x7f2969419000, lex=0x7f296941b2e8, result=0x7f296942cfd0, added_options=0, removed_options=0) at /git/mysql-server_dbg/sql/sql_select.cc:184
#26 0x00000000014ea481 in execute_sqlcom_select (thd=0x7f2969419000, all_tables=0x7f296942c858) at /git/mysql-server_dbg/sql/sql_parse.cc:5098
#27 0x00000000014e3da2 in mysql_execute_command (thd=0x7f2969419000, first_level=true) at /git/mysql-server_dbg/sql/sql_parse.cc:2748
#28 0x00000000014eb36d in mysql_parse (thd=0x7f2969419000, parser_state=0x7f2a36b81560) at /git/mysql-server_dbg/sql/sql_parse.cc:5508
#29 0x00000000014e0ca7 in dispatch_command (thd=0x7f2969419000, com_data=0x7f2a36b81cb0, command=COM_QUERY) at /git/mysql-server_dbg/sql/sql_parse.cc:1425
#30 0x00000000014dfb71 in do_command (thd=0x7f2969419000) at /git/mysql-server_dbg/sql/sql_parse.cc:993
#31 0x000000000160ad5b in handle_connection (arg=0x7f2982b8d820) at /git/mysql-server_dbg/sql/conn_handler/connection_handler_per_thread.cc:301
#32 0x000000000181b8fc in pfs_spawn_thread (arg=0x7f2982fe8020) at /git/mysql-server_dbg/storage/perfschema/pfs.cc:2192
#33 0x00007f2a36589df5 in start_thread (arg=0x7f2a36b82700) at pthread_create.c:308
#34 0x00007f2a349e91ad in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

Asserts 5.7.10 but not 5.7.9

How to repeat:
DROP DATABASE test;CREATE DATABASE test;USE test;
SET @@session.sql_buffer_result=TRUE;
CREATE TEMPORARY TABLE t1(c1 TIMESTAMP);
INSERT INTO t1 VALUES(CONVERT(_ucs2 0x0645062D064206510642 USING utf8));
SELECT GROUP_CONCAT(c1 ORDER BY c1)FROM t1 GROUP BY c1 COLLATE ucs2_unicode_ci;
[29 Dec 2015 7:11] Roel Van de Paar
Maybe fix together with bug 74664
[29 Dec 2015 8:24] MySQL Verification Team
Thank your for the report.  Affects debug builds of 5.7, 5.8
The problem is with InnoDB intrinsic temporary tables.
Testcase with the relevant statements:

---
set sql_buffer_result=1;
set global internal_tmp_disk_storage_engine=InnoDB;
drop table if exists t;
create table t(a timestamp);
insert into t values();
select group_concat(a) from t group by a collate ucs2_unicode_ci;
---
[22 Mar 2017 22:00] Roel Van de Paar
Another testcase

# mysqld options required for replay:  --sql_mode=
DROP DATABASE test;CREATE DATABASE test;USE test;
SET @@session.sql_buffer_result=ON;
CREATE TEMPORARY TABLE t1(c1 TIMESTAMP);
insert INTO t1 values(repeat(0,0));
SELECT GROUP_CONCAT(c1 ORDER BY c1)FROM t1 GROUP BY c1 COLLATE ucs2_latvian_ci;
[22 Mar 2017 22:01] Roel Van de Paar
Update versions affected
[22 Mar 2017 22:14] Roel Van de Paar
Another testcase

# mysqld options required for replay:  --sql_mode=
DROP DATABASE test;CREATE DATABASE test;USE test;
SET @@session.sql_buffer_result=ON;
CREATE TEMPORARY TABLE t1(c1 TIMESTAMP);
insert INTO t1 values(repeat(0,0));
SELECT GROUP_CONCAT(c1 ORDER BY c1)FROM t1 GROUP BY c1 COLLATE ucs2_latvian_ci;