1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Sequences with negative numbers and auto_increment_increment crashes

This also fixes MDEV-16313 Assertion `next_free_value % real_increment == offset' fails upon CREATE SEQUENCE in galera cluster

Fixed by adding llabs() to assert.
Also adjusted auto_increment_offset to mod auto_increment_increment.
This commit is contained in:
Monty
2018-08-30 17:32:26 +03:00
parent ceb5597184
commit 7aa80ba66b
5 changed files with 89 additions and 2 deletions

View File

@ -519,3 +519,18 @@ create temporary table tmp (i int);
select next value for tmp;
ERROR 42S02: 'test.tmp' is not a SEQUENCE
drop table tmp;
#
# Test negative numbers
#
create sequence s start with 1 minvalue=-1000 maxvalue=1000 increment -1;
select next value for s;
next value for s
1
select next value for s;
next value for s
0
flush tables;
select next value for s;
next value for s
-999
drop sequence s;