| 1 |
# When an update propagates a preexisting lock on the updated tuple, make sure |
| 2 |
# we don't ignore the lock in subsequent operations of the new version. (The |
| 3 |
# version with the aborted savepoint uses a slightly different code path). |
| 4 |
setup |
| 5 |
{ |
| 6 |
create table parent (i int, c char(3)); |
| 7 |
create unique index parent_idx on parent (i); |
| 8 |
insert into parent values (1, 'AAA'); |
| 9 |
create table child (i int references parent(i)); |
| 10 |
} |
| 11 |
|
| 12 |
teardown |
| 13 |
{ |
| 14 |
drop table child, parent; |
| 15 |
} |
| 16 |
|
| 17 |
session s1 |
| 18 |
step s1b { BEGIN; } |
| 19 |
step s1l { INSERT INTO child VALUES (1); } |
| 20 |
step s1c { COMMIT; } |
| 21 |
|
| 22 |
session s2 |
| 23 |
step s2b { BEGIN; } |
| 24 |
step s2l { INSERT INTO child VALUES (1); } |
| 25 |
step s2c { COMMIT; } |
| 26 |
|
| 27 |
session s3 |
| 28 |
step s3b { BEGIN; } |
| 29 |
step s3u { UPDATE parent SET c=lower(c); } # no key update |
| 30 |
step s3u2 { UPDATE parent SET i = i; } # key update |
| 31 |
step s3svu { SAVEPOINT f; UPDATE parent SET c = 'bbb'; ROLLBACK TO f; } |
| 32 |
step s3d { DELETE FROM parent; } |
| 33 |
step s3c { COMMIT; } |
| 34 |
|
| 35 |
permutation s1b s1l s2b s2l s3b s3u s3d s1c s2c s3c |
| 36 |
permutation s1b s1l s2b s2l s3b s3u s3svu s3d s1c s2c s3c |
| 37 |
permutation s1b s1l s2b s2l s3b s3u2 s3d s1c s2c s3c |
| 38 |
permutation s1b s1l s2b s2l s3b s3u2 s3svu s3d s1c s2c s3c |
| 39 |
permutation s1b s1l s3b s3u s3d s1c s3c |
| 40 |
permutation s1b s1l s3b s3u s3svu s3d s1c s3c |
| 41 |
permutation s1b s1l s3b s3u2 s3d s1c s3c |
| 42 |
permutation s1b s1l s3b s3u2 s3svu s3d s1c s3c |