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

handler::update_auto_increment(): Assertion `nr != 0' failed. | SIGABRT in handler::update_auto_increment

    XMLWordPrintable

    Details

      Description

      # mysqld options required for replay:  --sql_mode= 
      CREATE TABLE t (c INT AUTO_INCREMENT KEY);
      SET @@SESSION.insert_id=-0;  # Or -1, -2 etc.
      INSERT INTO t VALUES(0);
      

      Leads to:

      mysqld: /data/git/10.5_dbg/sql/handler.cc:3541: int handler::update_auto_increment(): Assertion `nr != 0' failed.
      

      Core was generated by `/data/MD180320-mariadb-10.5.2-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
          at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
      [Current thread is 1 (Thread 0x7fdd5b114700 (LWP 4790))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
      #1  0x00005621b7f597d4 in my_write_core (sig=sig@entry=6) at /data/git/10.5_dbg/mysys/stacktrace.c:518
      #2  0x00005621b7702b5f in handle_fatal_signal (sig=6) at /data/git/10.5_dbg/sql/signal_handler.cc:325
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
      #5  0x00007fdd59858801 in __GI_abort () at abort.c:79
      #6  0x00007fdd5984839a in __assert_fail_base (fmt=0x7fdd599cf7d8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x5621b826048b "nr != 0", file=file@entry=0x5621b82609e0 "/data/git/10.5_dbg/sql/handler.cc", line=line@entry=3541, function=function@entry=0x5621b8263fc0 <handler::update_auto_increment()::__PRETTY_FUNCTION__> "int handler::update_auto_increment()") at assert.c:92
      #7  0x00007fdd59848412 in __GI___assert_fail (assertion=assertion@entry=0x5621b826048b "nr != 0", file=file@entry=0x5621b82609e0 "/data/git/10.5_dbg/sql/handler.cc", line=line@entry=3541, function=function@entry=0x5621b8263fc0 <handler::update_auto_increment()::__PRETTY_FUNCTION__> "int handler::update_auto_increment()") at assert.c:101
      #8  0x00005621b770f10a in handler::update_auto_increment (this=this@entry=0x7fdd3182eca0) at /data/git/10.5_dbg/sql/handler.cc:3541
      #9  0x00005621b7ad1c32 in ha_innobase::write_row (this=0x7fdd3182eca0, record=0x7fdd318491a8 "\377") at /data/git/10.5_dbg/storage/innobase/handler/ha_innodb.cc:7710
      #10 0x00005621b77160b4 in handler::ha_write_row (this=0x7fdd3182eca0, buf=0x7fdd318491a8 "\377") at /data/git/10.5_dbg/sql/handler.cc:6798
      #11 0x00005621b741a9cd in write_record (thd=thd@entry=0x7fdd31815088, table=table@entry=0x7fdd318ee088, info=info@entry=0x7fdd5b112a80, sink=sink@entry=0x0) at /data/git/10.5_dbg/sql/sql_insert.cc:2055
      #12 0x00005621b74258bf in mysql_insert (thd=thd@entry=0x7fdd31815088, table_list=0x7fdd31874178, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_ERROR, ignore=false, result=0x0) at /data/git/10.5_dbg/sql/sql_insert.cc:1080
      #13 0x00005621b745cc50 in mysql_execute_command (thd=thd@entry=0x7fdd31815088) at /data/git/10.5_dbg/sql/sql_parse.cc:4507
      #14 0x00005621b74687a5 in mysql_parse (thd=thd@entry=0x7fdd31815088, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7fdd5b113450, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/git/10.5_dbg/sql/sql_parse.cc:7926
      #15 0x00005621b7454664 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7fdd31815088, packet=packet@entry=0x7fdd31867089 "INSERT INTO t VALUES(0)", packet_length=packet_length@entry=23, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/git/10.5_dbg/sql/sql_parse.cc:1839
      #16 0x00005621b7452eaf in do_command (thd=0x7fdd31815088) at /data/git/10.5_dbg/sql/sql_parse.cc:1358
      #17 0x00005621b75aca09 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x7fdd3762b3a8, put_in_cache=put_in_cache@entry=true) at /data/git/10.5_dbg/sql/sql_connect.cc:1422
      #18 0x00005621b75acd38 in handle_one_connection (arg=arg@entry=0x7fdd3762b3a8) at /data/git/10.5_dbg/sql/sql_connect.cc:1319
      #19 0x00005621b7a09cfc in pfs_spawn_thread (arg=0x7fdd58c45888) at /data/git/10.5_dbg/storage/perfschema/pfs.cc:2201
      #20 0x00007fdd5a53b6db in start_thread (arg=0x7fdd5b114700) at pthread_create.c:463
      #21 0x00007fdd5993988f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.2.32 (dbg), 10.3.23 (dbg), 10.4.13 (dbg), 10.5.2 (dbg)

      Bug confirmed not present in:
      MariaDB: 10.1.45 (dbg), 10.1.45 (opt), 10.2.32 (opt), 10.3.23 (opt), 10.4.13 (opt), 10.5.2 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.47 (dbg), 5.6.47 (opt), 5.7.29 (dbg), 5.7.29 (opt), 8.0.19 (dbg), 8.0.19 (opt)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sanja Oleksandr Byelkin
              Reporter:
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated: