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

Assertion `llabs(next_free_value % real_increment) == offset' failed in sequence_definition::adjust_values

    XMLWordPrintable

    Details

      Description

      See also MDEV-16313 and MDEV-13005

      SET GLOBAL auto_increment_increment=3;
      CREATE SEQUENCE s START WITH -3 MINVALUE=-1000 INCREMENT 0;
      

      Leads to:

      10.5.4 8569dac1ec9f6853a0b2f3ea9bcbda67644ead24

      mysqld: /test/10.5_dbg/sql/sql_sequence.cc:569: void sequence_definition::adjust_values(longlong): Assertion `llabs(next_free_value % real_increment) == offset' failed.
      

      10.5.4 8569dac1ec9f6853a0b2f3ea9bcbda67644ead24

      Core was generated by `/test/MD260520-mariadb-10.5.4-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 0x149bf475e700 (LWP 1417077))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
      #1  0x000055b7948a3d7a in my_write_core (sig=sig@entry=6) at /test/10.5_dbg/mysys/stacktrace.c:518
      #2  0x000055b794049385 in handle_fatal_signal (sig=6) at /test/10.5_dbg/sql/signal_handler.cc:330
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
      #5  0x0000149bf2ea2801 in __GI_abort () at abort.c:79
      #6  0x0000149bf2e9239a in __assert_fail_base (fmt=0x149bf30197d8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x55b794a86a58 "llabs(next_free_value % real_increment) == offset", file=file@entry=0x55b794a86a00 "/test/10.5_dbg/sql/sql_sequence.cc", line=line@entry=569, function=function@entry=0x55b794a86e40 <sequence_definition::adjust_values(long long)::__PRETTY_FUNCTION__> "void sequence_definition::adjust_values(longlong)") at assert.c:92
      #7  0x0000149bf2e92412 in __GI___assert_fail (assertion=assertion@entry=0x55b794a86a58 "llabs(next_free_value % real_increment) == offset", file=file@entry=0x55b794a86a00 "/test/10.5_dbg/sql/sql_sequence.cc", line=line@entry=569, function=function@entry=0x55b794a86e40 <sequence_definition::adjust_values(long long)::__PRETTY_FUNCTION__> "void sequence_definition::adjust_values(longlong)") at assert.c:101
      #8  0x000055b793fa065d in sequence_definition::adjust_values (this=this@entry=0x149bd18748b8, next_value=<optimized out>) at /test/10.5_dbg/sql/sql_sequence.cc:569
      #9  0x000055b793fa0727 in sequence_definition::check_and_adjust (this=0x149bd18748b8, set_reserved_until=set_reserved_until@entry=true) at /test/10.5_dbg/sql/sql_sequence.cc:112
      #10 0x000055b793fb831b in MYSQLparse (thd=thd@entry=0x149bd1815088) at /test/10.5_dbg/sql/sql_yacc.yy:2347
      #11 0x000055b793db18b0 in parse_sql (thd=thd@entry=0x149bd1815088, parser_state=parser_state@entry=0x149bf475d3d0, creation_ctx=creation_ctx@entry=0x0, do_pfs_digest=do_pfs_digest@entry=true) at /test/10.5_dbg/sql/sql_parse.cc:10297
      #12 0x000055b793dabe34 in mysql_parse (thd=thd@entry=0x149bd1815088, rawbuf=<optimized out>, length=58, parser_state=parser_state@entry=0x149bf475d3d0, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:7944
      #13 0x000055b793d98b42 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x149bd1815088, packet=packet@entry=0x149bd1867089 "CREATE SEQUENCE s START WITH -3 MINVALUE=-1000 INCREMENT 0", packet_length=packet_length@entry=58, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:1874
      #14 0x000055b793d9731c in do_command (thd=0x149bd1815088) at /test/10.5_dbg/sql/sql_parse.cc:1355
      #15 0x000055b793ef173f in do_handle_one_connection (connect=<optimized out>, connect@entry=0x149bd34453a8, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1411
      #16 0x000055b793ef1e5b in handle_one_connection (arg=arg@entry=0x149bd34453a8) at /test/10.5_dbg/sql/sql_connect.cc:1313
      #17 0x000055b79435114e in pfs_spawn_thread (arg=0x149bf2445888) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
      #18 0x0000149bf3b856db in start_thread (arg=0x149bf475e700) at pthread_create.c:463
      #19 0x0000149bf2f8388f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.3.24 (dbg), 10.4.14 (dbg), 10.5.4 (dbg)

      Bug confirmed not present in:
      MariaDB: 10.1.46 (dbg), 10.1.46 (opt), 10.2.33 (dbg), 10.2.33 (opt), 10.3.24 (opt), 10.4.14 (opt), 10.5.4 (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:
              2 Start watching this issue

                Dates

                Created:
                Updated: