Debian Codegraph @

src/test/isolation/specs/insert-conflict-do-nothing-2.spec

raw
1 # INSERT...ON CONFLICT DO NOTHING test with multiple rows
2 # in higher isolation levels
3
4 setup
5 {
6 CREATE TABLE ints (key int, val text, PRIMARY KEY (key) INCLUDE (val));
7 }
8
9 teardown
10 {
11 DROP TABLE ints;
12 }
13
14 session s1
15 step beginrr1 { BEGIN ISOLATION LEVEL REPEATABLE READ; }
16 step begins1 { BEGIN ISOLATION LEVEL SERIALIZABLE; }
17 step donothing1 { INSERT INTO ints(key, val) VALUES(1, 'donothing1') ON CONFLICT DO NOTHING; }
18 step c1 { COMMIT; }
19 step show { SELECT * FROM ints; }
20
21 session s2
22 step beginrr2 { BEGIN ISOLATION LEVEL REPEATABLE READ; }
23 step begins2 { BEGIN ISOLATION LEVEL SERIALIZABLE; }
24 step donothing2 { INSERT INTO ints(key, val) VALUES(1, 'donothing2'), (1, 'donothing3') ON CONFLICT DO NOTHING; }
25 step c2 { COMMIT; }
26
27 permutation beginrr1 beginrr2 donothing1 c1 donothing2 c2 show
28 permutation beginrr1 beginrr2 donothing2 c2 donothing1 c1 show
29 permutation beginrr1 beginrr2 donothing1 donothing2 c1 c2 show
30 permutation beginrr1 beginrr2 donothing2 donothing1 c2 c1 show
31 permutation begins1 begins2 donothing1 c1 donothing2 c2 show
32 permutation begins1 begins2 donothing2 c2 donothing1 c1 show
33 permutation begins1 begins2 donothing1 donothing2 c1 c2 show
34 permutation begins1 begins2 donothing2 donothing1 c2 c1 show