From 311bcfc6b3acdd6fd152798c7f287ddf74fa2a98 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 16 Apr 2024 21:46:48 +0200 Subject: Adding upstream version 15.4. Signed-off-by: Daniel Baumann --- src/test/isolation/specs/alter-table-3.spec | 79 +++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 src/test/isolation/specs/alter-table-3.spec (limited to 'src/test/isolation/specs/alter-table-3.spec') diff --git a/src/test/isolation/specs/alter-table-3.spec b/src/test/isolation/specs/alter-table-3.spec new file mode 100644 index 0000000..f70d9c0 --- /dev/null +++ b/src/test/isolation/specs/alter-table-3.spec @@ -0,0 +1,79 @@ +# ALTER TABLE - Enable and disable triggers with concurrent reads +# +# ENABLE/DISABLE TRIGGER uses ShareRowExclusiveLock so we mix writes with +# it to see what works or waits. + +setup +{ + CREATE TABLE a (i int PRIMARY KEY); + INSERT INTO a VALUES (0), (1), (2), (3); + CREATE FUNCTION f() RETURNS TRIGGER LANGUAGE plpgsql AS 'BEGIN RETURN NULL; END;'; + CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f(); +} + +teardown +{ + DROP TABLE a; + DROP FUNCTION f(); +} + +session s1 +step s1a { BEGIN; } +step s1b { ALTER TABLE a DISABLE TRIGGER t; } +step s1c { ALTER TABLE a ENABLE TRIGGER t; } +step s1d { COMMIT; } + +session s2 +step s2a { BEGIN; } +step s2b { SELECT * FROM a WHERE i = 1 LIMIT 1 FOR UPDATE; } +step s2c { INSERT INTO a VALUES (0); } +step s2d { COMMIT; } + +permutation s1a s1b s1c s1d s2a s2b s2c s2d +permutation s1a s1b s1c s2a s1d s2b s2c s2d +permutation s1a s1b s1c s2a s2b s1d s2c s2d +permutation s1a s1b s1c s2a s2b s2c s1d s2d +permutation s1a s1b s2a s1c s1d s2b s2c s2d +permutation s1a s1b s2a s1c s2b s1d s2c s2d +permutation s1a s1b s2a s1c s2b s2c s1d s2d +permutation s1a s1b s2a s2b s1c s1d s2c s2d +permutation s1a s1b s2a s2b s1c s2c s1d s2d +permutation s1a s1b s2a s2b s2c s1c s1d s2d +permutation s1a s2a s1b s1c s1d s2b s2c s2d +permutation s1a s2a s1b s1c s2b s1d s2c s2d +permutation s1a s2a s1b s1c s2b s2c s1d s2d +permutation s1a s2a s1b s2b s1c s1d s2c s2d +permutation s1a s2a s1b s2b s1c s2c s1d s2d +permutation s1a s2a s1b s2b s2c s1c s1d s2d +permutation s1a s2a s2b s1b s1c s1d s2c s2d +permutation s1a s2a s2b s1b s1c s2c s1d s2d +permutation s1a s2a s2b s1b s2c s1c s1d s2d +permutation s1a s2a s2b s2c s1b s1c s1d s2d +permutation s1a s2a s2b s2c s1b s1c s2d s1d +permutation s1a s2a s2b s2c s1b s2d s1c s1d +permutation s1a s2a s2b s2c s2d s1b s1c s1d +permutation s2a s1a s1b s1c s1d s2b s2c s2d +permutation s2a s1a s1b s1c s2b s1d s2c s2d +permutation s2a s1a s1b s1c s2b s2c s1d s2d +permutation s2a s1a s1b s2b s1c s1d s2c s2d +permutation s2a s1a s1b s2b s1c s2c s1d s2d +permutation s2a s1a s1b s2b s2c s1c s1d s2d +permutation s2a s1a s2b s1b s1c s1d s2c s2d +permutation s2a s1a s2b s1b s1c s2c s1d s2d +permutation s2a s1a s2b s1b s2c s1c s1d s2d +permutation s2a s1a s2b s2c s1b s1c s1d s2d +permutation s2a s1a s2b s2c s1b s1c s2d s1d +permutation s2a s1a s2b s2c s1b s2d s1c s1d +permutation s2a s1a s2b s2c s2d s1b s1c s1d +permutation s2a s2b s1a s1b s1c s1d s2c s2d +permutation s2a s2b s1a s1b s1c s2c s1d s2d +permutation s2a s2b s1a s1b s2c s1c s1d s2d +permutation s2a s2b s1a s2c s1b s1c s1d s2d +permutation s2a s2b s1a s2c s1b s1c s2d s1d +permutation s2a s2b s1a s2c s1b s2d s1c s1d +permutation s2a s2b s1a s2c s2d s1b s1c s1d +permutation s2a s2b s2c s1a s1b s1c s1d s2d +permutation s2a s2b s2c s1a s1b s1c s2d s1d +permutation s2a s2b s2c s1a s1b s2d s1c s1d +permutation s2a s2b s2c s1a s2d s1b s1c s1d +permutation s2a s2b s2c s2d s1a s1b s1c s1d -- cgit v1.2.3