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

Assertion `je->s.cs == nice_js->charset()' still fails in json_nice

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.2, 10.3, 10.4, 10.5, 10.6, 10.7
    • 10.4, 10.5, 10.6
    • JSON
    • None

    Description

      The patch for MDEV-24585 is already in main branches, and the test case from there doesn't fail anymore. But this does.

      SELECT JSON_INSERT( JSON_MERGE_PATCH( '{}', CONVERT('"foo"' USING BINARY) ), '$', NULL );
      

      10.2 026984c3

      mysqld: /data/src/10.2/sql/item_jsonfunc.cc:140: int json_nice(json_engine_t*, String*, Item_func_json_format::formats, int): Assertion `je->s.cs == nice_js->charset()' failed.
      211103  2:49:31 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007fa3de3a9f36 in __GI___assert_fail (assertion=0x555e492e6e60 "je->s.cs == nice_js->charset()", file=0x555e492e6e38 "/data/src/10.2/sql/item_jsonfunc.cc", line=140, function=0x555e492e6de8 "int json_nice(json_engine_t*, String*, Item_func_json_format::formats, int)") at assert.c:101
      #8  0x0000555e48bbac3d in json_nice (je=0x7fa3d83b5d80, nice_js=0x7fa3d83b5f70, mode=Item_func_json_format::LOOSE, tab_size=4) at /data/src/10.2/sql/item_jsonfunc.cc:140
      #9  0x0000555e48bc5771 in Item_func_json_insert::val_str (this=0x7fa3c8012fb8, str=0x7fa3d83b5f70) at /data/src/10.2/sql/item_jsonfunc.cc:2966
      #10 0x0000555e48a09b47 in Item::send (this=0x7fa3c8012fb8, protocol=0x7fa3c8001348, buffer=0x7fa3d83b5f70) at /data/src/10.2/sql/item.cc:6975
      #11 0x0000555e4867c34d in Protocol::send_result_set_row (this=0x7fa3c8001348, row_items=0x7fa3c8005200) at /data/src/10.2/sql/protocol.cc:989
      #12 0x0000555e48713422 in select_send::send_data (this=0x7fa3c8013298, items=...) at /data/src/10.2/sql/sql_class.cc:2788
      #13 0x0000555e487a5bb3 in JOIN::exec_inner (this=0x7fa3c80132b8) at /data/src/10.2/sql/sql_select.cc:3527
      #14 0x0000555e487a5620 in JOIN::exec (this=0x7fa3c80132b8) at /data/src/10.2/sql/sql_select.cc:3446
      #15 0x0000555e487a67fa in mysql_select (thd=0x7fa3c8000d90, tables=0x0, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7fa3c8013298, unit=0x7fa3c8004988, select_lex=0x7fa3c80050d8) at /data/src/10.2/sql/sql_select.cc:3849
      #16 0x0000555e4879a94e in handle_select (thd=0x7fa3c8000d90, lex=0x7fa3c80048c8, result=0x7fa3c8013298, setup_tables_done_option=0) at /data/src/10.2/sql/sql_select.cc:361
      #17 0x0000555e48764f22 in execute_sqlcom_select (thd=0x7fa3c8000d90, all_tables=0x0) at /data/src/10.2/sql/sql_parse.cc:6271
      #18 0x0000555e4875ba96 in mysql_execute_command (thd=0x7fa3c8000d90) at /data/src/10.2/sql/sql_parse.cc:3582
      #19 0x0000555e48768cde in mysql_parse (thd=0x7fa3c8000d90, rawbuf=0x7fa3c8012850 "SELECT JSON_INSERT( JSON_MERGE_PATCH( '{}', CONVERT('\"foo\"' USING BINARY) ), '$', NULL )", length=88, parser_state=0x7fa3d83b7560, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7793
      #20 0x0000555e48756f39 in dispatch_command (command=COM_QUERY, thd=0x7fa3c8000d90, packet=0x7fa3c8008b61 "", packet_length=88, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1827
      #21 0x0000555e48755a34 in do_command (thd=0x7fa3c8000d90) at /data/src/10.2/sql/sql_parse.cc:1381
      #22 0x0000555e488b1a81 in do_handle_one_connection (connect=0x555e4ba2d0d0) at /data/src/10.2/sql/sql_connect.cc:1336
      #23 0x0000555e488b17e6 in handle_one_connection (arg=0x555e4ba2d0d0) at /data/src/10.2/sql/sql_connect.cc:1241
      #24 0x0000555e490dc0a2 in pfs_spawn_thread (arg=0x555e4ba104d0) at /data/src/10.2/storage/perfschema/pfs.cc:1869
      #25 0x00007fa3de8bc609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #26 0x00007fa3de495293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Reproducible on all of 10.2-10.7.
      No obvious immediate problem on a non-debug build.

      Attachments

        Issue Links

          Activity

            People

              rucha174 Rucha Deodhar
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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