Comments - CREATE SEQUENCE

3 years, 9 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.