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

Assertion `next_insert_id >= auto_inc_interval_for_cur_row.minimum()' failed in handler::update_auto_increment

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL)
    • N/A
    • N/A
    • None

    Description

      Also see MDEV-24613, MDEV-24038, MDEV-15800 which all seem to be different from this issue which requires sql_mode changes.

      CREATE TABLE t (a INT AUTO_INCREMENT KEY) ENGINE=InnoDB;
      SET sql_mode='no_auto_value_on_zero';
      INSERT INTO t VALUES ('a,b,c,d');
      SET sql_mode='no_unsigned_subtraction';
      INSERT INTO t VALUES (REPEAT ('1',200));
      INSERT IGNORE INTO t SELECT a FROM t AS t2 ON DUPLICATE KEY UPDATE a=t.a+1;
      

      Leads to:

      10.8.1 0c5d1342ae6b5ab3256848be7a83e5c3b1f21566 (Debug)

      mysqld: /test/10.8_dbg/sql/handler.cc:3850: int handler::update_auto_increment(): Assertion `next_insert_id >= auto_inc_interval_for_cur_row.minimum()' failed.
      

      10.8.1 0c5d1342ae6b5ab3256848be7a83e5c3b1f21566 (Debug)

      Core was generated by `/test/MD290122-mariadb-10.8.1-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 0x1472c813b700 (LWP 88051))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x00001472d1d9f859 in __GI_abort () at abort.c:79
      #2  0x00001472d1d9f729 in __assert_fail_base (fmt=0x1472d1f35588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x562640b6f2d8 "next_insert_id >= auto_inc_interval_for_cur_row.minimum()", file=0x562640b6cee3 "/test/10.8_dbg/sql/handler.cc", line=3850, function=<optimized out>) at assert.c:92
      #3  0x00001472d1db0f36 in __GI___assert_fail (assertion=assertion@entry=0x562640b6f2d8 "next_insert_id >= auto_inc_interval_for_cur_row.minimum()", file=file@entry=0x562640b6cee3 "/test/10.8_dbg/sql/handler.cc", line=line@entry=3850, function=function@entry=0x562640b6f318 "int handler::update_auto_increment()") at assert.c:101
      #4  0x000056264001323b in handler::update_auto_increment (this=this@entry=0x147244028c50) at /test/10.8_dbg/sql/structs.h:418
      #5  0x00005626403cd42b in ha_innobase::write_row (this=0x147244028c50, record=0x1472440287c8 "\377\377\377\377\177", '\245' <repeats 11 times>, "\020\210\002Dr\024") at /test/10.8_dbg/storage/innobase/handler/ha_innodb.cc:7740
      #6  0x000056264001b865 in handler::ha_write_row (this=0x147244028c50, buf=0x1472440287c8 "\377\377\377\377\177", '\245' <repeats 11 times>, "\020\210\002Dr\024") at /test/10.8_dbg/sql/handler.cc:7519
      #7  0x000056263fcb2274 in write_record (thd=0x147244000db8, table=0x147244028378, info=info@entry=0x147244015f68, sink=0x0) at /test/10.8_dbg/sql/sql_insert.cc:1833
      #8  0x000056263fcb338b in select_insert::send_data (this=0x147244015f18, values=<optimized out>) at /test/10.8_dbg/sql/sql_insert.cc:4112
      #9  0x000056263fd7b18f in select_result_sink::send_data_with_check (sent=<optimized out>, u=<optimized out>, items=@0x1472440163a0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1472440726c8, last = 0x1472440726c8, elements = 1}, <No data fields>}, this=<optimized out>) at /test/10.8_dbg/sql/sql_class.h:5612
      #10 end_send (join=0x147244015fd8, join_tab=0x147244017a00, end_of_records=<optimized out>) at /test/10.8_dbg/sql/sql_select.cc:22313
      #11 0x000056263fd4ac1b in evaluate_join_record (join=join@entry=0x147244015fd8, join_tab=0x147244017650, error=error@entry=0) at /test/10.8_dbg/sql/sql_select.cc:21306
      #12 0x000056263fd8bab3 in AGGR_OP::end_send (this=this@entry=0x1472440725a0) at /test/10.8_dbg/sql/sql_select.cc:29542
      #13 0x000056263fd8bdb2 in sub_select_postjoin_aggr (join=0x147244015fd8, join_tab=0x147244017650, end_of_records=<optimized out>) at /test/10.8_dbg/sql/sql_select.cc:20786
      #14 0x000056263fd60bf7 in sub_select (join=0x147244015fd8, join_tab=0x1472440172a0, end_of_records=<optimized out>) at /test/10.8_dbg/sql/sql_select.cc:21020
      #15 0x000056263fd98f58 in do_select (procedure=<optimized out>, join=0x147244015fd8) at /test/10.8_dbg/sql/sql_select.cc:20623
      #16 JOIN::exec_inner (this=this@entry=0x147244015fd8) at /test/10.8_dbg/sql/sql_select.cc:4733
      #17 0x000056263fd994ce in JOIN::exec (this=this@entry=0x147244015fd8) at /test/10.8_dbg/sql/sql_select.cc:4511
      #18 0x000056263fd974df in mysql_select (thd=thd@entry=0x147244000db8, tables=0x147244014bf8, fields=@0x1472440148a8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x147244014ba0, last = 0x147244014ba0, elements = 1}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2202244745984, result=0x147244015f18, unit=0x1472440051c8, select_lex=0x147244014608) at /test/10.8_dbg/sql/sql_select.cc:4991
      #19 0x000056263fd97794 in handle_select (thd=thd@entry=0x147244000db8, lex=lex@entry=0x1472440050f0, result=result@entry=0x147244015f18, setup_tables_done_option=setup_tables_done_option@entry=1073741824) at /test/10.8_dbg/sql/sql_select.cc:543
      #20 0x000056263fd05b66 in mysql_execute_command (thd=thd@entry=0x147244000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.8_dbg/sql/sql_parse.cc:4708
      #21 0x000056263fcefdb7 in mysql_parse (thd=thd@entry=0x147244000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1472c813a400) at /test/10.8_dbg/sql/sql_parse.cc:8027
      #22 0x000056263fcfea53 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x147244000db8, packet=packet@entry=0x14724400b889 "INSERT IGNORE INTO t SELECT a FROM t AS t2 ON DUPLICATE KEY UPDATE a=t.a+1", packet_length=packet_length@entry=74, blocking=blocking@entry=true) at /test/10.8_dbg/sql/sql_class.h:1362
      #23 0x000056263fd01e9a in do_command (thd=0x147244000db8, blocking=blocking@entry=true) at /test/10.8_dbg/sql/sql_parse.cc:1402
      #24 0x000056263fe7d110 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5626436e6118, put_in_cache=put_in_cache@entry=true) at /test/10.8_dbg/sql/sql_connect.cc:1418
      #25 0x000056263fe7d715 in handle_one_connection (arg=arg@entry=0x5626436e6118) at /test/10.8_dbg/sql/sql_connect.cc:1312
      #26 0x0000562640306c8e in pfs_spawn_thread (arg=0x5626435f9f48) at /test/10.8_dbg/storage/perfschema/pfs.cc:2201
      #27 0x00001472d22ae609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #28 0x00001472d1e9c293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.2.42 (dbg), 10.3.33 (dbg), 10.4.23 (dbg), 10.5.14 (dbg), 10.6.6 (dbg), 10.7.2 (dbg), 10.8.1 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.2.42 (opt), 10.3.33 (opt), 10.4.23 (opt), 10.5.14 (opt), 10.6.6 (opt), 10.7.2 (opt), 10.8.1 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.36 (dbg), 5.7.36 (opt), 8.0.27 (dbg), 8.0.27 (opt)

      Attachments

        Issue Links

          Activity

            Not sure what this note in the description means

            this issue which requires optimizer switches

            as there are no optimizer switches in the test case.
            There are changes to sql_mode, which implicitly achieve the same precondition as in MDEV-24038 – overflowing auto-increment – which is followed by ODKU. All in all, it is the exact same scenario as in MDEV-24038.

            elenst Elena Stepanova added a comment - Not sure what this note in the description means this issue which requires optimizer switches as there are no optimizer switches in the test case. There are changes to sql_mode , which implicitly achieve the same precondition as in MDEV-24038 – overflowing auto-increment – which is followed by ODKU. All in all, it is the exact same scenario as in MDEV-24038 .

            Typo corrected, agreed, and closed as duplicate.

            Roel Roel Van de Paar added a comment - Typo corrected, agreed, and closed as duplicate.

            People

              psergei Sergei Petrunia
              Roel Roel Van de Paar
              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.