summaryrefslogtreecommitdiffstats
path: root/src/test/isolation/specs/fk-deadlock.spec
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:15:05 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:15:05 +0000
commit46651ce6fe013220ed397add242004d764fc0153 (patch)
tree6e5299f990f88e60174a1d3ae6e48eedd2688b2b /src/test/isolation/specs/fk-deadlock.spec
parentInitial commit. (diff)
downloadpostgresql-14-46651ce6fe013220ed397add242004d764fc0153.tar.xz
postgresql-14-46651ce6fe013220ed397add242004d764fc0153.zip
Adding upstream version 14.5.upstream/14.5upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/isolation/specs/fk-deadlock.spec')
-rw-r--r--src/test/isolation/specs/fk-deadlock.spec46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/test/isolation/specs/fk-deadlock.spec b/src/test/isolation/specs/fk-deadlock.spec
new file mode 100644
index 0000000..b4970dd
--- /dev/null
+++ b/src/test/isolation/specs/fk-deadlock.spec
@@ -0,0 +1,46 @@
+setup
+{
+ CREATE TABLE parent (
+ parent_key int PRIMARY KEY,
+ aux text NOT NULL
+ );
+
+ CREATE TABLE child (
+ child_key int PRIMARY KEY,
+ parent_key int NOT NULL REFERENCES parent
+ );
+
+ INSERT INTO parent VALUES (1, 'foo');
+}
+
+teardown
+{
+ DROP TABLE parent, child;
+}
+
+session s1
+setup { BEGIN; SET deadlock_timeout = '100ms'; }
+step s1i { INSERT INTO child VALUES (1, 1); }
+step s1u { UPDATE parent SET aux = 'bar'; }
+step s1c { COMMIT; }
+
+session s2
+setup { BEGIN; SET deadlock_timeout = '10s'; }
+step s2i { INSERT INTO child VALUES (2, 1); }
+step s2u { UPDATE parent SET aux = 'baz'; }
+step s2c { COMMIT; }
+
+permutation s1i s1u s1c s2i s2u s2c
+permutation s1i s1u s2i s1c s2u s2c
+permutation s1i s1u s2i s2u s1c s2c
+permutation s1i s2i s1u s1c s2u s2c
+permutation s1i s2i s1u s2u s1c s2c
+permutation s1i s2i s2u s1u s2c s1c
+permutation s1i s2i s2u s2c s1u s1c
+permutation s2i s1i s1u s1c s2u s2c
+permutation s2i s1i s1u s2u s1c s2c
+permutation s2i s1i s2u s1u s2c s1c
+permutation s2i s1i s2u s2c s1u s1c
+permutation s2i s2u s1i s1u s2c s1c
+permutation s2i s2u s1i s2c s1u s1c
+permutation s2i s2u s2c s1i s1u s1c