CREATE SEQUENCE s INCREMENT=0 CACHE=5 ENGINE=InnoDB;
CREATE TABLE t1 (f1 INT PRIMARY KEY DEFAULT NEXTVAL(s), f2 INT) ENGINE=InnoDB;
# Reserve values 1..5 from sequence
BEGIN;
INSERT INTO t1(f2) SELECT * FROM seq_1_to_5;
# From second connection execute enough INSERTs to reserve
# new range from sequence
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
# Reserve values 6..25 from sequence
BEGIN;
INSERT INTO t1(f2) SELECT * FROM seq_1_to_20;
# From third connection execute enough INSERTs to reserve
# new range from sequence and commit
connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1;
# Reserve values 26..35 from sequence
BEGIN;
INSERT INTO t1(f2) SELECT * FROM seq_1_to_10;
COMMIT;
SET GLOBAL innodb_log_checkpoint_now=1;
connection default;
# Killing server
# Kill the server
Expect seqno 4
4
# Next free value is 36
SELECT NEXTVAL(s) AS EXPECT_36;
EXPECT_36
36
SELECT * from t1;
f1 f2
26 1
27 2
28 3
29 4
30 5
31 6
32 7
33 8
34 9
35 10
DROP TABLE t1;
DROP SEQUENCE s;
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.145Angebot
¤
*Eine klare Vorstellung vom Zielzustand