mirror of
https://github.com/MariaDB/server.git
synced 2025-02-04 21:02:17 +01:00
28eaf66e18
Problem for Galera is the fact that sequences are not really transactional. Sequence operation is committed immediately in sql_sequence.cd and later Galera could find out that we have changes but actual statement is not there anymore. Therefore, we must make some restrictions what kind of sequences Galera can support. (1) Galera cluster supports only sequences implemented by InnoDB storage engine. This is because Galera replication supports currently only InnoDB. (2) We do not allow LOCK TABLE on sequence object and we do not allow sequence creation under LOCK TABLE, instead lock is released and we issue warning. (3) We allow sequences with NOCACHE definition or with INCREMEMENT BY 0 CACHE=n definition. This makes sure that sequence values are unique accross Galera cluster. Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
15 lines
566 B
Text
15 lines
566 B
Text
--source include/galera_cluster.inc
|
|
--source include/have_innodb.inc
|
|
|
|
CREATE SEQUENCE Seq1_1 START WITH 1 INCREMENT BY 1 NOCACHE;
|
|
CREATE TABLE t1 (Id int(11) NOT NULL, PRIMARY KEY (Id));
|
|
INSERT INTO t1 VALUES (NEXT VALUE FOR Seq1_1);
|
|
INSERT INTO t1 VALUES (NEXT VALUE FOR Seq1_1);
|
|
INSERT INTO t1 VALUES (NEXT VALUE FOR Seq1_1);
|
|
INSERT INTO t1 VALUES (NEXT VALUE FOR Seq1_1);
|
|
DROP SEQUENCE Seq1_1;
|
|
CREATE SEQUENCE Seq1_1 START WITH 1 INCREMENT BY 1 NOCACHE;
|
|
--error ER_DUP_ENTRY
|
|
INSERT INTO t1 VALUES (NEXT VALUE FOR Seq1_1);
|
|
DROP SEQUENCE Seq1_1;
|
|
DROP TABLE t1;
|