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

Server crashes in Item_func_nextval::update_table after INSERT to the table, that uses expression with nextval() as default

    XMLWordPrintable

Details

    • Can result in hang or crash
    • Fixed crashing bug when inserting into a tables with several nextval(sequence) default values.
    • Q4/2025 Server Maintenance

    Description

      create sequence s;
      create table tt (id int default(nextval(s)+nextval(s)));
      insert tt values ();
       
      drop table t;
      

      250707 15:07:25 [ERROR] /12.0/bld/sql/mariadbd got signal 11 ;
       
      Server version: 12.0.1-MariaDB-asan-debug-log source revision: 107291bf980822fcc3c02bd4e01ecbc4db7fd192
       
      sql/signal_handler.cc:230(handle_fatal_signal)[0x5631d6c112e3]
      sigaction.c:0(__restore_rt)[0x7fb1a712f420]
      sql/item_func.h:4459(Item_func_nextval::update_table())[0x5631d6ddf8c0]
      sql/item_func.cc:7126(Item_func_nextval::val_int())[0x5631d6dcc9e7]
      sql/item_func.cc:1154(Item_func_plus::int_op())[0x5631d6d8e4aa]
      sql/item_func.h:931(Item_func_hybrid_field_type::val_int_from_int_op())[0x5631d69ab6b4]
      sql/sql_type.cc:5623(Type_handler_int_result::Item_func_hybrid_field_type_val_int(Item_func_hybrid_field_type*) const)[0x5631d697c204]
      sql/item_func.h:988(Item_func_hybrid_field_type::val_int())[0x5631d61bf606]
      sql/item.cc:7196(Item::save_int_in_field(Field*, bool))[0x5631d6caf041]
      sql/sql_type.cc:4453(Type_handler_int_result::Item_save_in_field(Item*, Field*, bool) const)[0x5631d6976288]
      sql/item.cc:7216(Item::save_in_field(Field*, bool))[0x5631d6caf377]
      sql/table.cc:9437(TABLE::update_default_fields(bool))[0x5631d66555e0]
      sql/sql_base.cc:9165(fill_record(THD*, TABLE*, List<Item>&, List<Item>&, bool, bool))[0x5631d6047f91]
      sql/sql_base.cc:9340(fill_record_n_invoke_before_triggers(THD*, TABLE*, List<Item>&, List<Item>&, bool, trg_event_type, bool*))[0x5631d6048e57]
      sql/sql_insert.cc:1127(mysql_insert(THD*, TABLE_LIST*, List<Item>&, List<List<Item> >&, List<Item>&, List<Item>&, enum_duplicates, bool, select_result*))[0x5631d61229d7]
      sql/sql_parse.cc:4459(mysql_execute_command(THD*, bool))[0x5631d6218833]
      sql/sql_parse.cc:7882(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x5631d6230afb]
      sql/sql_parse.cc:1879(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x5631d6206f12]
      sql/sql_parse.cc:1416(do_command(THD*, bool))[0x5631d6203bfc]
      sql/sql_connect.cc:1414(do_handle_one_connection(CONNECT*, bool))[0x5631d6724193]
      sql/sql_connect.cc:1328(handle_one_connection)[0x5631d6723ce6]
      perfschema/pfs.cc:2200(pfs_spawn_thread)[0x5631d747ebb2]
      nptl/pthread_create.c:478(start_thread)[0x7fb1a7123609]
       
      Query (0x62d0001904a8): insert tt values ()
      

      Attachments

        Issue Links

          Activity

            People

              monty Michael Widenius
              alice Alice Sherepa
              Votes:
              0 Vote for this issue
              Watchers:
              10 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.