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

Server crashes in TABLE::evaluate_update_default_function

    XMLWordPrintable

Details

    • Can result in hang or crash
    • Hide
      Fixes a bug where after a table is rebuilt (e.g. via ALTER TABLE .. FORCE), any fields which use ON UPDATE (e.g. TIMESTAMP and DATETIME) lose the update trigger after the ALTER. This bug caused a crash in 12.3 after MDEV-36290.
      Show
      Fixes a bug where after a table is rebuilt (e.g. via ALTER TABLE .. FORCE), any fields which use ON UPDATE (e.g. TIMESTAMP and DATETIME) lose the update trigger after the ALTER. This bug caused a crash in 12.3 after MDEV-36290 .
    • Q1/2026 Server Development

    Description

      CREATE TEMPORARY TABLE tmp (a timestamp null on update current_timestamp(6), b int);
      ALTER TABLE tmp FORCE;
      INSERT INTO tmp VALUES (NULL,1);
      UPDATE tmp SET b = 2;
      

      main 5bcc115d773caac07d4afd42252e08f3905452b0

      #4  <signal handler called>
      #5  0x000056156fd8eefa in TABLE::evaluate_update_default_function (this=this@entry=0x61900005a598) at /data/bld/main-asan-ubsan/sql/table.cc:9601
      #6  0x000056156f2c5bb5 in fill_record (thd=thd@entry=0x62c0000b0218, table_arg=table_arg@entry=0x61900005a598, fields=..., values=..., ignore_errors=ignore_errors@entry=false, update=update@entry=true) at /data/bld/main-asan-ubsan/sql/sql_base.cc:9275
      #7  0x000056156f2c6319 in fill_record_n_invoke_before_triggers (thd=thd@entry=0x62c0000b0218, table=table@entry=0x61900005a598, fields=..., values=..., ignore_errors=ignore_errors@entry=false, event=event@entry=TRG_EVENT_UPDATE, skip_row_indicator=0x7fe4c22e5da0) at /data/bld/main-asan-ubsan/sql/sql_base.cc:9455
      #8  0x000056156fd1a72d in Sql_cmd_update::update_single_table (this=this@entry=0x62d0000faeb8, thd=thd@entry=0x62c0000b0218) at /data/bld/main-asan-ubsan/sql/sql_update.cc:990
      #9  0x000056156fd22e8b in Sql_cmd_update::execute_inner (this=0x62d0000faeb8, thd=0x62c0000b0218) at /data/bld/main-asan-ubsan/sql/sql_update.cc:3224
      #10 0x000056156f841c8c in Sql_cmd_dml::execute (this=0x62d0000faeb8, thd=0x62c0000b0218) at /data/bld/main-asan-ubsan/sql/sql_select.cc:34842
      #11 0x000056156f6a3b64 in mysql_execute_command (thd=thd@entry=0x62c0000b0218, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /data/bld/main-asan-ubsan/sql/sql_parse.cc:4422
      #12 0x000056156f6be571 in mysql_parse (thd=thd@entry=0x62c0000b0218, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7fe4c22e7a10) at /data/bld/main-asan-ubsan/sql/sql_parse.cc:7945
      #13 0x000056156f6c7687 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x62c0000b0218, packet=packet@entry=0x6290002b2219 "UPDATE tmp SET b = 2", packet_length=packet_length@entry=20, blocking=blocking@entry=true) at /data/bld/main-asan-ubsan/sql/sql_parse.cc:1896
      #14 0x000056156f6d463b in do_command (thd=thd@entry=0x62c0000b0218, blocking=blocking@entry=true) at /data/bld/main-asan-ubsan/sql/sql_parse.cc:1432
      #15 0x000056156ff3b146 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x6080000082b8, put_in_cache=put_in_cache@entry=true) at /data/bld/main-asan-ubsan/sql/sql_connect.cc:1503
      #16 0x000056156ff3c2af in handle_one_connection (arg=0x6080000082b8) at /data/bld/main-asan-ubsan/sql/sql_connect.cc:1415
      #17 0x0000561571b99dc1 in pfs_spawn_thread (arg=0x617000007798) at /data/bld/main-asan-ubsan/storage/perfschema/pfs.cc:2198
      #18 0x00007fe4ce2a81c4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #19 0x00007fe4ce32885c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      The failure started happening after this commit in main:

      commit be237b3b0e30dbc2ec91246b7c5ed476e7bc0583
      Author:     Monty
      AuthorDate: Sat May 10 14:07:28 2025 +0300
      Commit:     Brandon Nesterenko
      CommitDate: Tue Jan 27 12:59:30 2026 -0700
       
          MDEV-36290: Improved support of replication between tables of different structure
      

      Attachments

        Issue Links

          Activity

            People

              bnestere Brandon Nesterenko
              elenst Elena Stepanova
              Brandon Nesterenko Brandon Nesterenko
              Michael Widenius Michael Widenius
              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.