Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-21915

Server crashes in copy_fields,Item_func_group_concat::add while using json_arrayagg() as a window function

    XMLWordPrintable

Details

    Description

      KB says that JSON_ARRAYAGG and JSON_OBJECTAGG can be used as as a window function https://mariadb.com/kb/en/json_objectagg/.
      While using JSON_OBJECTAGG returns error

      MariaDB [test]> SELECT JSON_OBJECTAGG(a,b) over () FROM (select 1 a, 2 b from dual) t;
      ERROR 1235 (42000): This version of MariaDB doesn't yet support 'GROUP_CONCAT() aggregate as window function'
      

      and JSON_ARRAYAGG:

      select json_arrayagg(a) over () from (select 1 a) t;
      

      #4  0x00005628808894d4 in copy_fields (param=0x0) at /10.5/sql/sql_select.cc:25194
      #5  0x0000562880c494f7 in Item_func_group_concat::add (this=0x7f1e68014250, exclude_nulls=false) at /10.5/sql/item_sum.cc:3998
      #6  0x0000562880d63183 in Item_func_json_arrayagg::add (this=0x7f1e68014250) at /10.5/sql/item_jsonfunc.h:561
      #7  0x0000562880a5d3b3 in Frame_cursor::add_value_to_items (this=0x7f1e681b1b60) at /10.5/sql/sql_window.cc:1104
      #8  0x0000562880a5f4ba in Frame_scan_cursor::compute_values_for_current_row (this=0x7f1e681b1b60) at /10.5/sql/sql_window.cc:2211
      #9  0x0000562880a5f31e in Frame_scan_cursor::next_partition (this=0x7f1e681b1b60, rownum=0) at /10.5/sql/sql_window.cc:2168
      #10 0x0000562880a5d5c1 in Cursor_manager::notify_cursors_partition_changed (this=0x7f1e68088d60, rownum=0) at /10.5/sql/sql_window.cc:1167
      #11 0x0000562880a5b646 in compute_window_func (thd=0x7f1e68000d78, window_functions=..., cursor_managers=..., tbl=0x7f1e681a3290, filesort_result=0x7f1e681acf20) at /10.5/sql/sql_window.cc:2845
      #12 0x0000562880a5ba85 in Window_func_runner::exec (this=0x7f1e68019298, thd=0x7f1e68000d78, tbl=0x7f1e681a3290, filesort_result=0x7f1e681acf20) at /10.5/sql/sql_window.cc:2968
      #13 0x0000562880a5bb74 in Window_funcs_sort::exec (this=0x7f1e68019290, join=0x7f1e680165f0, keep_filesort_result=true) at /10.5/sql/sql_window.cc:2996
      #14 0x0000562880a5c112 in Window_funcs_computation::exec (this=0x7f1e68019270, join=0x7f1e680165f0, keep_last_filesort_result=true) at /10.5/sql/sql_window.cc:3122
      #15 0x0000562880894240 in AGGR_OP::end_send (this=0x7f1e68019100) at /10.5/sql/sql_select.cc:28786
      #16 0x000056288087cf2e in sub_select_postjoin_aggr (join=0x7f1e680165f0, join_tab=0x7f1e68018610, end_of_records=true) at /10.5/sql/sql_select.cc:20239
      #17 0x000056288087c9b9 in do_select (join=0x7f1e680165f0, procedure=0x0) at /10.5/sql/sql_select.cc:20065
      #18 0x0000562880850ea7 in JOIN::exec_inner (this=0x7f1e680165f0) at /10.5/sql/sql_select.cc:4456
      #19 0x000056288084ffd3 in JOIN::exec (this=0x7f1e680165f0) at /10.5/sql/sql_select.cc:4237
      #20 0x00005628808516f4 in mysql_select (thd=0x7f1e68000d78, tables=0x7f1e68015610, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f1e680165c8, unit=0x7f1e68004d80, select_lex=0x7f1e68013c50) at /10.5/sql/sql_select.cc:4661
      #21 0x0000562880841432 in handle_select (thd=0x7f1e68000d78, lex=0x7f1e68004cb8, result=0x7f1e680165c8, setup_tables_done_option=0) at /10.5/sql/sql_select.cc:415
      #22 0x000056288080704f in execute_sqlcom_select (thd=0x7f1e68000d78, all_tables=0x7f1e68015610) at /10.5/sql/sql_parse.cc:6147
      #23 0x00005628807fdd32 in mysql_execute_command (thd=0x7f1e68000d78) at /10.5/sql/sql_parse.cc:3899
      #24 0x000056288080bee0 in mysql_parse (thd=0x7f1e68000d78, rawbuf=0x7f1e68013b80 "select json_arrayagg(a) over () from (select 1 a) t", length=51, parser_state=0x7f1e79b6c510, is_com_multi=false, is_next_command=false) at /10.5/sql/sql_parse.cc:7926
      #25 0x00005628807f7b2e in dispatch_command (command=COM_QUERY, thd=0x7f1e68000d78, packet=0x7f1e68008cf9 "", packet_length=51, is_com_multi=false, is_next_command=false) at /10.5/sql/sql_parse.cc:1839
      #26 0x00005628807f626c in do_command (thd=0x7f1e68000d78) at /10.5/sql/sql_parse.cc:1358
      #27 0x000056288099532e in do_handle_one_connection (connect=0x5628836d6c38, put_in_cache=true) at /10.5/sql/sql_connect.cc:1422
      #28 0x000056288099505e in handle_one_connection (arg=0x56288373f718) at /10.5/sql/sql_connect.cc:1319
      #29 0x0000562880eba8a1 in pfs_spawn_thread (arg=0x5628837b7a88) at /10.5/storage/perfschema/pfs.cc:2201
      #30 0x00007f1e7fc53fa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
      #31 0x00007f1e7f2844cf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Attachments

        Issue Links

          Activity

            People

              holyfoot Alexey Botchkov
              alice Alice Sherepa
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.