Details
-
Task
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
Description
Add support for SEQUENCES, like in PostgreSQL or Oracle:
CREATE [ TEMPORARY | TEMP ] SEQUENCE name [ INCREMENT [ BY ] increment ] |
[ MINVALUE minvalue | NO MINVALUE ] [ MAXVALUE maxvalue | NO MAXVALUE ] |
[ START [ WITH ] start ] [ CACHE cache ] [ [ NO ] CYCLE ] |
See https://www.postgresql.org/docs/8.1/static/sql-createsequence.html
for details.
The main part of the task is to add support for sequence tables in the storage engine interface. The main difference between transactional tables are only that they don't roll back when issuing a ROLLBACK statement.
Example:
CREATE SEQUENCE s1; |
SELECT s1.NEXTVAL FROM DUAL; |
Supported statements:
- CREATE SEQUENCE
- DROP SEQUENCE
- ALTER SEQUENCE
- NEXT VALUE FOR sequence_name and NEXTVAL(sequence_name)
- PREVIOUS VALUE FOR sequence_name and LASTVAL(sequence_name)
- SETVAL(sequence_name, next_value, is_used, round)
- SHOW CREATE SEQUENCE
Attachments
Issue Links
- causes
-
MDEV-14824 Assertion `!trx_is_started(trx)' failed in innobase_start_trx_and_assign_read_view
- Closed
-
MDEV-22491 Support mariadb-check and CHECK TABLE with SEQUENCE
- Open
-
MDEV-32795 ALTER SEQUENCE IF NOT EXISTS non_existing_seq Errors rather than note
- Closed
- includes
-
MDEV-12930 Testing SEQUENCE object
- Closed
-
MDEV-12941 First release of SEQUENCEs
- Closed
-
MDEV-13005 Fixing bugs in SEQUENCE, part 3
- Closed
-
MDEV-13679 crash when using SEQUENCE as column default
- Closed
-
MDEV-13711 Assertion `is_temporary_table(tables)' failed in open_and_process_table on CREATE TABLE .. LIKE <sequence>
- Closed
-
MDEV-13714 Value of SEQUENCE table option is ignored upon creation
- Closed
-
MDEV-13720 Server crashes in SEQUENCE::write_lock or Assertion `table && table->s->sequence' failed in Item_func_nextval::val_int
- Closed
-
MDEV-13732 User with SELECT privilege can ALTER sequence
- Closed
-
MDEV-14824 Assertion `!trx_is_started(trx)' failed in innobase_start_trx_and_assign_read_view
- Closed
- is duplicated by
-
MDEV-13075 AliSQL: [Feature] Issue #41 Sequence Engine
- Closed
- is part of
-
MDEV-10137 Providing compatibility to other databases
- Open
- relates to
-
MDEV-12883 CREATE SEQUENCE with huge MAXVALUE
- Closed
-
MDEV-13006 update_time column of on i_s.tables remains NULL for sequence objects
- Open
-
MDEV-13008 Documentation improvements for Sequence objects
- Closed
-
MDEV-13010 NEXTVAL should increment only once for a given row
- Open
-
MDEV-13497 concurrently used sequence hangs in SEQUENCE::next_value
- Closed
-
MDEV-32350 Can't selectively restore sequences using innodb tables from backup
- Closed
-
MDEV-12168 AUTO_INCREMENT with CYCLE support
- Closed
-
MDEV-12533 sql_mode=ORACLE: Add support for database qualified sequence names in NEXTVAL and CURRVAL
- Closed
-
MDEV-13393 SEQUENCE related crash when running concurrent I_S.TABLES and FLUSH queries
- Closed
-
MDEV-13497 concurrently used sequence hangs in SEQUENCE::next_value
- Closed
-
MDEV-20111 (CREATE|ALTER) SEQUENCE / SETVAL: only integer literal accepted as parameter
- Closed