| 1 |
# Verify that cloning a foreign key constraint to a partition ensures |
| 2 |
# that referenced values exist, even if they're being concurrently |
| 3 |
# deleted. |
| 4 |
setup { |
| 5 |
drop table if exists ppk, pfk, pfk1; |
| 6 |
create table ppk (a int primary key) partition by list (a); |
| 7 |
create table ppk1 partition of ppk for values in (1); |
| 8 |
insert into ppk values (1); |
| 9 |
create table pfk (a int references ppk) partition by list (a); |
| 10 |
create table pfk1 (a int not null); |
| 11 |
insert into pfk1 values (1); |
| 12 |
} |
| 13 |
|
| 14 |
session s1 |
| 15 |
step s1b { begin; } |
| 16 |
step s1d { delete from ppk1 where a = 1; } |
| 17 |
step s1c { commit; } |
| 18 |
|
| 19 |
session s2 |
| 20 |
step s2b { begin; } |
| 21 |
step s2a { alter table pfk attach partition pfk1 for values in (1); } |
| 22 |
step s2c { commit; } |
| 23 |
|
| 24 |
teardown { drop table ppk, pfk, pfk1; } |
| 25 |
|
| 26 |
permutation s1b s1d s1c s2b s2a s2c |
| 27 |
permutation s1b s1d s2b s1c s2a s2c |
| 28 |
permutation s1b s1d s2b s2a s1c s2c |
| 29 |
#permutation s1b s1d s2b s2a s2c s1c |
| 30 |
permutation s1b s2b s1d s1c s2a s2c |
| 31 |
permutation s1b s2b s1d s2a s1c s2c |
| 32 |
#permutation s1b s2b s1d s2a s2c s1c |
| 33 |
#permutation s1b s2b s2a s1d s1c s2c |
| 34 |
permutation s1b s2b s2a s1d s2c s1c |
| 35 |
permutation s1b s2b s2a s2c s1d s1c |
| 36 |
permutation s2b s1b s1d s1c s2a s2c |
| 37 |
permutation s2b s1b s1d s2a s1c s2c |
| 38 |
#permutation s2b s1b s1d s2a s2c s1c |
| 39 |
#permutation s2b s1b s2a s1d s1c s2c |
| 40 |
permutation s2b s1b s2a s1d s2c s1c |
| 41 |
permutation s2b s1b s2a s2c s1d s1c |
| 42 |
#permutation s2b s2a s1b s1d s1c s2c |
| 43 |
permutation s2b s2a s1b s1d s2c s1c |
| 44 |
permutation s2b s2a s1b s2c s1d s1c |
| 45 |
permutation s2b s2a s2c s1b s1d s1c |