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

Assertion `!item->null_value' failed in bool Type_handler::Item_send_str(Item*, Protocol*, st_value*) const on JSON_OBJECT

    XMLWordPrintable

Details

    Description

      CREATE TABLE t (c TEXT CHARACTER SET UJIS);
      INSERT INTO t VALUES (0xAEE4),('0xAEE4');
      SELECT JSON_OBJECT (0,c) FROM t;
      

      Leads to:

      CS 10.6.21 7372ecc396517839a1546a8c1dd9192711922ef1 (Debug)

      mariadbd: /test/10.6_dbg/sql/sql_type.cc:7599: bool Type_handler::Item_send_str(Item*, Protocol*, st_value*) const: Assertion `!item->null_value' failed.
      

      CS 10.6.21 7372ecc396517839a1546a8c1dd9192711922ef1 (Debug)

      Core was generated by `/test/MD061224-mariadb-10.6.21-linux-x86_64-dbg/bin/mariadbd --no-defaults --ma'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      [Current thread is 1 (Thread 0x14c1ea1af700 (LWP 3282793))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x000014c2025ee859 in __GI_abort () at abort.c:79
      #2  0x000014c2025ee729 in __assert_fail_base (fmt=0x14c202784588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x556cf5331858 "!item->null_value", file=0x556cf53319a8 "/test/10.6_dbg/sql/sql_type.cc", line=7599, function=<optimized out>) at assert.c:92
      #3  0x000014c2025fffd6 in __GI___assert_fail (assertion=assertion@entry=0x556cf5331858 "!item->null_value", file=file@entry=0x556cf53319a8 "/test/10.6_dbg/sql/sql_type.cc", line=line@entry=7599, function=function@entry=0x556cf5335ed0 "bool Type_handler::Item_send_str(Item*, Protocol*, st_value*) const") at assert.c:101
      #4  0x0000556cf48b41b7 in Type_handler::Item_send_str (this=<optimized out>, item=0x14c1b8013910, protocol=0x14c1b8001360, buf=<optimized out>) at /test/10.6_dbg/sql/sql_type.cc:7599
      #5  0x0000556cf47f661b in Type_handler_string_result::Item_send (this=<optimized out>, item=<optimized out>, protocol=<optimized out>, buf=<optimized out>) at /test/10.6_dbg/sql/sql_type.h:5546
      #6  0x0000556cf45d0084 in Item::send (this=0x14c1b8013910, protocol=0x14c1b8001360, buffer=0x14c1ea1acf10) at /test/10.6_dbg/sql/item.h:1261
      #7  0x0000556cf45cda8d in Protocol::send_result_set_row (this=this@entry=0x14c1b8001360, row_items=row_items@entry=0x14c1b80134f8) at /test/10.6_dbg/sql/protocol.cc:1329
      #8  0x0000556cf46560d5 in select_send::send_data (this=0x14c1b8014a40, items=@0x14c1b80134f8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14c1b80139e8, last = 0x14c1b80139e8, elements = 1}, <No data fields>}) at /test/10.6_dbg/sql/sql_class.cc:3206
      #9  0x0000556cf4717369 in select_result_sink::send_data_with_check (sent=<optimized out>, u=<optimized out>, items=@0x14c1b80134f8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14c1b80139e8, last = 0x14c1b80139e8, elements = 1}, <No data fields>}, this=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:5961
      #10 end_send (join=0x14c1b8014a68, join_tab=0x14c1b8016178, end_of_records=<optimized out>) at /test/10.6_dbg/sql/sql_select.cc:23659
      #11 0x0000556cf46e8ebe in evaluate_join_record (join=join@entry=0x14c1b8014a68, join_tab=join_tab@entry=0x14c1b8015db8, error=error@entry=0) at /test/10.6_dbg/sql/sql_select.cc:22614
      #12 0x0000556cf4700d6f in sub_select (join=0x14c1b8014a68, join_tab=0x14c1b8015db8, end_of_records=<optimized out>) at /test/10.6_dbg/sql/sql_select.cc:22423
      #13 0x0000556cf47334dc in do_select (procedure=<optimized out>, join=0x14c1b8014a68) at /test/10.6_dbg/sql/sql_select.cc:21907
      #14 JOIN::exec_inner (this=this@entry=0x14c1b8014a68) at /test/10.6_dbg/sql/sql_select.cc:4936
      #15 0x0000556cf47339fa in JOIN::exec (this=this@entry=0x14c1b8014a68) at /test/10.6_dbg/sql/sql_select.cc:4714
      #16 0x0000556cf4731a6f in mysql_select (thd=thd@entry=0x14c1b8000d48, tables=0x14c1b8013a40, fields=@0x14c1b80134f8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14c1b80139e8, last = 0x14c1b80139e8, elements = 1}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x14c1b8014a40, unit=0x14c1b8004f38, select_lex=0x14c1b8013238) at /test/10.6_dbg/sql/sql_select.cc:5193
      #17 0x0000556cf47321e9 in handle_select (thd=thd@entry=0x14c1b8000d48, lex=lex@entry=0x14c1b8004e70, result=result@entry=0x14c1b8014a40, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.6_dbg/sql/sql_select.cc:573
      #18 0x0000556cf46ae6b2 in execute_sqlcom_select (thd=thd@entry=0x14c1b8000d48, all_tables=0x14c1b8013a40) at /test/10.6_dbg/sql/sql_parse.cc:6412
      #19 0x0000556cf46bac9f in mysql_execute_command (thd=thd@entry=0x14c1b8000d48, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.6_dbg/sql/sql_parse.cc:4004
      #20 0x0000556cf46a7dde in mysql_parse (thd=thd@entry=0x14c1b8000d48, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14c1ea1ae320) at /test/10.6_dbg/sql/sql_parse.cc:8199
      #21 0x0000556cf46b628b in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14c1b8000d48, packet=packet@entry=0x14c1b800ade9 "", packet_length=packet_length@entry=36, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_class.h:1419
      #22 0x0000556cf46b8997 in do_command (thd=thd@entry=0x14c1b8000d48, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_parse.cc:1422
      #23 0x0000556cf4809b95 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x556cf6c6e178, put_in_cache=put_in_cache@entry=true) at /test/10.6_dbg/sql/sql_connect.cc:1386
      #24 0x0000556cf480a063 in handle_one_connection (arg=0x556cf6c6e178) at /test/10.6_dbg/sql/sql_connect.cc:1298
      #25 0x000014c202b1a609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #26 0x000014c2026eb133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.5.28 (dbg), 10.6.21 (dbg), 10.11.11 (dbg), 11.4.5 (dbg), 11.7.1 (dbg), 11.8.0 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.5.28 (opt), 10.6.21 (opt), 10.11.11 (opt), 11.4.5 (opt), 11.7.1 (opt), 11.8.0 (opt)

      Attachments

        Activity

          People

            bar Alexander Barkov
            ramesh Ramesh Sivaraman
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.