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

Server crashes in json_path_parts_compare

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 10.9(EOL)
    • 10.9.1
    • JSON

    Description

      SELECT * FROM JSON_TABLE('{"foo":["bar","qux"]}','$**.*[0]' COLUMNS(col1 CHAR(8) PATH '$[0]')) AS jt;
      

      10.9 f326b43c

      #3  <signal handler called>
      #4  0x0000563a6dd3e0d5 in json_path_parts_compare (a=0x7fa1f8015df0, a_end=0x7fa1f8015df0, b=0x7fa1f8016348, b_end=0x7fa1f8016348, vt=JSON_VALUE_STRING, array_sizes=0x4) at /data/src/10.9/strings/json_lib.c:1900
      #5  0x0000563a6dd3e293 in json_path_parts_compare (a=0x7fa1f8015dd0, a_end=0x7fa1f8015df0, b=0x7fa1f8016348, b_end=0x7fa1f8016348, vt=JSON_VALUE_STRING, array_sizes=0x0) at /data/src/10.9/strings/json_lib.c:1945
      #6  0x0000563a6dd3e446 in json_path_compare (a=0x7fa1f8015d80, b=0x7fa1f80162d8, vt=JSON_VALUE_STRING, array_size=0x0) at /data/src/10.9/strings/json_lib.c:1982
      #7  0x0000563a6d3574ee in Json_table_nested_path::scan_next (this=0x7fa1f8015d80) at /data/src/10.9/sql/json_table.cc:315
      #8  0x0000563a6d357806 in ha_json_table::rnd_next (this=0x7fa1f82156a0, buf=0x7fa1f8225a40 "\377\377", ' ' <repeats 32 times>, '\245' <repeats 46 times>, "\377\377", ' ' <repeats 32 times>, '\245' <repeats 22 times>, '\217' <repeats 64 times>...) at /data/src/10.9/sql/json_table.cc:402
      #9  0x0000563a6d433bcc in handler::ha_rnd_next (this=0x7fa1f82156a0, buf=0x7fa1f8225a40 "\377\377", ' ' <repeats 32 times>, '\245' <repeats 46 times>, "\377\377", ' ' <repeats 32 times>, '\245' <repeats 22 times>, '\217' <repeats 64 times>...) at /data/src/10.9/sql/handler.cc:3414
      #10 0x0000563a6cf40229 in rr_sequential (info=0x7fa1f81137b8) at /data/src/10.9/sql/records.cc:519
      #11 0x0000563a6cf2b62d in READ_RECORD::read_record (this=0x7fa1f81137b8) at /data/src/10.9/sql/records.h:81
      #12 0x0000563a6d1141e1 in join_init_read_record (tab=0x7fa1f81136f0) at /data/src/10.9/sql/sql_select.cc:22089
      #13 0x0000563a6d111bac in sub_select (join=0x7fa1f8017e40, join_tab=0x7fa1f81136f0, end_of_records=false) at /data/src/10.9/sql/sql_select.cc:21092
      #14 0x0000563a6d1110be in do_select (join=0x7fa1f8017e40, procedure=0x0) at /data/src/10.9/sql/sql_select.cc:20640
      #15 0x0000563a6d0e4748 in JOIN::exec_inner (this=0x7fa1f8017e40) at /data/src/10.9/sql/sql_select.cc:4749
      #16 0x0000563a6d0e37bd in JOIN::exec (this=0x7fa1f8017e40) at /data/src/10.9/sql/sql_select.cc:4527
      #17 0x0000563a6d0e50ee in mysql_select (thd=0x7fa1f8000db8, tables=0x7fa1f8016d78, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7fa1f8017e18, unit=0x7fa1f80051c8, select_lex=0x7fa1f80156a8) at /data/src/10.9/sql/sql_select.cc:5007
      #18 0x0000563a6d0d43e7 in handle_select (thd=0x7fa1f8000db8, lex=0x7fa1f80050f0, result=0x7fa1f8017e18, setup_tables_done_option=0) at /data/src/10.9/sql/sql_select.cc:543
      #19 0x0000563a6d07d3f5 in execute_sqlcom_select (thd=0x7fa1f8000db8, all_tables=0x7fa1f8016d78) at /data/src/10.9/sql/sql_parse.cc:6268
      #20 0x0000563a6d074702 in mysql_execute_command (thd=0x7fa1f8000db8, is_called_from_prepared_stmt=false) at /data/src/10.9/sql/sql_parse.cc:3959
      #21 0x0000563a6d082177 in mysql_parse (thd=0x7fa1f8000db8, rawbuf=0x7fa1f8015580 "SELECT * FROM JSON_TABLE('{\"foo\":[\"bar\",\"qux\"]}','$**.*[0]' COLUMNS(col1 CHAR(8) PATH '$[0]')) AS jt", length=100, parser_state=0x7fa20f617500) at /data/src/10.9/sql/sql_parse.cc:8043
      #22 0x0000563a6d06e7d8 in dispatch_command (command=COM_QUERY, thd=0x7fa1f8000db8, packet=0x7fa1f800b999 "", packet_length=100, blocking=true) at /data/src/10.9/sql/sql_parse.cc:1910
      #23 0x0000563a6d06d105 in do_command (thd=0x7fa1f8000db8, blocking=true) at /data/src/10.9/sql/sql_parse.cc:1407
      #24 0x0000563a6d23fe92 in do_handle_one_connection (connect=0x563a7146bc48, put_in_cache=true) at /data/src/10.9/sql/sql_connect.cc:1418
      #25 0x0000563a6d23fb31 in handle_one_connection (arg=0x563a7146e2c8) at /data/src/10.9/sql/sql_connect.cc:1312
      #26 0x0000563a6d739838 in pfs_spawn_thread (arg=0x563a7146b7b8) at /data/src/10.9/storage/perfschema/pfs.cc:2201
      #27 0x00007fa219132ea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #28 0x00007fa218d31def in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      The failure started happening on 10.9 after this commit

      commit c781cefd8afc0fa5840456c96f5a0c37cac2edfa
      Author: Rucha Deodhar
      Date:   Sat Mar 5 01:03:49 2022 +0530
       
          MDEV-27911: Implement range notation for json path
      

      Attachments

        Issue Links

          Activity

            People

              rucha174 Rucha Deodhar
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.