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

Crash when using "SET @@NEW.a=expr" inside a trigger

    XMLWordPrintable

Details

    • 10.3.6-1

    Description

      The server crashes when running this script:

      CREATE OR REPLACE TABLE t1 (a INT);
      CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET @@NEW.a=0;
      INSERT INTO t1 VALUES (1);
      

      The expected behavior would be to return "Unknown system variable NEW".

      5.5 0943b33de3

      #3  <signal handler called>
      #4  0x000000000056e0c9 in sys_var::do_deprecated_warning (this=0x1, thd=0x7f126766e060) at /data/src/5.5/sql/set_var.cc:269
      #5  0x000000000056e88e in set_var::check (this=0x7f1266199e08, thd=0x7f126766e060) at /data/src/5.5/sql/set_var.cc:594
      #6  0x000000000056e783 in sql_set_variables (thd=0x7f126766e060, var_list=0x7f1266180e08) at /data/src/5.5/sql/set_var.cc:563
      #7  0x00000000006032d2 in mysql_execute_command (thd=0x7f126766e060) at /data/src/5.5/sql/sql_parse.cc:3246
      #8  0x00000000008e0db4 in sp_instr_stmt::exec_core (this=0x7f1266199e58, thd=0x7f126766e060, nextp=0x7f126d3957f8) at /data/src/5.5/sql/sp_head.cc:3220
      #9  0x00000000008e055b in sp_lex_keeper::reset_lex_and_exec_core (this=0x7f1266199e98, thd=0x7f126766e060, nextp=0x7f126d3957f8, open_tables=false, instr=0x7f1266199e58) at /data/src/5.5/sql/sp_head.cc:2998
      #10 0x00000000008e0adc in sp_instr_stmt::execute (this=0x7f1266199e58, thd=0x7f126766e060, nextp=0x7f126d3957f8) at /data/src/5.5/sql/sp_head.cc:3144
      #11 0x00000000008dc945 in sp_head::execute (this=0x7f1266198078, thd=0x7f126766e060, merge_da_on_success=false) at /data/src/5.5/sql/sp_head.cc:1431
      #12 0x00000000008dd423 in sp_head::execute_trigger (this=0x7f1266198078, thd=0x7f126766e060, db_name=0x7f12660591a8, table_name=0x7f12660591b8, grant_info=0x7f1266060728) at /data/src/5.5/sql/sp_head.cc:1736
      #13 0x00000000006acd66 in Table_triggers_list::process_triggers (this=0x7f1266060678, thd=0x7f126766e060, event=TRG_EVENT_INSERT, time_type=TRG_ACTION_BEFORE, old_row_is_record1=true) at /data/src/5.5/sql/sql_trigger.cc:2156
      #14 0x00000000005af789 in fill_record_n_invoke_before_triggers (thd=0x7f126766e060, ptr=0x7f1267641288, values=..., ignore_errors=false, triggers=0x7f1266060678, event=TRG_EVENT_INSERT) at /data/src/5.5/sql/sql_base.cc:9234
      #15 0x00000000005e3e39 in mysql_insert (thd=0x7f126766e060, table_list=0x7f1266148158, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_ERROR, ignore=false) at /data/src/5.5/sql/sql_insert.cc:952
      #16 0x00000000006024e4 in mysql_execute_command (thd=0x7f126766e060) at /data/src/5.5/sql/sql_parse.cc:2965
      #17 0x000000000060a1fe in mysql_parse (thd=0x7f126766e060, rawbuf=0x7f1266148078 "INSERT INTO t1 VALUES (1)", length=25, parser_state=0x7f126d396640) at /data/src/5.5/sql/sql_parse.cc:5923
      #18 0x00000000005fdf13 in dispatch_command (command=COM_QUERY, thd=0x7f126766e060, packet=0x7f126b35b061 "INSERT INTO t1 VALUES (1)", packet_length=25) at /data/src/5.5/sql/sql_parse.cc:1066
      #19 0x00000000005fd105 in do_command (thd=0x7f126766e060) at /data/src/5.5/sql/sql_parse.cc:793
      #20 0x000000000070024f in do_handle_one_connection (thd_arg=0x7f126766e060) at /data/src/5.5/sql/sql_connect.cc:1268
      #21 0x00000000006fffdc in handle_one_connection (arg=0x7f126766e060) at /data/src/5.5/sql/sql_connect.cc:1184
      #22 0x0000000000a0e071 in pfs_spawn_thread (arg=0x7f1268376fc0) at /data/src/5.5/storage/perfschema/pfs.cc:1015
      #23 0x00007f126d012494 in start_thread (arg=0x7f126d397700) at pthread_create.c:333
      #24 0x00007f126ba2893f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      Attachments

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.