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

server crashes on JsonGet_string(NULL, 'a')

Details

    Description

      SELECT JsonGet_string(NULL, 'a');
      ERROR 2013 (HY000): Lost connection to MySQL server during query
      

      This also happens when trying to call json function on NULL column

      Attachments

        Activity

          Thanks for the report.

          Stack trace from 10.0 commit 4b1b305b9a876837616c85b1c37983051cd8c89d

          #3  <signal handler called>
          #4  0x00007f082493b8a3 in CheckMemory (g=0x7f0825090000, initid=0x7f08250223e8, args=0x7f08250223a8, n=1, m=1 '\001', obj=0 '\000', mod=0 '\000') at /src/10.0/storage/connect/jsonudf.cpp:1436
          #5  0x00007f0824940055 in jsonget_string (initid=0x7f08250223e8, args=0x7f08250223a8, result=0x7f08508fa140 "", res_length=0x7f08508f9fa0, is_null=0x7f08508f9faf "") at /src/10.0/storage/connect/jsonudf.cpp:2852
          #6  0x00000000008c978d in udf_handler::val_str (this=0x7f0825022398, str=0x7f08508fa0e0, save_str=0x7f08250222e8) at /src/10.0/sql/item_func.cc:3715
          #7  0x00000000008ca215 in Item_func_udf_str::val_str (this=0x7f08250222d0, str=0x7f08508fa0e0) at /src/10.0/sql/item_func.cc:3903
          #8  0x000000000087e189 in Item::send (this=0x7f08250222d0, protocol=0x7f08365b8538, buffer=0x7f08508fa0e0) at /src/10.0/sql/item.cc:6508
          #9  0x00000000005c4a68 in Protocol::send_result_set_row (this=0x7f08365b8538, row_items=0x7f08365bc128) at /src/10.0/sql/protocol.cc:903
          #10 0x0000000000632ffd in select_send::send_data (this=0x7f0825022500, items=...) at /src/10.0/sql/sql_class.cc:2573
          #11 0x00000000006a71ed in JOIN::exec_inner (this=0x7f0825022520) at /src/10.0/sql/sql_select.cc:2459
          #12 0x00000000006a6c0a in JOIN::exec (this=0x7f0825022520) at /src/10.0/sql/sql_select.cc:2373
          #13 0x00000000006a9fb7 in mysql_select (thd=0x7f08365b7fb0, rref_pointer_array=0x7f08365bc288, tables=0x0, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f0825022500, unit=0x7f08365bb920, select_lex=0x7f08365bc010) at /src/10.0/sql/sql_select.cc:3308
          #14 0x00000000006a0333 in handle_select (thd=0x7f08365b7fb0, lex=0x7f08365bb858, result=0x7f0825022500, setup_tables_done_option=0) at /src/10.0/sql/sql_select.cc:373
          #15 0x0000000000674b85 in execute_sqlcom_select (thd=0x7f08365b7fb0, all_tables=0x0) at /src/10.0/sql/sql_parse.cc:5293
          #16 0x000000000066d09f in mysql_execute_command (thd=0x7f08365b7fb0) at /src/10.0/sql/sql_parse.cc:2562
          #17 0x00000000006777cd in mysql_parse (thd=0x7f08365b7fb0, rawbuf=0x7f0825022088 "SELECT JsonGet_string(NULL, 'a')", length=32, parser_state=0x7f08508fb6a0) at /src/10.0/sql/sql_parse.cc:6574
          #18 0x000000000066a309 in dispatch_command (command=COM_QUERY, thd=0x7f08365b7fb0, packet=0x7f082789d231 "", packet_length=32) at /src/10.0/sql/sql_parse.cc:1308
          #19 0x00000000006695d6 in do_command (thd=0x7f08365b7fb0) at /src/10.0/sql/sql_parse.cc:998
          #20 0x0000000000787cb2 in do_handle_one_connection (thd_arg=0x7f08365b7fb0) at /src/10.0/sql/sql_connect.cc:1378
          #21 0x0000000000787a24 in handle_one_connection (arg=0x7f08365b7fb0) at /src/10.0/sql/sql_connect.cc:1293
          #22 0x00007f085058b0a4 in start_thread () from /lib64/libpthread.so.0
          #23 0x00007f084e91f04d in clone () from /lib64/libc.so.6
          

          elenst Elena Stepanova added a comment - Thanks for the report. Stack trace from 10.0 commit 4b1b305b9a876837616c85b1c37983051cd8c89d #3 <signal handler called> #4 0x00007f082493b8a3 in CheckMemory (g=0x7f0825090000, initid=0x7f08250223e8, args=0x7f08250223a8, n=1, m=1 '\001', obj=0 '\000', mod=0 '\000') at /src/10.0/storage/connect/jsonudf.cpp:1436 #5 0x00007f0824940055 in jsonget_string (initid=0x7f08250223e8, args=0x7f08250223a8, result=0x7f08508fa140 "", res_length=0x7f08508f9fa0, is_null=0x7f08508f9faf "") at /src/10.0/storage/connect/jsonudf.cpp:2852 #6 0x00000000008c978d in udf_handler::val_str (this=0x7f0825022398, str=0x7f08508fa0e0, save_str=0x7f08250222e8) at /src/10.0/sql/item_func.cc:3715 #7 0x00000000008ca215 in Item_func_udf_str::val_str (this=0x7f08250222d0, str=0x7f08508fa0e0) at /src/10.0/sql/item_func.cc:3903 #8 0x000000000087e189 in Item::send (this=0x7f08250222d0, protocol=0x7f08365b8538, buffer=0x7f08508fa0e0) at /src/10.0/sql/item.cc:6508 #9 0x00000000005c4a68 in Protocol::send_result_set_row (this=0x7f08365b8538, row_items=0x7f08365bc128) at /src/10.0/sql/protocol.cc:903 #10 0x0000000000632ffd in select_send::send_data (this=0x7f0825022500, items=...) at /src/10.0/sql/sql_class.cc:2573 #11 0x00000000006a71ed in JOIN::exec_inner (this=0x7f0825022520) at /src/10.0/sql/sql_select.cc:2459 #12 0x00000000006a6c0a in JOIN::exec (this=0x7f0825022520) at /src/10.0/sql/sql_select.cc:2373 #13 0x00000000006a9fb7 in mysql_select (thd=0x7f08365b7fb0, rref_pointer_array=0x7f08365bc288, tables=0x0, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f0825022500, unit=0x7f08365bb920, select_lex=0x7f08365bc010) at /src/10.0/sql/sql_select.cc:3308 #14 0x00000000006a0333 in handle_select (thd=0x7f08365b7fb0, lex=0x7f08365bb858, result=0x7f0825022500, setup_tables_done_option=0) at /src/10.0/sql/sql_select.cc:373 #15 0x0000000000674b85 in execute_sqlcom_select (thd=0x7f08365b7fb0, all_tables=0x0) at /src/10.0/sql/sql_parse.cc:5293 #16 0x000000000066d09f in mysql_execute_command (thd=0x7f08365b7fb0) at /src/10.0/sql/sql_parse.cc:2562 #17 0x00000000006777cd in mysql_parse (thd=0x7f08365b7fb0, rawbuf=0x7f0825022088 "SELECT JsonGet_string(NULL, 'a')", length=32, parser_state=0x7f08508fb6a0) at /src/10.0/sql/sql_parse.cc:6574 #18 0x000000000066a309 in dispatch_command (command=COM_QUERY, thd=0x7f08365b7fb0, packet=0x7f082789d231 "", packet_length=32) at /src/10.0/sql/sql_parse.cc:1308 #19 0x00000000006695d6 in do_command (thd=0x7f08365b7fb0) at /src/10.0/sql/sql_parse.cc:998 #20 0x0000000000787cb2 in do_handle_one_connection (thd_arg=0x7f08365b7fb0) at /src/10.0/sql/sql_connect.cc:1378 #21 0x0000000000787a24 in handle_one_connection (arg=0x7f08365b7fb0) at /src/10.0/sql/sql_connect.cc:1293 #22 0x00007f085058b0a4 in start_thread () from /lib64/libpthread.so.0 #23 0x00007f084e91f04d in clone () from /lib64/libc.so.6

          People

            bertrandop Olivier Bertrand
            whitewind Mikhail Avdienko
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.