Comments - CREATE SEQUENCE

3 years, 11 months ago Ian Gilfillan

You need to provide more details, or report as a bug with full details on how to recreate, and what your settings and structure are.

 
3 years, 11 months ago oscar oxy

I don't know how replicate the bug, it seems random, I'm Mariadb 10.4 and I create a sequence like CREATE SEQUENCE $nameSequence START WITH 2 INCREMENT BY 1;

the setting is default Mariadb 10.4, I don't know what other give you... So have you never had this problem?

 
3 years, 6 months ago Daniel Black

If there was a server restart or a `flush tables {sequencename}` is performed on the sequence then the range of values (the CACHE) is lost.

Also implicit closing by running out of table cache will result in the cached values being lost and the sequence restarting at the next non-cached value:

e.g:

MariaDB [test]> select nextval(bob); +--------------+

nextval(bob)

+--------------+

1002

+--------------+ 1 row in set (0.000 sec)

MariaDB [test]> flush tables bob; Query OK, 0 rows affected (0.001 sec)

MariaDB [test]> select nextval(bob); +--------------+

nextval(bob)

+--------------+

2001

+--------------+ 1 row in set (0.002 sec)

If you'd like a different functionality please request it on JIRA (same as bug reporting link above).

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.