| 1 |
# Here we verify that tuple lock levels conform to their documented |
| 2 |
# conflict tables. |
| 3 |
|
| 4 |
setup { |
| 5 |
DROP TABLE IF EXISTS multixact_conflict; |
| 6 |
CREATE TABLE multixact_conflict (a int primary key); |
| 7 |
INSERT INTO multixact_conflict VALUES (1); |
| 8 |
} |
| 9 |
|
| 10 |
teardown { |
| 11 |
DROP TABLE multixact_conflict; |
| 12 |
} |
| 13 |
|
| 14 |
session s1 |
| 15 |
step s1_begin { BEGIN; } |
| 16 |
step s1_lcksvpt { SELECT * FROM multixact_conflict FOR KEY SHARE; SAVEPOINT foo; } |
| 17 |
step s1_tuplock1 { SELECT * FROM multixact_conflict FOR KEY SHARE; } |
| 18 |
step s1_tuplock2 { SELECT * FROM multixact_conflict FOR SHARE; } |
| 19 |
step s1_tuplock3 { SELECT * FROM multixact_conflict FOR NO KEY UPDATE; } |
| 20 |
step s1_tuplock4 { SELECT * FROM multixact_conflict FOR UPDATE; } |
| 21 |
step s1_commit { COMMIT; } |
| 22 |
|
| 23 |
session s2 |
| 24 |
step s2_tuplock1 { SELECT * FROM multixact_conflict FOR KEY SHARE; } |
| 25 |
step s2_tuplock2 { SELECT * FROM multixact_conflict FOR SHARE; } |
| 26 |
step s2_tuplock3 { SELECT * FROM multixact_conflict FOR NO KEY UPDATE; } |
| 27 |
step s2_tuplock4 { SELECT * FROM multixact_conflict FOR UPDATE; } |
| 28 |
|
| 29 |
# The version with savepoints test the multixact cases |
| 30 |
permutation s1_begin s1_lcksvpt s1_tuplock1 s2_tuplock1 s1_commit |
| 31 |
permutation s1_begin s1_lcksvpt s1_tuplock1 s2_tuplock2 s1_commit |
| 32 |
permutation s1_begin s1_lcksvpt s1_tuplock1 s2_tuplock3 s1_commit |
| 33 |
permutation s1_begin s1_lcksvpt s1_tuplock1 s2_tuplock4 s1_commit |
| 34 |
permutation s1_begin s1_lcksvpt s1_tuplock2 s2_tuplock1 s1_commit |
| 35 |
permutation s1_begin s1_lcksvpt s1_tuplock2 s2_tuplock2 s1_commit |
| 36 |
permutation s1_begin s1_lcksvpt s1_tuplock2 s2_tuplock3 s1_commit |
| 37 |
permutation s1_begin s1_lcksvpt s1_tuplock2 s2_tuplock4 s1_commit |
| 38 |
permutation s1_begin s1_lcksvpt s1_tuplock3 s2_tuplock1 s1_commit |
| 39 |
permutation s1_begin s1_lcksvpt s1_tuplock3 s2_tuplock2 s1_commit |
| 40 |
permutation s1_begin s1_lcksvpt s1_tuplock3 s2_tuplock3 s1_commit |
| 41 |
permutation s1_begin s1_lcksvpt s1_tuplock3 s2_tuplock4 s1_commit |
| 42 |
permutation s1_begin s1_lcksvpt s1_tuplock4 s2_tuplock1 s1_commit |
| 43 |
permutation s1_begin s1_lcksvpt s1_tuplock4 s2_tuplock2 s1_commit |
| 44 |
permutation s1_begin s1_lcksvpt s1_tuplock4 s2_tuplock3 s1_commit |
| 45 |
permutation s1_begin s1_lcksvpt s1_tuplock4 s2_tuplock4 s1_commit |
| 46 |
|
| 47 |
# no multixacts here |
| 48 |
permutation s1_begin s1_tuplock1 s2_tuplock1 s1_commit |
| 49 |
permutation s1_begin s1_tuplock1 s2_tuplock2 s1_commit |
| 50 |
permutation s1_begin s1_tuplock1 s2_tuplock3 s1_commit |
| 51 |
permutation s1_begin s1_tuplock1 s2_tuplock4 s1_commit |
| 52 |
permutation s1_begin s1_tuplock2 s2_tuplock1 s1_commit |
| 53 |
permutation s1_begin s1_tuplock2 s2_tuplock2 s1_commit |
| 54 |
permutation s1_begin s1_tuplock2 s2_tuplock3 s1_commit |
| 55 |
permutation s1_begin s1_tuplock2 s2_tuplock4 s1_commit |
| 56 |
permutation s1_begin s1_tuplock3 s2_tuplock1 s1_commit |
| 57 |
permutation s1_begin s1_tuplock3 s2_tuplock2 s1_commit |
| 58 |
permutation s1_begin s1_tuplock3 s2_tuplock3 s1_commit |
| 59 |
permutation s1_begin s1_tuplock3 s2_tuplock4 s1_commit |
| 60 |
permutation s1_begin s1_tuplock4 s2_tuplock1 s1_commit |
| 61 |
permutation s1_begin s1_tuplock4 s2_tuplock2 s1_commit |
| 62 |
permutation s1_begin s1_tuplock4 s2_tuplock3 s1_commit |
| 63 |
permutation s1_begin s1_tuplock4 s2_tuplock4 s1_commit |