Core was generated by `/test/MD250620-mariadb-10.5.5-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
|
Program terminated with signal SIGABRT, Aborted.
|
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
|
at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
|
[Current thread is 1 (Thread 0x1463a8c3d700 (LWP 588632))]
|
(gdb) bt
|
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
|
#1 0x000055fc96ed27d0 in my_write_core (sig=sig@entry=6) at /test/10.5_dbg/mysys/stacktrace.c:518
|
#2 0x000055fc9668b47a in handle_fatal_signal (sig=6) at /test/10.5_dbg/sql/signal_handler.cc:330
|
#3 <signal handler called>
|
#4 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
|
#5 0x00001463a6ed38b1 in __GI_abort () at abort.c:79
|
#6 0x00001463a6ec342a in __assert_fail_base (fmt=0x1463a704aa38 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x55fc9720c66f "0", file=file@entry=0x55fc9722e3b0 "/test/10.5_dbg/sql/item_jsonfunc.h", line=line@entry=599, function=function@entry=0x55fc9722d940 <Item_func_json_objectagg::reset_field()::__PRETTY_FUNCTION__> "virtual void Item_func_json_objectagg::reset_field()") at assert.c:92
|
#7 0x00001463a6ec34a2 in __GI___assert_fail (assertion=assertion@entry=0x55fc9720c66f "0", file=file@entry=0x55fc9722e3b0 "/test/10.5_dbg/sql/item_jsonfunc.h", line=line@entry=599, function=function@entry=0x55fc9722d940 <Item_func_json_objectagg::reset_field()::__PRETTY_FUNCTION__> "virtual void Item_func_json_objectagg::reset_field()") at assert.c:101
|
#8 0x000055fc968902f1 in Item_func_json_objectagg::reset_field (this=<optimized out>) at /test/10.5_dbg/sql/item_jsonfunc.h:599
|
#9 0x000055fc96418a2d in init_tmptable_sum_functions (func_ptr=0x146385076698) at /test/10.5_dbg/sql/sql_select.cc:25592
|
#10 0x000055fc96438976 in end_update (join=0x146385075e90, join_tab=0x146385077838, end_of_records=false) at /test/10.5_dbg/sql/sql_select.cc:22128
|
#11 0x000055fc9643dc43 in AGGR_OP::put_record (this=this@entry=0x146385078298, end_of_records=end_of_records@entry=false) at /test/10.5_dbg/sql/sql_select.cc:28797
|
#12 0x000055fc9643e2f2 in AGGR_OP::put_record (this=0x146385078298) at /test/10.5_dbg/sql/sql_select.h:1048
|
#13 sub_select_postjoin_aggr (join=0x146385075e90, join_tab=0x146385077838, end_of_records=<optimized out>) at /test/10.5_dbg/sql/sql_select.cc:20316
|
#14 0x000055fc9641eea5 in evaluate_join_record (join=join@entry=0x146385075e90, join_tab=join_tab@entry=0x146385077490, error=error@entry=0) at /test/10.5_dbg/sql/sql_select.cc:20823
|
#15 0x000055fc964261cf in sub_select (join=0x146385075e90, join_tab=0x146385077490, end_of_records=<optimized out>) at /test/10.5_dbg/sql/sql_select.cc:20600
|
#16 0x000055fc9645f150 in do_select (procedure=0x0, join=0x146385075e90) at /test/10.5_dbg/sql/sql_select.cc:20134
|
#17 JOIN::exec_inner (this=this@entry=0x146385075e90) at /test/10.5_dbg/sql/sql_select.cc:4444
|
#18 0x000055fc9645f76b in JOIN::exec (this=this@entry=0x146385075e90) at /test/10.5_dbg/sql/sql_select.cc:4225
|
#19 0x000055fc9645da80 in mysql_select (thd=thd@entry=0x146385015088, tables=<optimized out>, fields=@0x1463850742c8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1463850748a8, last = 0x146385074c98, elements = 2}, <No data fields>}, conds=0x0, og_num=1, order=<optimized out>, group=0x146385075528, having=0x0, proc_param=0x0, select_options=2147748608, result=0x146385075e68, unit=0x1463850190a0, select_lex=0x146385074178) at /test/10.5_dbg/sql/sql_select.cc:4649
|
#20 0x000055fc9645ddaf in handle_select (thd=thd@entry=0x146385015088, lex=lex@entry=0x146385018fd8, result=result@entry=0x146385075e68, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.5_dbg/sql/sql_select.cc:417
|
#21 0x000055fc963e76c9 in execute_sqlcom_select (thd=thd@entry=0x146385015088, all_tables=0x146385074cf8) at /test/10.5_dbg/sql/sql_parse.cc:6211
|
#22 0x000055fc963e07c2 in mysql_execute_command (thd=thd@entry=0x146385015088) at /test/10.5_dbg/sql/sql_parse.cc:3939
|
#23 0x000055fc963ed638 in mysql_parse (thd=thd@entry=0x146385015088, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1463a8c3c350, 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:7995
|
#24 0x000055fc963da110 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x146385015088, packet=packet@entry=0x146385067089 "", packet_length=packet_length@entry=56, 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
|
#25 0x000055fc963d88ea in do_command (thd=0x146385015088) at /test/10.5_dbg/sql/sql_parse.cc:1355
|
#26 0x000055fc9653415f in do_handle_one_connection (connect=<optimized out>, connect@entry=0x146387cd2808, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1411
|
#27 0x000055fc9653487b in handle_one_connection (arg=arg@entry=0x146387cd2808) at /test/10.5_dbg/sql/sql_connect.cc:1313
|
#28 0x000055fc9699711c in pfs_spawn_thread (arg=0x1463a5846508) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
|
#29 0x00001463a7bb66db in start_thread (arg=0x1463a8c3d700) at pthread_create.c:463
|
#30 0x00001463a6fb4a3f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
|
On debug builds the crash happens here:
(lldb) bt
* thread #2, stop reason = signal SIGABRT
* frame #0: 0x00007fff730707fa libsystem_kernel.dylib`__pthread_kill + 10
frame #1: 0x00007fff7312dbc1 libsystem_pthread.dylib`pthread_kill + 432
frame #2: 0x00007fff72ff7a1c libsystem_c.dylib`abort + 120
frame #3: 0x00007fff72ff6cd6 libsystem_c.dylib`__assert_rtn + 314
frame #4: 0x0000000101798640 mysqld`Item_func_json_objectagg::reset_field(this=0x000062b000062c20) at item_jsonfunc.h:600:24
frame #5: 0x000000010112e487 mysqld`init_tmptable_sum_functions(func_ptr=0x000062b000064810) at sql_select.cc:25592:11
frame #6: 0x00000001010c71af mysqld`end_update(join=0x000062b000064030, join_tab=0x000062b000065818, end_of_records=false) at sql_select.cc:22128:3
frame #7: 0x00000001011037fe mysqld`AGGR_OP::put_record(this=0x000062b000066310, end_of_records=false) at sql_select.cc:28796:30
frame #8: 0x00000001010d0f57 mysqld`AGGR_OP::put_record(this=0x000062b000066310) at sql_select.h:1048:48
frame #9: 0x000000010103cb89 mysqld`sub_select_postjoin_aggr(join=0x000062b000064030, join_tab=0x000062b000065818, end_of_records=false) at sql_select.cc:20316:13
frame #10: 0x00000001010d3122 mysqld`evaluate_join_record(join=0x000062b000064030, join_tab=0x000062b000065470, error=0) at sql_select.cc:20823:11
frame #11: 0x00000001010d01b2 mysqld`sub_select(join=0x000062b000064030, join_tab=0x000062b000065470, end_of_records=false) at sql_select.cc:20600:9
frame #12: 0x0000000101056314 mysqld`do_select(join=0x000062b000064030, procedure=0x0000000000000000) at sql_select.cc:20134:14
frame #13: 0x0000000101051e05 mysqld`JOIN::exec_inner(this=0x000062b000064030) at sql_select.cc:4444:50
frame #14: 0x000000010104dc25 mysqld`JOIN::exec(this=0x000062b000064030) at sql_select.cc:4225:3
frame #15: 0x0000000100fb8e87 mysqld`mysql_select(thd=0x000062b00005b288, tables=0x000062b000062e20, fields=0x000062b0000624d0, conds=0x0000000000000000, og_num=1, order=0x0000000000000000, group=0x000062b000063678, having=0x0000000000000000, proc_param=0x0000000000000000, select_options=2147748608, result=0x000062b000064000, unit=0x000062b00005f2d0, select_lex=0x000062b000062380) at sql_select.cc:4649:9
frame #16: 0x0000000100fb756f mysqld`handle_select(thd=0x000062b00005b288, lex=0x000062b00005f208, result=0x000062b000064000, setup_tables_done_option=0) at sql_select.cc:417:10
The reset_field and update_field is not implemented in Item_func_json_objectagg. The same is for Item_func_json_arrayagg, so we should make sure that quick_grouping is not done, that is we don't create an index over grouping fields and update the result in the temp table, instead we should first sort the result in accordance to the GROUP BY fields and then perform the grouping and write the result to the temp table.