Debian Codegraph @

src/test/isolation/specs/multixact-no-deadlock.spec

raw
1 # If we already hold a lock of a given strength, do not deadlock when
2 # some other transaction is waiting for a conflicting lock and we try
3 # to acquire the same lock we already held.
4 setup
5 {
6 CREATE TABLE justthis (
7 value int
8 );
9
10 INSERT INTO justthis VALUES (1);
11 }
12
13 teardown
14 {
15 DROP TABLE justthis;
16 }
17
18 session s1
19 setup { BEGIN; }
20 step s1lock { SELECT * FROM justthis FOR SHARE; }
21 step s1svpt { SAVEPOINT foo; }
22 step s1lock2 { SELECT * FROM justthis FOR SHARE; }
23 step s1c { COMMIT; }
24
25 session s2
26 setup { BEGIN; }
27 step s2lock { SELECT * FROM justthis FOR SHARE; } # ensure it's a multi
28 step s2c { COMMIT; }
29
30 session s3
31 setup { BEGIN; }
32 step s3lock { SELECT * FROM justthis FOR UPDATE; }
33 step s3c { COMMIT; }
34
35 permutation s1lock s2lock s1svpt s3lock s1lock2 s2c s1c s3c