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

Assertion `0' failed in Type_handler_row::Item_save_in_field on INSERT

    XMLWordPrintable

    Details

      Description

      SET sql_mode='';
      CREATE TABLE t (c1 INT,c2 INT) ENGINE=InnoDB;
      CREATE TRIGGER t BEFORE INSERT ON t FOR EACH ROW SET NEW.c1=(SELECT * FROM t);
      INSERT INTO t VALUES (0,0);
      

      Leads to:

      10.11.0 bc563f1a4b0b38de3b41fd0f0d3d8b7f1aacbd8b (Debug)

      mysqld: /test/10.11_dbg/sql/sql_type.h:4514: virtual int Type_handler_row::Item_save_in_field(Item*, Field*, bool) const: Assertion `0' failed.
      

      10.11.0 bc563f1a4b0b38de3b41fd0f0d3d8b7f1aacbd8b (Debug)

      Core was generated by `/test/MD190822-mariadb-10.11.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core'.
      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 0x148b51006700 (LWP 1390636))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x0000148b69d6b859 in __GI_abort () at abort.c:79
      #2  0x0000148b69d6b729 in __assert_fail_base (fmt=0x148b69f01588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x560426de7fd9 "0", file=0x560426c0bc60 "/test/10.11_dbg/sql/sql_type.h", line=4514, function=<optimized out>) at assert.c:92
      #3  0x0000148b69d7cfd6 in __GI___assert_fail (assertion=assertion@entry=0x560426de7fd9 "0", file=file@entry=0x560426c0bc60 "/test/10.11_dbg/sql/sql_type.h", line=line@entry=4514, function=function@entry=0x560426c88670 "virtual int Type_handler_row::Item_save_in_field(Item*, Field*, bool) const") at assert.c:101
      #4  0x0000560426261e5f in Type_handler_row::Item_save_in_field (this=<optimized out>, item=<optimized out>, field=<optimized out>, no_conversions=<optimized out>) at /test/10.11_dbg/sql/sql_type.h:4514
      #5  0x00005604263496c1 in Item::save_in_field (this=0x148b1402c170, field=0x148b14026810, no_conversions=<optimized out>) at /test/10.11_dbg/sql/item.cc:6852
      #6  0x000056042634ffed in Item_trigger_field::set_value (this=0x148b1402c340, thd=0x148b14000db8, it=<optimized out>) at /test/10.11_dbg/sql/item.cc:9928
      #7  0x0000560425f74b0d in Item_trigger_field::set_value (it=0x148b1402e1f0, thd=0x148b14000db8, this=<optimized out>) at /test/10.11_dbg/sql/item.h:6958
      #8  sp_instr_set_trigger_field::exec_core (this=0x148b1402e1b0, thd=0x148b14000db8, nextp=0x148b51004554) at /test/10.11_dbg/sql/sp_head.cc:4036
      #9  0x0000560425f82b74 in sp_lex_keeper::reset_lex_and_exec_core (this=0x148b1402e1f8, thd=0x148b14000db8, nextp=<optimized out>, open_tables=open_tables@entry=true, instr=<optimized out>) at /test/10.11_dbg/sql/sp_head.cc:3581
      #10 0x0000560425f83713 in sp_instr_set_trigger_field::execute (this=<optimized out>, thd=<optimized out>, nextp=<optimized out>) at /test/10.11_dbg/sql/sp_head.cc:4028
      #11 0x0000560425f7b22a in sp_head::execute (this=this@entry=0x148b1402a500, thd=thd@entry=0x148b14000db8, merge_da_on_success=merge_da_on_success@entry=false) at /test/10.11_dbg/sql/sp_head.cc:1458
      #12 0x0000560425f7c6f2 in sp_head::execute_trigger (this=0x148b1402a500, thd=thd@entry=0x148b14000db8, db_name=0x148b14036428, table_name=0x148b14036438, grant_info=grant_info@entry=0x148b1402a168) at /test/10.11_dbg/sql/sp_head.cc:1939
      #13 0x00005604261362a9 in Table_triggers_list::process_triggers (this=this@entry=0x148b14028330, thd=thd@entry=0x148b14000db8, event=event@entry=TRG_EVENT_INSERT, time_type=time_type@entry=TRG_ACTION_BEFORE, old_row_is_record1=old_row_is_record1@entry=true) at /test/10.11_dbg/sql/sql_trigger.cc:2474
      #14 0x0000560425fc762d in fill_record_n_invoke_before_triggers (thd=thd@entry=0x148b14000db8, table=table@entry=0x148b140345f8, ptr=0x148b140267f8, values=@0x148b14014888: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x148b14014920, last = 0x148b140149b0, elements = 2}, <No data fields>}, ignore_errors=ignore_errors@entry=false, event=event@entry=TRG_EVENT_INSERT) at /test/10.11_dbg/sql/sql_base.cc:9254
      #15 0x000056042600ade2 in mysql_insert (thd=thd@entry=0x148b14000db8, table_list=<optimized out>, fields=@0x148b14005ea8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x560427611c20 <end_of_list>, last = 0x148b14005ea8, elements = 0}, <No data fields>}, values_list=@0x148b14005ef0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x148b140149c0, last = 0x148b140149c0, elements = 1}, <No data fields>}, update_fields=@0x148b14005ed8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x560427611c20 <end_of_list>, last = 0x148b14005ed8, elements = 0}, <No data fields>}, update_values=@0x148b14005ec0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x560427611c20 <end_of_list>, last = 0x148b14005ec0, elements = 0}, <No data fields>}, duplic=DUP_ERROR, ignore=false, result=0x0) at /test/10.11_dbg/sql/sql_insert.cc:1089
      #16 0x000056042604d24c in mysql_execute_command (thd=thd@entry=0x148b14000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.11_dbg/sql/sql_parse.cc:4563
      #17 0x0000560426039882 in mysql_parse (thd=thd@entry=0x148b14000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x148b51005330) at /test/10.11_dbg/sql/sql_parse.cc:8035
      #18 0x0000560426046e6a in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x148b14000db8, packet=packet@entry=0x148b1400b6e9 "INSERT INTO t VALUES (0,0)", packet_length=packet_length@entry=26, blocking=blocking@entry=true) at /test/10.11_dbg/sql/sql_class.h:1339
      #19 0x0000560426049574 in do_command (thd=0x148b14000db8, blocking=blocking@entry=true) at /test/10.11_dbg/sql/sql_parse.cc:1407
      #20 0x00005604261ab1da in do_handle_one_connection (connect=<optimized out>, connect@entry=0x560429fdf8c8, put_in_cache=put_in_cache@entry=true) at /test/10.11_dbg/sql/sql_connect.cc:1418
      #21 0x00005604261ab6e3 in handle_one_connection (arg=0x560429fdf8c8) at /test/10.11_dbg/sql/sql_connect.cc:1312
      #22 0x0000148b6a27c609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #23 0x0000148b69e68133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.7.6 (dbg), 10.8.5 (dbg), 10.9.2 (dbg), 10.10.2 (dbg), 10.11.0 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.3.37 (dbg), 10.3.37 (opt), 10.4.27 (dbg), 10.4.27 (opt), 10.5.18 (dbg), 10.5.18 (opt), 10.6.10 (dbg), 10.6.10 (opt), 10.7.6 (opt), 10.8.5 (opt), 10.9.2 (opt), 10.10.2 (opt), 10.11.0 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.38 (dbg), 5.7.38 (opt), 8.0.29 (dbg), 8.0.29 (opt)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bar Alexander Barkov
              Reporter:
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.