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

Assertion `next_free_value % real_increment == offset && next_free_value >= reserved_until' failed in sequence_definition::adjust_values upon SETVAL for sequence with INCREMENT 0

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 10.3(EOL)
    • 10.3.7
    • Sequences
    • None

    Description

      CREATE SEQUENCE s INCREMENT 0;
      SELECT NEXTVAL(s);
      SELECT SETVAL(s, 10);
       
      # Cleanup
      DROP SEQUENCE s;
      

      10.3 560743198604

      #7  0x00007f590f9acee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x000055a29d18d889 in sequence_definition::adjust_values (this=0x7f58f8006a98, next_value=11) at /data/src/10.3/sql/sql_sequence.cc:563
      #9  0x000055a29d18e237 in SEQUENCE::set_value (this=0x7f58f8006a98, table=0x7f58f800e420, next_val=11, next_round=0, is_used=true) at /data/src/10.3/sql/sql_sequence.cc:843
      #10 0x000055a29d3053a5 in Item_func_setval::val_int (this=0x7f58f8015490) at /data/src/10.3/sql/item_func.cc:6926
      #11 0x000055a29d1754ad in Type_handler::Item_send_longlong (this=0x55a29e6fa350 <type_handler_longlong>, item=0x7f58f8015490, protocol=0x7f58f80010e8, buf=0x7f5909b519c0) at /data/src/10.3/sql/sql_type.cc:5302
      #12 0x000055a29d1797a8 in Type_handler_longlong::Item_send (this=0x55a29e6fa350 <type_handler_longlong>, item=0x7f58f8015490, protocol=0x7f58f80010e8, buf=0x7f5909b519c0) at /data/src/10.3/sql/sql_type.h:2232
      #13 0x000055a29ce8e9e0 in Item::send (this=0x7f58f8015490, protocol=0x7f58f80010e8, buffer=0x7f5909b519c0) at /data/src/10.3/sql/item.h:827
      #14 0x000055a29ce89d20 in Protocol::send_result_set_row (this=0x7f58f80010e8, row_items=0x7f58f80051e8) at /data/src/10.3/sql/protocol.cc:986
      #15 0x000055a29cf301a4 in select_send::send_data (this=0x7f58f8015680, items=...) at /data/src/10.3/sql/sql_class.cc:2997
      #16 0x000055a29cfda9d6 in JOIN::exec_inner (this=0x7f58f80156a0) at /data/src/10.3/sql/sql_select.cc:3828
      #17 0x000055a29cfda434 in JOIN::exec (this=0x7f58f80156a0) at /data/src/10.3/sql/sql_select.cc:3747
      #18 0x000055a29cfdb675 in mysql_select (thd=0x7f58f8000b00, tables=0x0, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f58f8015680, unit=0x7f58f8004948, select_lex=0x7f58f80050c0) at /data/src/10.3/sql/sql_select.cc:4152
      #19 0x000055a29cfcdbcf in handle_select (thd=0x7f58f8000b00, lex=0x7f58f8004880, result=0x7f58f8015680, setup_tables_done_option=0) at /data/src/10.3/sql/sql_select.cc:382
      #20 0x000055a29cf990c7 in execute_sqlcom_select (thd=0x7f58f8000b00, all_tables=0x7f58f8014e38) at /data/src/10.3/sql/sql_parse.cc:6539
      #21 0x000055a29cf8f828 in mysql_execute_command (thd=0x7f58f8000b00) at /data/src/10.3/sql/sql_parse.cc:3768
      #22 0x000055a29cf9cad8 in mysql_parse (thd=0x7f58f8000b00, rawbuf=0x7f58f8014d58 "SELECT SETVAL(s, 10)", length=20, parser_state=0x7f5909b535d0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:8001
      #23 0x000055a29cf8a2bb in dispatch_command (command=COM_QUERY, thd=0x7f58f8000b00, packet=0x7f58f808ff81 "", packet_length=20, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1846
      #24 0x000055a29cf88cfa in do_command (thd=0x7f58f8000b00) at /data/src/10.3/sql/sql_parse.cc:1391
      #25 0x000055a29d0eb78b in do_handle_one_connection (connect=0x55a2a0ab4220) at /data/src/10.3/sql/sql_connect.cc:1402
      #26 0x000055a29d0eb518 in handle_one_connection (arg=0x55a2a0ab4220) at /data/src/10.3/sql/sql_connect.cc:1308
      #27 0x000055a29d56eb43 in pfs_spawn_thread (arg=0x55a2a0b76690) at /data/src/10.3/storage/perfschema/pfs.cc:1862
      #28 0x00007f5911683494 in start_thread (arg=0x7f5909b54700) at pthread_create.c:333
      #29 0x00007f590fa6993f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      No visible effect on a non-debug build.

      Attachments

        Activity

          elenst Elena Stepanova created issue -
          elenst Elena Stepanova made changes -
          Field Original Value New Value
          Attachment threads [ 45417 ]
          elenst Elena Stepanova made changes -
          Fix Version/s 10.3 [ 22126 ]
          elenst Elena Stepanova made changes -
          Comment [ New occurrence on 10.3: https://api.travis-ci.org/v3/job/338563255/log.txt ]
          elenst Elena Stepanova made changes -
          Attachment threads [ 45417 ]
          elenst Elena Stepanova made changes -
          Summary [Draft] Assertion `next_free_value % real_increment == offset && next_free_value >= reserved_until' failed Assertion `next_free_value % real_increment == offset && next_free_value >= reserved_until' failed in sequence_definition::adjust_values upon SETVAL for sequence with INCREMENT 0
          elenst Elena Stepanova made changes -
          Fix Version/s 10.3 [ 22126 ]
          Assignee Elena Stepanova [ elenst ] Michael Widenius [ monty ]
          Description https://api.travis-ci.org/v3/job/359590438/log.txt
          {noformat:title=10.3 b81a403e69feadc9896893ddcddc35e8a1f26cec}
          mysqld: /home/travis/src/sql/sql_sequence.cc:531: void sequence_definition::adjust_values(longlong): Assertion `next_free_value % real_increment == offset && next_free_value >= reserved_until' failed.
          180329 3:52:50 [ERROR] mysqld got signal 6 ;

          Query (0x7fa7e8013a88): SELECT SETVAL(seq1, 108) /* QNO 25407 CON_ID 18 */
          Connection ID (thread ID): 18
          Status: NOT_KILLED
          {noformat}
          {noformat}
          #7 0x00007fa84462bca2 in __GI___assert_fail (assertion=0x559fb7719220 "next_free_value % real_increment == offset && next_free_value >= reserved_until", file=0x559fb77190c8 "/home/travis/src/sql/sql_sequence.cc", line=531, function=0x559fb7719460 <sequence_definition::adjust_values(long long)::__PRETTY_FUNCTION__> "void sequence_definition::adjust_values(longlong)") at assert.c:101
          #8 0x0000559fb6d5bb7b in sequence_definition::adjust_values (this=0x7fa7f018a478, next_value=109) at /home/travis/src/sql/sql_sequence.cc:530
          #9 0x0000559fb6d5c525 in SEQUENCE::set_value (this=0x7fa7f018a478, table=0x7fa7d8513e90, next_val=109, next_round=0, is_used=true) at /home/travis/src/sql/sql_sequence.cc:810
          #10 0x0000559fb6ed7d15 in Item_func_setval::val_int (this=0x7fa7e8014200) at /home/travis/src/sql/item_func.cc:6926
          #11 0x0000559fb6d43679 in Type_handler::Item_send_longlong (this=0x559fb829ca50 <type_handler_longlong>, item=0x7fa7e8014200, protocol=0x7fa7e8001258, buf=0x7fa84048a650) at /home/travis/src/sql/sql_type.cc:5342
          #12 0x0000559fb6d47852 in Type_handler_longlong::Item_send (this=0x559fb829ca50 <type_handler_longlong>, item=0x7fa7e8014200, protocol=0x7fa7e8001258, buf=0x7fa84048a650) at /home/travis/src/sql/sql_type.h:2232
          #13 0x0000559fb6a5693c in Item::send (this=0x7fa7e8014200, protocol=0x7fa7e8001258, buffer=0x7fa84048a650) at /home/travis/src/sql/item.h:827
          #14 0x0000559fb6a51c4a in Protocol::send_result_set_row (this=0x7fa7e8001258, row_items=0x7fa7e8005348) at /home/travis/src/sql/protocol.cc:986
          #15 0x0000559fb6af7b7e in select_send::send_data (this=0x7fa7e8014400, items=...) at /home/travis/src/sql/sql_class.cc:3022
          #16 0x0000559fb6ba14fe in JOIN::exec_inner (this=0x7fa7e8014420) at /home/travis/src/sql/sql_select.cc:3862
          #17 0x0000559fb6ba0f5c in JOIN::exec (this=0x7fa7e8014420) at /home/travis/src/sql/sql_select.cc:3781
          #18 0x0000559fb6ba21d0 in mysql_select (thd=0x7fa7e8000c70, tables=0x0, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=551912999680, result=0x7fa7e8014400, unit=0x7fa7e8004aa8, select_lex=0x7fa7e8005220) at /home/travis/src/sql/sql_select.cc:4186
          #19 0x0000559fb6b944a3 in handle_select (thd=0x7fa7e8000c70, lex=0x7fa7e80049e0, result=0x7fa7e8014400, setup_tables_done_option=0) at /home/travis/src/sql/sql_select.cc:382
          #20 0x0000559fb6b5f610 in execute_sqlcom_select (thd=0x7fa7e8000c70, all_tables=0x7fa7e8013ba8) at /home/travis/src/sql/sql_parse.cc:6556
          #21 0x0000559fb6b55c7c in mysql_execute_command (thd=0x7fa7e8000c70) at /home/travis/src/sql/sql_parse.cc:3770
          #22 0x0000559fb6b62fe4 in mysql_parse (thd=0x7fa7e8000c70, rawbuf=0x7fa7e8013a88 "SELECT SETVAL(seq1, 108) /* QNO 25407 CON_ID 18 */", length=50, parser_state=0x7fa84048c5e0, is_com_multi=false, is_next_command=false) at /home/travis/src/sql/sql_parse.cc:8013
          #23 0x0000559fb6b506da in dispatch_command (command=COM_QUERY, thd=0x7fa7e8000c70, packet=0x7fa7e800b2c1 "", packet_length=51, is_com_multi=false, is_next_command=false) at /home/travis/src/sql/sql_parse.cc:1842
          #24 0x0000559fb6b4f126 in do_command (thd=0x7fa7e8000c70) at /home/travis/src/sql/sql_parse.cc:1387
          #25 0x0000559fb6cb43b1 in do_handle_one_connection (connect=0x559fb9c2d750) at /home/travis/src/sql/sql_connect.cc:1402
          #26 0x0000559fb6cb413e in handle_one_connection (arg=0x559fb9c2d750) at /home/travis/src/sql/sql_connect.cc:1308
          #27 0x00007fa8451ed184 in start_thread (arg=0x7fa84048d700) at pthread_create.c:312
          #28 0x00007fa8446fa03d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
          {noformat}

          {noformat:title=experimental 82d67e4315d8575501bed9fc4efdb44b047fecf4}
          perl /home/travis/rqg/runall-new.pl --duration=350 --threads=6 --seed=1522295413 --reporters=Backtrace,ErrorLog,Deadlock --validators=TransformerNoComparator --views --redefine=conf/mariadb/versioning.yy --redefine=conf/mariadb/alter_table.yy --redefine=conf/mariadb/bulk_insert.yy --redefine=conf/mariadb/sequences.yy --redefine=conf/mariadb/xa.yy --basedir=/home/travis/server --mysqld=--log_output=FILE --mysqld=--max-statement-time=30 --mysqld=--lock-wait-timeout=10 --mysqld=--loose-innodb-lock-wait-timeout=5 --mysqld=--loose-debug_assert_on_not_freed_memory=0 --mysqld=--default-storage-engine=Aria --grammar=conf/mariadb/functions.yy --skip-gendata --gendata-advanced --vcols --transformers=ExecuteAsCTE,ExecuteAsDeleteReturning,ExecuteAsExcept,ExecuteAsExecuteImmediate,ExecuteAsInsertSelect,ExecuteAsIntersect,ExecuteAsUnion,ExecuteAsUpdateDelete,ExecuteAsView,ExecuteAsPreparedTwice,ExecuteAsSPTwice --vardir=/home/travis/logs/vardir1_2
          {noformat}

          Not reproducible right away
          {code:sql}
          CREATE SEQUENCE s INCREMENT 0;
          SELECT NEXTVAL(s);
          SELECT SETVAL(s, 10);

          # Cleanup
          DROP SEQUENCE s;
          {code}
          {noformat:title=10.3 560743198604}
          #7 0x00007f590f9acee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
          #8 0x000055a29d18d889 in sequence_definition::adjust_values (this=0x7f58f8006a98, next_value=11) at /data/src/10.3/sql/sql_sequence.cc:563
          #9 0x000055a29d18e237 in SEQUENCE::set_value (this=0x7f58f8006a98, table=0x7f58f800e420, next_val=11, next_round=0, is_used=true) at /data/src/10.3/sql/sql_sequence.cc:843
          #10 0x000055a29d3053a5 in Item_func_setval::val_int (this=0x7f58f8015490) at /data/src/10.3/sql/item_func.cc:6926
          #11 0x000055a29d1754ad in Type_handler::Item_send_longlong (this=0x55a29e6fa350 <type_handler_longlong>, item=0x7f58f8015490, protocol=0x7f58f80010e8, buf=0x7f5909b519c0) at /data/src/10.3/sql/sql_type.cc:5302
          #12 0x000055a29d1797a8 in Type_handler_longlong::Item_send (this=0x55a29e6fa350 <type_handler_longlong>, item=0x7f58f8015490, protocol=0x7f58f80010e8, buf=0x7f5909b519c0) at /data/src/10.3/sql/sql_type.h:2232
          #13 0x000055a29ce8e9e0 in Item::send (this=0x7f58f8015490, protocol=0x7f58f80010e8, buffer=0x7f5909b519c0) at /data/src/10.3/sql/item.h:827
          #14 0x000055a29ce89d20 in Protocol::send_result_set_row (this=0x7f58f80010e8, row_items=0x7f58f80051e8) at /data/src/10.3/sql/protocol.cc:986
          #15 0x000055a29cf301a4 in select_send::send_data (this=0x7f58f8015680, items=...) at /data/src/10.3/sql/sql_class.cc:2997
          #16 0x000055a29cfda9d6 in JOIN::exec_inner (this=0x7f58f80156a0) at /data/src/10.3/sql/sql_select.cc:3828
          #17 0x000055a29cfda434 in JOIN::exec (this=0x7f58f80156a0) at /data/src/10.3/sql/sql_select.cc:3747
          #18 0x000055a29cfdb675 in mysql_select (thd=0x7f58f8000b00, tables=0x0, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f58f8015680, unit=0x7f58f8004948, select_lex=0x7f58f80050c0) at /data/src/10.3/sql/sql_select.cc:4152
          #19 0x000055a29cfcdbcf in handle_select (thd=0x7f58f8000b00, lex=0x7f58f8004880, result=0x7f58f8015680, setup_tables_done_option=0) at /data/src/10.3/sql/sql_select.cc:382
          #20 0x000055a29cf990c7 in execute_sqlcom_select (thd=0x7f58f8000b00, all_tables=0x7f58f8014e38) at /data/src/10.3/sql/sql_parse.cc:6539
          #21 0x000055a29cf8f828 in mysql_execute_command (thd=0x7f58f8000b00) at /data/src/10.3/sql/sql_parse.cc:3768
          #22 0x000055a29cf9cad8 in mysql_parse (thd=0x7f58f8000b00, rawbuf=0x7f58f8014d58 "SELECT SETVAL(s, 10)", length=20, parser_state=0x7f5909b535d0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:8001
          #23 0x000055a29cf8a2bb in dispatch_command (command=COM_QUERY, thd=0x7f58f8000b00, packet=0x7f58f808ff81 "", packet_length=20, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1846
          #24 0x000055a29cf88cfa in do_command (thd=0x7f58f8000b00) at /data/src/10.3/sql/sql_parse.cc:1391
          #25 0x000055a29d0eb78b in do_handle_one_connection (connect=0x55a2a0ab4220) at /data/src/10.3/sql/sql_connect.cc:1402
          #26 0x000055a29d0eb518 in handle_one_connection (arg=0x55a2a0ab4220) at /data/src/10.3/sql/sql_connect.cc:1308
          #27 0x000055a29d56eb43 in pfs_spawn_thread (arg=0x55a2a0b76690) at /data/src/10.3/storage/perfschema/pfs.cc:1862
          #28 0x00007f5911683494 in start_thread (arg=0x7f5909b54700) at pthread_create.c:333
          #29 0x00007f590fa6993f in clone () from /lib/x86_64-linux-gnu/libc.so.6
          {noformat}

          No visible effect on a non-debug build.
          serg Sergei Golubchik made changes -
          Priority Major [ 3 ] Critical [ 2 ]
          ratzpo Rasmus Johansson (Inactive) made changes -
          Assignee Michael Widenius [ monty ] Oleksandr Byelkin [ sanja ]
          sanja Oleksandr Byelkin made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          sanja Oleksandr Byelkin made changes -
          Assignee Oleksandr Byelkin [ sanja ] Michael Widenius [ monty ]
          Status In Progress [ 3 ] In Review [ 10002 ]
          sanja Oleksandr Byelkin made changes -
          Assignee Michael Widenius [ monty ] Oleksandr Byelkin [ sanja ]
          sanja Oleksandr Byelkin made changes -
          Status In Review [ 10002 ] Stalled [ 10000 ]
          sanja Oleksandr Byelkin made changes -
          Fix Version/s 10.3.7 [ 23005 ]
          Fix Version/s 10.3 [ 22126 ]
          Resolution Fixed [ 1 ]
          Status Stalled [ 10000 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 86306 ] MariaDB v4 [ 154062 ]

          People

            sanja Oleksandr Byelkin
            elenst Elena Stepanova
            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.