| 1 |
set global auto_increment_increment= 2, auto_increment_offset= 2; |
| 2 |
create sequence s start with -3 minvalue= -1000 increment 0; |
| 3 |
select nextval(s); |
| 4 |
nextval(s) |
| 5 |
-2 |
| 6 |
select nextval(s); |
| 7 |
nextval(s) |
| 8 |
0 |
| 9 |
flush tables; |
| 10 |
select nextval(s); |
| 11 |
nextval(s) |
| 12 |
1998 |
| 13 |
drop sequence s; |
| 14 |
set global auto_increment_increment= 2, auto_increment_offset= 1; |
| 15 |
create sequence s start with -3 minvalue= -1000 increment 0; |
| 16 |
select nextval(s); |
| 17 |
nextval(s) |
| 18 |
-3 |
| 19 |
select nextval(s); |
| 20 |
nextval(s) |
| 21 |
-1 |
| 22 |
select nextval(s); |
| 23 |
nextval(s) |
| 24 |
1 |
| 25 |
flush tables; |
| 26 |
select nextval(s); |
| 27 |
nextval(s) |
| 28 |
1997 |
| 29 |
drop sequence s; |
| 30 |
set global auto_increment_increment= default, auto_increment_offset= default; |
| 31 |
# |
| 32 |
# MDEV-28152 Features for sequence |
| 33 |
# |
| 34 |
set global auto_increment_increment= 100; |
| 35 |
set global auto_increment_offset= 42; |
| 36 |
create sequence s as bigint unsigned start with 9223372036854775800 increment 0; |
| 37 |
select next value for s; |
| 38 |
next value for s |
| 39 |
9223372036854775842 |
| 40 |
select next value for s; |
| 41 |
next value for s |
| 42 |
9223372036854775942 |
| 43 |
drop sequence s; |
| 44 |
set global auto_increment_increment= 100; |
| 45 |
set global auto_increment_offset= 5; |
| 46 |
create sequence s as bigint start with -9223372036854775805 minvalue -9223372036854775807 maxvalue -9223372036854775800 increment 0; |
| 47 |
drop sequence s; |
| 48 |
set global auto_increment_increment= default, auto_increment_offset= default; |
| 49 |
# |
| 50 |
# MDEV-33836 Assertion `(ulonglong) next_free_value % real_increment == (ulonglong) offset' failed in void sequence_definition::adjust_values(longlong) |
| 51 |
# |
| 52 |
CREATE SEQUENCE s AS BIGINT UNSIGNED START WITH 9223372036854775800 INCREMENT 0; |
| 53 |
set @old_AUTO_INCREMENT_INCREMENT=@@global.AUTO_INCREMENT_INCREMENT; |
| 54 |
set global AUTO_INCREMENT_INCREMENT=10; |
| 55 |
SELECT NEXTVAL (s); |
| 56 |
NEXTVAL (s) |
| 57 |
9223372036854775800 |
| 58 |
FLUSH TABLES WITH READ LOCK; |
| 59 |
UPDATE s SET a=1; |
| 60 |
Got one of the listed errors |
| 61 |
unlock tables; |
| 62 |
set global AUTO_INCREMENT_INCREMENT=@old_AUTO_INCREMENT_INCREMENT; |
| 63 |
drop sequence s; |
| 64 |
# |
| 65 |
# End of 11.5 tests |
| 66 |
# |