Bug #87577 Field* Item::tmp_table_field_from_field_type(TABLE*, bool):Assertion `0' failed
Submitted: 29 Aug 2017 10:23 Modified: 29 Aug 2017 10:25
Reporter: Roel Van de Paar Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: DML Severity:S1 (Critical)
Version:5.7.19 OS:Any
Assigned to: CPU Architecture:Any

[29 Aug 2017 10:23] Roel Van de Paar
Description:
Core was generated by `/sda/MS250817-mysql-5.7.19-linux-x86_64-debug/bin/mysqld --no-defaults --core-f'.
Program terminated with signal 6, Aborted.
#0  0x00007f47dc807741 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  0x00007f47dc807741 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
#1  0x0000000001836ef0 in my_write_core (sig=6) at /git/mysql-server_dbg/mysys/stacktrace.c:249
#2  0x0000000000e7d8b2 in handle_fatal_signal (sig=6) at /git/mysql-server_dbg/sql/signal_handler.cc:220
#3  <signal handler called>
#4  0x00007f47dab9b1d7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#5  0x00007f47dab9c8c8 in __GI_abort () at abort.c:90
#6  0x00007f47dab94146 in __assert_fail_base (fmt=0x7f47dace53a8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
    assertion=assertion@entry=0x1d91f16 "0", file=file@entry=0x1d921a0 "/git/mysql-server_dbg/sql/item.cc", line=line@entry=6605, 
    function=function@entry=0x1d95620 <Item::tmp_table_field_from_field_type(TABLE*, bool)::__PRETTY_FUNCTION__> "Field* Item::tmp_table_field_from_field_type(TABLE*, bool)") at assert.c:92
#7  0x00007f47dab941f2 in __GI___assert_fail (assertion=0x1d91f16 "0", file=0x1d921a0 "/git/mysql-server_dbg/sql/item.cc", 
    line=6605, 
    function=0x1d95620 <Item::tmp_table_field_from_field_type(TABLE*, bool)::__PRETTY_FUNCTION__> "Field* Item::tmp_table_field_from_field_type(TABLE*, bool)") at assert.c:101
#8  0x0000000000f21d41 in Item::tmp_table_field_from_field_type (this=0x7f479ecb05f0, table=0x7f479ed50030, fixed_length=false)
    at /git/mysql-server_dbg/sql/item.cc:6605
#9  0x0000000000f2e075 in Item_type_holder::make_field_by_type (this=0x7f479ecb05f0, table=0x7f479ed50030)
    at /git/mysql-server_dbg/sql/item.cc:10736
#10 0x00000000015a3ff7 in create_tmp_field (thd=0x7f479ec19000, table=0x7f479ed50030, item=0x7f479ecb05f0, type=Item::TYPE_HOLDER, 
    copy_func=0x7f479ecd2c30, from_field=0x7f479ed50dc0, default_field=0x7f479ed50d98, group=false, modify_item=false, 
    table_cant_handle_bit_fields=false, make_copy_field=false) at /git/mysql-server_dbg/sql/sql_tmp_table.cc:394
#11 0x00000000015a590a in create_tmp_table (thd=0x7f479ec19000, param=0x7f479ecb0218, fields=..., group=0x0, distinct=false, 
    save_sum_fields=true, select_options=2416188160, rows_limit=18446744073709551615, table_alias=0x1f68704 "")
    at /git/mysql-server_dbg/sql/sql_tmp_table.cc:959
#12 0x00000000015afe33 in Query_result_union::create_result_table (this=0x7f479ecb01f8, thd_arg=0x7f479ec19000, 
    column_types=0x7f479ec2c958, is_union_distinct=false, options=2416188160, table_alias=0x1f68704 "", bit_fields_as_long=false, 
    create_table=true) at /git/mysql-server_dbg/sql/sql_union.cc:132
#13 0x00000000015b118e in st_select_lex_unit::prepare (this=0x7f479ec2c370, thd_arg=0x7f479ec19000, sel_result=0x7f479ec2dfd0, 
    added_options=268435456, removed_options=0) at /git/mysql-server_dbg/sql/sql_union.cc:630
#14 0x00000000015509b1 in handle_query (thd=0x7f479ec19000, lex=0x7f479ec1b2f8, result=0x7f479ec2dfd0, added_options=0, 
    removed_options=0) at /git/mysql-server_dbg/sql/sql_select.cc:139
#15 0x0000000001506a7c in execute_sqlcom_select (thd=0x7f479ec19000, all_tables=0x7f479ec2d500)
    at /git/mysql-server_dbg/sql/sql_parse.cc:5158
#16 0x00000000015002fe in mysql_execute_command (thd=0x7f479ec19000, first_level=true) at /git/mysql-server_dbg/sql/sql_parse.cc:2795
#17 0x0000000001507902 in mysql_parse (thd=0x7f479ec19000, parser_state=0x7f47dcdf8550)
    at /git/mysql-server_dbg/sql/sql_parse.cc:5574
#18 0x00000000014fd1d4 in dispatch_command (thd=0x7f479ec19000, com_data=0x7f47dcdf8cb0, command=COM_QUERY)
    at /git/mysql-server_dbg/sql/sql_parse.cc:1461
#19 0x00000000014fc0c6 in do_command (thd=0x7f479ec19000) at /git/mysql-server_dbg/sql/sql_parse.cc:999
#20 0x000000000162c436 in handle_connection (arg=0x7f47b1ff1860)
    at /git/mysql-server_dbg/sql/conn_handler/connection_handler_per_thread.cc:300
#21 0x000000000186363b in pfs_spawn_thread (arg=0x7f47c33e0020) at /git/mysql-server_dbg/storage/perfschema/pfs.cc:2188
#22 0x00007f47dc802dc5 in start_thread (arg=0x7f47dcdf9700) at pthread_create.c:308
#23 0x00007f47dac5d73d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

How to repeat:
CREATE TABLE t1(a timestamp,b char,KEY (a)) PARTITION BY HASH (UNIX_TIMESTAMP(a)) PARTITIONS 3;
(SELECT b,a FROM t1 ORDER BY b,a)ORDER BY a;
[29 Aug 2017 10:25] Roel Van de Paar
Duplicate of bug 86254