#8 0x0000563ecb7978ee in String::copy (this=this@entry=0x14b301474728, str=0x14b31a509f10 "`\241P\032\263\024", arg_length=0, from_cs=0x563ecced2e80 <my_charset_latin1>, to_cs=0x563eccef4dc0 <my_charset_utf16_general_ci>, errors=errors@entry=0x14b31a509ecc) at /test/10.5_dbg/sql/sql_string.cc:430
#9 0x0000563ecba57d80 in Item_func::val_str_from_val_str_ascii (this=0x14b3014746f0, str=0x14b301474728, ascii_buffer=0x14b3014747b8) at /test/10.5_dbg/sql/item_strfunc.cc:111
#10 0x0000563ecba04c0e in Item_str_ascii_func::val_str (this=<optimized out>, str=<optimized out>) at /test/10.5_dbg/sql/item_strfunc.h:88
#11 0x0000563ecb9bb5a5 in Item::save_str_in_field (this=0x14b3014746f0, field=0x14b3014566a0, no_conversions=<optimized out>) at /test/10.5_dbg/sql/item.cc:6557
#12 0x0000563ecb8afa4a in Type_handler_string_result::Item_save_in_field (this=<optimized out>, item=<optimized out>, field=<optimized out>, no_conversions=<optimized out>) at /test/10.5_dbg/sql/sql_type.cc:4184
#13 0x0000563ecb9a63b0 in Item::save_in_field (this=0x14b3014746f0, field=0x14b3014566a0, no_conversions=<optimized out>) at /test/10.5_dbg/sql/item.cc:6605
#14 0x0000563ecb6870ff in Item_result_field::save_in_result_field (this=<optimized out>, no_conversions=<optimized out>) at /test/10.5_dbg/sql/item.h:3255
#15 0x0000563ecb734cd6 in copy_funcs (func_ptr=0x14b301574420, thd=0x14b301415088) at /test/10.5_dbg/sql/sql_select.cc:25722
#16 0x0000563ecb734d8a in end_write (join=0x14b301475870, join_tab=0x14b301476e60, end_of_records=<optimized out>) at /test/10.5_dbg/sql/sql_select.cc:22057
#17 0x0000563ecb73a9bf in AGGR_OP::put_record (this=this@entry=0x14b3014776e0, end_of_records=end_of_records@entry=false) at /test/10.5_dbg/sql/sql_select.cc:28848
#18 0x0000563ecb73b06e in AGGR_OP::put_record (this=0x14b3014776e0) at /test/10.5_dbg/sql/sql_select.h:1048
#19 sub_select_postjoin_aggr (join=0x14b301475870, join_tab=0x14b301476e60, end_of_records=<optimized out>) at /test/10.5_dbg/sql/sql_select.cc:20345
#20 0x0000563ecb71bb79 in evaluate_join_record (join=join@entry=0x14b301475870, join_tab=join_tab@entry=0x14b301476ab8, error=error@entry=0) at /test/10.5_dbg/sql/sql_select.cc:20852
#21 0x0000563ecb722f35 in sub_select (join=0x14b301475870, join_tab=0x14b301476ab8, end_of_records=<optimized out>) at /test/10.5_dbg/sql/sql_select.cc:20629
#22 0x0000563ecb75bd44 in do_select (procedure=0x0, join=0x14b301475870) at /test/10.5_dbg/sql/sql_select.cc:20163
#23 JOIN::exec_inner (this=this@entry=0x14b301475870) at /test/10.5_dbg/sql/sql_select.cc:4475
#24 0x0000563ecb75c35f in JOIN::exec (this=this@entry=0x14b301475870) at /test/10.5_dbg/sql/sql_select.cc:4256
#25 0x0000563ecb75a674 in mysql_select (thd=thd@entry=0x14b301415088, tables=<optimized out>, fields=@0x14b301474288: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14b301474810, last = 0x14b301474810, elements = 1}, <No data fields>}, conds=0x0, og_num=0, order=<optimized out>, group=0x0, having=0x0, proc_param=0x0, select_options=2147879680, result=0x14b301475848, unit=0x14b3014190a0, select_lex=0x14b301474138) at /test/10.5_dbg/sql/sql_select.cc:4680
#26 0x0000563ecb75a9a3 in handle_select (thd=thd@entry=0x14b301415088, lex=lex@entry=0x14b301418fd8, result=result@entry=0x14b301475848, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.5_dbg/sql/sql_select.cc:417
#27 0x0000563ecb6e43a0 in execute_sqlcom_select (thd=thd@entry=0x14b301415088, all_tables=0x14b301474868) at /test/10.5_dbg/sql/sql_parse.cc:6208
#28 0x0000563ecb6dd4cc in mysql_execute_command (thd=thd@entry=0x14b301415088) at /test/10.5_dbg/sql/sql_parse.cc:3939
#29 0x0000563ecb6ea322 in mysql_parse (thd=thd@entry=0x14b301415088, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14b31a50b350, 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
#30 0x0000563ecb6d6e1c in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14b301415088, packet=packet@entry=0x14b301467089 "", packet_length=packet_length@entry=25, 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
#31 0x0000563ecb6d55f6 in do_command (thd=0x14b301415088) at /test/10.5_dbg/sql/sql_parse.cc:1355
#32 0x0000563ecb8309f9 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x14b304515808, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1411
#33 0x0000563ecb831115 in handle_one_connection (arg=arg@entry=0x14b304515808) at /test/10.5_dbg/sql/sql_connect.cc:1313
#34 0x0000563ecbc90104 in pfs_spawn_thread (arg=0x14b321845888) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
#35 0x000014b323b486db in start_thread (arg=0x14b31a50c700) at pthread_create.c:463
#36 0x000014b322f4688f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
The crash is also repeatable with CREATE..SELECT, instead of setting sql_buffer_result=1
SET collation_connection='utf16_general_ci';
CREATEORREPLACETABLE t1(c INT);
INSERTINTO t1 VALUES(NULL);
CREATEORREPLACETABLE t2 ASSELECTPASSWORD(c) FROM t1;
Alexander Barkov
added a comment - The crash is also repeatable with CREATE..SELECT, instead of setting sql_buffer_result=1
SET collation_connection= 'utf16_general_ci' ;
CREATE OR REPLACE TABLE t1(c INT );
INSERT INTO t1 VALUES ( NULL );
CREATE OR REPLACE TABLE t2 AS SELECT PASSWORD (c) FROM t1;
Alexander Barkov
added a comment - Also repeatable with:
SET collation_connection= 'utf16_general_ci' ;
CREATE OR REPLACE TABLE t1 AS SELECT PASSWORD ( CAST ( NULL AS SIGNED));
#4 0x00005580330ab1d8 in String::copy (this=this@entry=0x14cfb0014420, str=0x14cfb002a2e8 "", arg_length=0, from_cs=0x5580345afa60 <my_charset_latin1>, to_cs=0x5580345d2e00 <my_charset_utf16_bin>, errors=errors@entry=0x14d074369e1c) at /test/10.8_dbg/sql/sql_string.h:430
#5 0x00005580333c022b in Item_func::val_str_from_val_str_ascii (this=0x14cfb00143f8, str=0x14cfb0014420, ascii_buffer=0x14cfb00144a0) at /test/10.8_dbg/sql/sql_string.h:278
#6 0x0000558033264a32 in Item_str_ascii_func::val_str (this=<optimized out>, str=<optimized out>) at /test/10.8_dbg/sql/item_strfunc.h:94
#7 0x000055803330e4e9 in Item::save_str_in_field (this=0x14cfb00143f8, field=0x14cfb00726e0, no_conversions=<optimized out>) at /test/10.8_dbg/sql/item.cc:6780
#8 0x00005580331e73a2 in Type_handler_string_result::Item_save_in_field (this=<optimized out>, item=<optimized out>, field=<optimized out>, no_conversions=<optimized out>) at /test/10.8_dbg/sql/sql_type.cc:4330
#9 0x00005580332f4699 in Item::save_in_field (this=0x14cfb00143f8, field=0x14cfb00726e0, no_conversions=<optimized out>) at /test/10.8_dbg/sql/item.cc:6828
#10 0x0000558032ebdfb0 in Item_result_field::save_in_result_field (this=<optimized out>, no_conversions=<optimized out>) at /test/10.8_dbg/sql/item.h:3436
#11 0x000055803305162a in copy_funcs (func_ptr=0x14cfb0072380, thd=0x14cfb0000db8) at /test/10.8_dbg/sql/sql_select.cc:26286
#12 0x00005580330516e5 in end_write (join=0x14cfb0015548, join_tab=0x14cfb0016ba8, end_of_records=<optimized out>) at /test/10.8_dbg/sql/sql_select.cc:22556
#13 0x0000558033061741 in AGGR_OP::put_record (this=this@entry=0x14cfb0017438, end_of_records=end_of_records@entry=false) at /test/10.8_dbg/sql/sql_select.cc:29452
#14 0x0000558033061f3e in AGGR_OP::put_record (this=0x14cfb0017438) at /test/10.8_dbg/sql/sql_select.h:1056
#15 sub_select_postjoin_aggr (join=0x14cfb0015548, join_tab=0x14cfb0016ba8, end_of_records=<optimized out>) at /test/10.8_dbg/sql/sql_select.cc:20786
#16 0x0000558033020e3d in evaluate_join_record (join=join@entry=0x14cfb0015548, join_tab=join_tab@entry=0x14cfb00167f8, error=error@entry=0) at /test/10.8_dbg/sql/sql_select.cc:21300
#17 0x000055803303701c in sub_select (join=0x14cfb0015548, join_tab=0x14cfb00167f8, end_of_records=<optimized out>) at /test/10.8_dbg/sql/sql_select.cc:21109
#18 0x000055803306ef96 in do_select (procedure=0x0, join=0x14cfb0015548) at /test/10.8_dbg/sql/sql_select.cc:20617
#19 JOIN::exec_inner (this=this@entry=0x14cfb0015548) at /test/10.8_dbg/sql/sql_select.cc:4735
#20 0x000055803306f542 in JOIN::exec (this=this@entry=0x14cfb0015548) at /test/10.8_dbg/sql/sql_select.cc:4513
#21 0x000055803306d553 in mysql_select (thd=thd@entry=0x14cfb0000db8, tables=0x14cfb0014568, fields=@0x14cfb0014100: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14cfb00144f8, last = 0x14cfb00144f8, elements = 1}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147879680, result=0x14cfb0015520, unit=0x14cfb00051c0, select_lex=0x14cfb0013e60) at /test/10.8_dbg/sql/sql_select.cc:4993
#22 0x000055803306d808 in handle_select (thd=thd@entry=0x14cfb0000db8, lex=lex@entry=0x14cfb00050e8, result=result@entry=0x14cfb0015520, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.8_dbg/sql/sql_select.cc:545
#23 0x0000558032fccc1e in execute_sqlcom_select (thd=thd@entry=0x14cfb0000db8, all_tables=0x14cfb0014568) at /test/10.8_dbg/sql/sql_parse.cc:6253
#24 0x0000558032fd9af1 in mysql_execute_command (thd=thd@entry=0x14cfb0000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.8_dbg/sql/sql_parse.cc:3944
#25 0x0000558032fc5e0f in mysql_parse (thd=thd@entry=0x14cfb0000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d07436b400) at /test/10.8_dbg/sql/sql_parse.cc:8028
#26 0x0000558032fd4aab in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14cfb0000db8, packet=packet@entry=0x14cfb000b879 "", packet_length=packet_length@entry=25, blocking=blocking@entry=true) at /test/10.8_dbg/sql/sql_class.h:1360
#27 0x0000558032fd7eea in do_command (thd=0x14cfb0000db8, blocking=blocking@entry=true) at /test/10.8_dbg/sql/sql_parse.cc:1402
#28 0x000055803315189c in do_handle_one_connection (connect=<optimized out>, connect@entry=0x558035890e58, put_in_cache=put_in_cache@entry=true) at /test/10.8_dbg/sql/sql_connect.cc:1418
#29 0x0000558033151ea1 in handle_one_connection (arg=arg@entry=0x558035890e58) at /test/10.8_dbg/sql/sql_connect.cc:1312
#30 0x00005580335d3442 in pfs_spawn_thread (arg=0x5580357a44c8) at /test/10.8_dbg/storage/perfschema/pfs.cc:2201
#31 0x000014d075ade609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#32 0x000014d0756cc293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
#4 0x0000556ad34621d8 in String::copy (this=this@entry=0x14d818014428, str=0x14d818041148 "", arg_length=0, from_cs=0x556ad4966a60 <my_charset_latin1>, to_cs=0x556ad49892a0 <my_charset_ucs2_bin>, errors=errors@entry=0x14d8c1d79e1c) at /test/10.8_dbg/sql/sql_string.h:430
#5 0x0000556ad377722b in Item_func::val_str_from_val_str_ascii (this=0x14d818014400, str=0x14d818014428, ascii_buffer=0x14d8180144a8) at /test/10.8_dbg/sql/sql_string.h:278
#6 0x0000556ad361ba32 in Item_str_ascii_func::val_str (this=<optimized out>, str=<optimized out>) at /test/10.8_dbg/sql/item_strfunc.h:94
#7 0x0000556ad36c54e9 in Item::save_str_in_field (this=0x14d818014400, field=0x14d818070bf0, no_conversions=<optimized out>) at /test/10.8_dbg/sql/item.cc:6780
#8 0x0000556ad359e3a2 in Type_handler_string_result::Item_save_in_field (this=<optimized out>, item=<optimized out>, field=<optimized out>, no_conversions=<optimized out>) at /test/10.8_dbg/sql/sql_type.cc:4330
#9 0x0000556ad36ab699 in Item::save_in_field (this=0x14d818014400, field=0x14d818070bf0, no_conversions=<optimized out>) at /test/10.8_dbg/sql/item.cc:6828
#10 0x0000556ad3274fb0 in Item_result_field::save_in_result_field (this=<optimized out>, no_conversions=<optimized out>) at /test/10.8_dbg/sql/item.h:3436
#11 0x0000556ad340862a in copy_funcs (func_ptr=0x14d818070890, thd=0x14d818000db8) at /test/10.8_dbg/sql/sql_select.cc:26286
#12 0x0000556ad34086e5 in end_write (join=0x14d818015550, join_tab=0x14d818016bb0, end_of_records=<optimized out>) at /test/10.8_dbg/sql/sql_select.cc:22556
#13 0x0000556ad3418741 in AGGR_OP::put_record (this=this@entry=0x14d818017440, end_of_records=end_of_records@entry=false) at /test/10.8_dbg/sql/sql_select.cc:29452
#14 0x0000556ad3418f3e in AGGR_OP::put_record (this=0x14d818017440) at /test/10.8_dbg/sql/sql_select.h:1056
#15 sub_select_postjoin_aggr (join=0x14d818015550, join_tab=0x14d818016bb0, end_of_records=<optimized out>) at /test/10.8_dbg/sql/sql_select.cc:20786
#16 0x0000556ad33d7e3d in evaluate_join_record (join=join@entry=0x14d818015550, join_tab=join_tab@entry=0x14d818016800, error=error@entry=0) at /test/10.8_dbg/sql/sql_select.cc:21300
#17 0x0000556ad33ee01c in sub_select (join=0x14d818015550, join_tab=0x14d818016800, end_of_records=<optimized out>) at /test/10.8_dbg/sql/sql_select.cc:21109
#18 0x0000556ad3425f96 in do_select (procedure=0x0, join=0x14d818015550) at /test/10.8_dbg/sql/sql_select.cc:20617
#19 JOIN::exec_inner (this=this@entry=0x14d818015550) at /test/10.8_dbg/sql/sql_select.cc:4735
#20 0x0000556ad3426542 in JOIN::exec (this=this@entry=0x14d818015550) at /test/10.8_dbg/sql/sql_select.cc:4513
#21 0x0000556ad3424553 in mysql_select (thd=thd@entry=0x14d818000db8, tables=0x14d818014570, fields=@0x14d818014108: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14d818014500, last = 0x14d818014500, elements = 1}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147879680, result=0x14d818015528, unit=0x14d8180051c0, select_lex=0x14d818013e68) at /test/10.8_dbg/sql/sql_select.cc:4993
#22 0x0000556ad3424808 in handle_select (thd=thd@entry=0x14d818000db8, lex=lex@entry=0x14d8180050e8, result=result@entry=0x14d818015528, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.8_dbg/sql/sql_select.cc:545
#23 0x0000556ad3383c1e in execute_sqlcom_select (thd=thd@entry=0x14d818000db8, all_tables=0x14d818014570) at /test/10.8_dbg/sql/sql_parse.cc:6253
#24 0x0000556ad3390af1 in mysql_execute_command (thd=thd@entry=0x14d818000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.8_dbg/sql/sql_parse.cc:3944
#25 0x0000556ad337ce0f in mysql_parse (thd=thd@entry=0x14d818000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d8c1d7b400) at /test/10.8_dbg/sql/sql_parse.cc:8028
#26 0x0000556ad338baab in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14d818000db8, packet=packet@entry=0x14d81800b879 "", packet_length=packet_length@entry=27, blocking=blocking@entry=true) at /test/10.8_dbg/sql/sql_class.h:1360
#27 0x0000556ad338eeea in do_command (thd=0x14d818000db8, blocking=blocking@entry=true) at /test/10.8_dbg/sql/sql_parse.cc:1402
#28 0x0000556ad350889c in do_handle_one_connection (connect=<optimized out>, connect@entry=0x556ad5f9d878, put_in_cache=put_in_cache@entry=true) at /test/10.8_dbg/sql/sql_connect.cc:1418
#29 0x0000556ad3508ea1 in handle_one_connection (arg=arg@entry=0x556ad5f9d878) at /test/10.8_dbg/sql/sql_connect.cc:1312
#30 0x0000556ad398a442 in pfs_spawn_thread (arg=0x556ad5eb1318) at /test/10.8_dbg/storage/perfschema/pfs.cc:2201
#31 0x000014d8e0f24609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#32 0x000014d8e0b12293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
The crash is also repeatable with CREATE..SELECT, instead of setting sql_buffer_result=1