Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
11.0(EOL)
-
None
Description
https://lists.launchpad.net/maria-developers/msg13299.html
Sequences will skip all cached value at alter.
d77aaa6994b 11.0 |
create sequence s; |
select next value for s; # 1 |
alter sequence s cycle; |
select next value for s; # 1001, because the default cache size is 1000 and reserved_until is 1001 |
drop sequence s; |
It becomes worse when we throw in as <int_type> (Item 1 or MDEV-28152):
create sequence s as tinyint; |
select next value for s; |
alter sequence s maxvalue 63; |
select next value for s; # error: ER_SEQUENCE_RUN_OUT, because default cache size 1000 is out of range for tiny int, and no maxvalue will work. |
drop sequence s; |
This may be related to the documented behaviour[1] of discarding cached values when flushing tables. Presumably this makes server restart also do the same.
create sequence s; |
select next value for s; # 1 |
flush tables;
|
select next value for s; # 1001 |
drop sequence s; |
 |
create sequence s; |
select next value for s; # 1 |
--source include/restart_mysqld.inc
|
select next value for s; # 1001 |
drop sequence s; |
[1] https://mariadb.com/kb/en/sequence-overview/#notes
Shall we
1. treat the alter-discard behaviour as a bug and fix it, OR
2. treat the alter-discard behaviour as intended, just like flush tables, OR
3. treat all cache discard behaviours as a bug and fix them?
Attachments
Issue Links
- relates to
-
MDEV-34291 Provide a variable for the default cache size for create sequence
- Open