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

Assertion marked_for_read() failed in Field_long::val_int on row comparison of NEW/OLD in AFTER trigger

    XMLWordPrintable

Details

    • Bug
    • Status: In Review (View Workflow)
    • Critical
    • Resolution: Unresolved
    • 13.2
    • 13.2
    • Triggers
    • Not for Release Notes
    • Q4/2026 Server Development

    Description

      CREATE TABLE t1 (a INT, b INT);
      INSERT INTO t1 VALUES (1,2);
      CREATE TRIGGER t1_au AFTER UPDATE ON t1 FOR EACH ROW SET @x = (NEW = OLD);
      UPDATE t1 SET a = 9;
      

      Leads to

      MDEV-34723 CS 13.2.0 89cc41d5c46e1e322148d861e2b13527a7dd6306 (Debug, Clang 18.1.3-11) Build 22/10/2026

      mariadbd: /test/mtest/MDEV-34723/bb-MDEV-34723-rucha_dbg/sql/field.cc:4664: virtual longlong Field_long::val_int(): Assertion `marked_for_read()' failed.
      

      MDEV-34723 CS 13.2.0 89cc41d5c46e1e322148d861e2b13527a7dd6306 (Debug, Clang 18.1.3-11) Build 22/10/2026

      Core was generated by `/test/mtest/MDEV-34723/MD221026-mariadb-13.2.0-linux-x86_64-dbg/bin/mariadbd --'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
       
      [Current thread is 1 (LWP 3020394)]
      (gdb) bt
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
      #1  __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
      #2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
      #3  0x0000789752a4527e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x0000789752a288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x0000789752a2881b in __assert_fail_base (fmt=0x789752bd1208 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x587dfac3d220 "marked_for_read()", file=file@entry=0x587dfac9cad0 "/test/mtest/MDEV-34723/bb-MDEV-34723-rucha_dbg/sql/field.cc", line=line@entry=4664, function=function@entry=0x587dfac9de4b "virtual longlong Field_long::val_int()") at ./assert/assert.c:96
      #6  0x0000789752a3b517 in __assert_fail (assertion=0x587dfac3d220 "marked_for_read()", file=0x587dfac9cad0 "/test/mtest/MDEV-34723/bb-MDEV-34723-rucha_dbg/sql/field.cc", line=4664, function=0x587dfac9de4b "virtual longlong Field_long::val_int()")at ./assert/assert.c:105
      #7  0x0000587df9eb63e7 in Field_long::val_int (this=0x70961c0326a0)at /test/mtest/MDEV-34723/bb-MDEV-34723-rucha_dbg/sql/field.cc:4664
      #8  0x0000587df9f1e8a5 in Item_field::val_int (this=0x70961c08ecc0)at /test/mtest/MDEV-34723/bb-MDEV-34723-rucha_dbg/sql/item.cc:3671
      #9  0x0000587df9f36774 in Item_trigger_field::val_int (this=0x70961c08ecc0)at /test/mtest/MDEV-34723/bb-MDEV-34723-rucha_dbg/sql/item.cc:11071
      #10 0x0000587df9f4e1b3 in Arg_comparator::compare_int_signed (this=0x70961c08f148)at /test/mtest/MDEV-34723/bb-MDEV-34723-rucha_dbg/sql/item_cmpfunc.cc:1028
      #11 0x0000587df9f68def in Arg_comparator::compare (this=0x70961c08f148)at /test/mtest/MDEV-34723/bb-MDEV-34723-rucha_dbg/sql/item_cmpfunc.h:114
      #12 0x0000587df9f4cc66 in Arg_comparator::compare_row (this=0x70961c07d828)at /test/mtest/MDEV-34723/bb-MDEV-34723-rucha_dbg/sql/item_cmpfunc.cc:1159
      #13 0x0000587df9f68def in Arg_comparator::compare (this=0x70961c07d828)at /test/mtest/MDEV-34723/bb-MDEV-34723-rucha_dbg/sql/item_cmpfunc.h:114
      #14 0x0000587df9f518c1 in Item_func_eq::val_bool (this=0x70961c07d760)at /test/mtest/MDEV-34723/bb-MDEV-34723-rucha_dbg/sql/item_cmpfunc.cc:1912
      #15 0x0000587df98e0c82 in Item_bool_func::val_int (this=0x70961c07d760)at /test/mtest/MDEV-34723/bb-MDEV-34723-rucha_dbg/sql/item_cmpfunc.h:245
      #16 0x0000587df9fa9c40 in Item_func_set_user_var::check (this=0x70961c07d9a0, use_result_field=false)at /test/mtest/MDEV-34723/bb-MDEV-34723-rucha_dbg/sql/item_func.cc:5225
      #17 0x0000587df990b347 in set_var_user::check (this=0x70961c07db10, thd=0x70961c000d60)at /test/mtest/MDEV-34723/bb-MDEV-34723-rucha_dbg/sql/set_var.cc:952
      #18 0x0000587df990ab60 in sql_set_variables (thd=0x70961c000d60, var_list=0x70961c089b58, free=true)at /test/mtest/MDEV-34723/bb-MDEV-34723-rucha_dbg/sql/set_var.cc:784
      #19 0x0000587df9a7ffe9 in mysql_execute_command (thd=0x70961c000d60, is_called_from_prepared_stmt=false)at /test/mtest/MDEV-34723/bb-MDEV-34723-rucha_dbg/sql/sql_parse.cc:4965
      #20 0x0000587df9d57eb7 in sp_instr_stmt::exec_core (this=0x70961c07db50, thd=0x70961c000d60, nextp=0x78972c532038)at /test/mtest/MDEV-34723/bb-MDEV-34723-rucha_dbg/sql/sp_instr.cc:1306
      #21 0x0000587df9d55316 in sp_lex_keeper::reset_lex_and_exec_core (this=0x70961c07db90, thd=0x70961c000d60, nextp=0x78972c532038, open_tables=false, instr=0x70961c07db50, rerun_the_same_instr=false)at /test/mtest/MDEV-34723/bb-MDEV-34723-rucha_dbg/sql/sp_instr.cc:420
      #22 0x0000587df9d55afc in sp_lex_keeper::validate_lex_and_exec_core (this=0x70961c07db90, thd=0x70961c000d60, nextp=0x78972c532038, open_tables=false, instr=0x70961c07db50)at /test/mtest/MDEV-34723/bb-MDEV-34723-rucha_dbg/sql/sp_instr.cc:624
      #23 0x0000587df9d57129 in sp_instr_stmt::execute (this=0x70961c07db50, thd=0x70961c000d60, nextp=0x78972c532038)at /test/mtest/MDEV-34723/bb-MDEV-34723-rucha_dbg/sql/sp_instr.cc:1208
      #24 0x0000587df993eaec in sp_head::execute (this=0x70961c07c290, thd=0x70961c000d60, merge_da_on_success=false)at /test/mtest/MDEV-34723/bb-MDEV-34723-rucha_dbg/sql/sp_head.cc:1347
      #25 0x0000587df9940a17 in sp_head::execute_trigger (this=0x70961c07c290, thd=0x70961c000d60, db_name=0x70961c07a028, table_name=0x70961c07a038, grant_info=0x70961c032f08)at /test/mtest/MDEV-34723/bb-MDEV-34723-rucha_dbg/sql/sp_head.cc:1863
      #26 0x0000587df9bd981c in Table_triggers_list::process_triggers (this=0x70961c032960, thd=0x70961c000d60, event=TRG_EVENT_UPDATE, time_type=TRG_ACTION_AFTER, old_row_is_record1=true, skip_row_indicator=0x0, fields_in_update_stmt=0x70961c005e40)at /test/mtest/MDEV-34723/bb-MDEV-34723-rucha_dbg/sql/sql_trigger.cc:2918
      #27 0x0000587df9bf55e0 in Sql_cmd_update::update_single_table (this=0x70961c01af40, thd=0x70961c000d60)at /test/mtest/MDEV-34723/bb-MDEV-34723-rucha_dbg/sql/sql_update.cc:1154
      #28 0x0000587df9bfd587 in Sql_cmd_update::execute_inner (this=0x70961c01af40, thd=0x70961c000d60)at /test/mtest/MDEV-34723/bb-MDEV-34723-rucha_dbg/sql/sql_update.cc:3320
      #29 0x0000587df9b46951 in Sql_cmd_dml::execute (this=0x70961c01af40, thd=0x70961c000d60)at /test/mtest/MDEV-34723/bb-MDEV-34723-rucha_dbg/sql/sql_select.cc:35131
      #30 0x0000587df9a7d926 in mysql_execute_command (thd=0x70961c000d60, is_called_from_prepared_stmt=false)at /test/mtest/MDEV-34723/bb-MDEV-34723-rucha_dbg/sql/sql_parse.cc:4493
      #31 0x0000587df9a73a84 in mysql_parse (thd=0x70961c000d60, rawbuf=0x70961c01a4d0 "UPDATE t1 SET a = 9", length=19, parser_state=0x78972c534a80)at /test/mtest/MDEV-34723/bb-MDEV-34723-rucha_dbg/sql/sql_parse.cc:8005
      #32 0x0000587df9a70e4d in dispatch_command (command=COM_QUERY, thd=0x70961c000d60, packet=0x70961c00b701 "UPDATE t1 SET a = 9", packet_length=19, blocking=true)at /test/mtest/MDEV-34723/bb-MDEV-34723-rucha_dbg/sql/sql_parse.cc:1903
      #33 0x0000587df9a74633 in do_command (thd=0x70961c000d60, blocking=true)at /test/mtest/MDEV-34723/bb-MDEV-34723-rucha_dbg/sql/sql_parse.cc:1437
      #34 0x0000587df9c7ad29 in do_handle_one_connection (connect=0x587e06c4a520, put_in_cache=true)at /test/mtest/MDEV-34723/bb-MDEV-34723-rucha_dbg/sql/sql_connect.cc:1514
      #35 0x0000587df9c7aace in handle_one_connection (arg=0x587e06d33d50)at /test/mtest/MDEV-34723/bb-MDEV-34723-rucha_dbg/sql/sql_connect.cc:1426
      #36 0x0000789752a9cb84 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #37 0x0000789752b29ecc in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Attachments

        Issue Links

          Activity

            People

              shulga Dmitry Shulga
              ramesh Ramesh Sivaraman
              Ramesh Sivaraman Ramesh Sivaraman
              Dmitry Shulga Dmitry Shulga
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 0d
                  0d
                  Remaining:
                  Time Spent - 0.5h Remaining Estimate - 2d
                  2d
                  Logged:
                  Time Spent - 0.5h Remaining Estimate - 2d
                  0.5h

                  Git Integration

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