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

Assorted assertion failures in json_find_path with certain collations

    XMLWordPrintable

Details

    Description

      SET COLLATION_CONNECTION= ucs2_unicode_ci;
      SELECT JSON_VALUE('["foo"]', '$**[0]') AS f;
      

      10.2 debug a1e52e7f

      mysqld: /data/src/10.2/strings/json_lib.c:1360: json_find_path: Assertion `0' failed.
      200717 14:17:44 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f1875a73f12 in __GI___assert_fail (assertion=0x5574f4d78879 "0", file=0x5574f4d787f8 "/data/src/10.2/strings/json_lib.c", line=1360, function=0x5574f4d78900 <__PRETTY_FUNCTION__.9403> "json_find_path") at assert.c:101
      #8  0x00005574f490b38e in json_find_path (je=0x7f18705a6dc0, p=0x7f1854012808, p_cur_step=0x7f1854012c50, array_counters=0x7f18705a6d40) at /data/src/10.2/strings/json_lib.c:1360
      #9  0x00005574f432f294 in Item_func_json_value::val_str (this=0x7f1854012748, str=0x7f18705a6fb0) at /data/src/10.2/sql/item_jsonfunc.cc:486
      #10 0x00005574f418823b in Item::send (this=0x7f1854012748, protocol=0x7f18540010a8, buffer=0x7f18705a6fb0) at /data/src/10.2/sql/item.cc:6921
      #11 0x00005574f3e0cc4b in Protocol::send_result_set_row (this=0x7f18540010a8, row_items=0x7f1854004f50) at /data/src/10.2/sql/protocol.cc:990
      #12 0x00005574f3ea0db2 in select_send::send_data (this=0x7f1854012d48, items=...) at /data/src/10.2/sql/sql_class.cc:2731
      #13 0x00005574f3f30833 in JOIN::exec_inner (this=0x7f1854012d68) at /data/src/10.2/sql/sql_select.cc:3514
      #14 0x00005574f3f302b2 in JOIN::exec (this=0x7f1854012d68) at /data/src/10.2/sql/sql_select.cc:3433
      #15 0x00005574f3f31468 in mysql_select (thd=0x7f1854000af0, tables=0x0, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f1854012d48, unit=0x7f18540046e8, select_lex=0x7f1854004e28) at /data/src/10.2/sql/sql_select.cc:3833
      #16 0x00005574f3f25626 in handle_select (thd=0x7f1854000af0, lex=0x7f1854004628, result=0x7f1854012d48, setup_tables_done_option=0) at /data/src/10.2/sql/sql_select.cc:361
      #17 0x00005574f3ef1070 in execute_sqlcom_select (thd=0x7f1854000af0, all_tables=0x0) at /data/src/10.2/sql/sql_parse.cc:6218
      #18 0x00005574f3ee78f1 in mysql_execute_command (thd=0x7f1854000af0) at /data/src/10.2/sql/sql_parse.cc:3524
      #19 0x00005574f3ef4da7 in mysql_parse (thd=0x7f1854000af0, rawbuf=0x7f1854012458 "SELECT JSON_VALUE('[\"foo\"]', '$**[0]') AS f", length=43, parser_state=0x7f18705a8610, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7733
      #20 0x00005574f3ee30d3 in dispatch_command (command=COM_QUERY, thd=0x7f1854000af0, packet=0x7f185408d421 "", packet_length=43, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1824
      #21 0x00005574f3ee1b4e in do_command (thd=0x7f1854000af0) at /data/src/10.2/sql/sql_parse.cc:1377
      #22 0x00005574f4037b29 in do_handle_one_connection (connect=0x5574f7d44d00) at /data/src/10.2/sql/sql_connect.cc:1336
      #23 0x00005574f4037894 in handle_one_connection (arg=0x5574f7d44d00) at /data/src/10.2/sql/sql_connect.cc:1241
      #24 0x00005574f484e352 in pfs_spawn_thread (arg=0x5574f7d4faf0) at /data/src/10.2/storage/perfschema/pfs.cc:1869
      #25 0x00007f18779fc4a4 in start_thread (arg=0x7f18705a9700) at pthread_create.c:456
      #26 0x00007f1875b30d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      Non-debug build returns NULL, I can't tell whether it's correct or not (with a standard collation it returns foo):

      10.2 non-debug a1e52e7f

      SET COLLATION_CONNECTION= ucs2_unicode_ci;
      SELECT JSON_VALUE('["foo"]', '$**[0]') AS f;
      f
      NULL
      SET COLLATION_CONNECTION= DEFAULT;
      SELECT JSON_VALUE('["foo"]', '$**[0]') AS f;
      f
      foo
      

      Attachments

        Issue Links

          Activity

            People

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