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

If CYCLE is used then the sequence should start again from MINVALUE after it
has run out of values. Default value is NOCYCLE.

Constraints on Create Arguments
-------------------------------

To be able to create a legal sequence, the following must hold:

* MAXVALUE >= start
* MAXVALUE > MINVALUE
* START >= MINVALUE
* MAXVALUE <= 9223372036854775806  (LONGLONG_MAX-1)
* MINVALUE >= -9223372036854775807 (LONGLONG_MIN+1)

Note that sequences can't generate the maximum/minimum 64 bit number because
of the constraint of MINVALUE and MAXVALUE.

Atomic DDL
----------

MariaDB starting with 10.6.1
----------------------------
MariaDB 10.6.1 supports Atomic DDL and CREATE SEQUENCE is atomic.

Examples
--------

CREATE SEQUENCE s START WITH 100 INCREMENT BY 10;

CREATE SEQUENCE s2 START WITH -100 INCREMENT BY -10;

The following statement fails, as the increment conflicts with the defaults

CREATE SEQUENCE s3 START WITH -100 INCREMENT BY 10;
ERROR 4082 (HY000): Sequence 'test.s3' values are conflicting

The sequence can be created by specifying workable minimum and maximum values:

CREATE SEQUENCE s3 START WITH -100 INCREMENT BY 10 MINVALUE=-100 MAXVALUE=1000;

URL: https://mariadb.com/kb/en/create-sequence/https://mariadb.com/kb/en/create-sequence/