summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/isolation/expected/sequence-ddl.out30
-rw-r--r--src/test/isolation/specs/sequence-ddl.spec19
2 files changed, 26 insertions, 23 deletions
diff --git a/src/test/isolation/expected/sequence-ddl.out b/src/test/isolation/expected/sequence-ddl.out
index 6b7119738ff..6766c0aff61 100644
--- a/src/test/isolation/expected/sequence-ddl.out
+++ b/src/test/isolation/expected/sequence-ddl.out
@@ -13,15 +13,13 @@ step s1commit: COMMIT;
step s2nv: <... completed>
error in steps s1commit s2nv: ERROR: nextval: reached maximum value of sequence "seq1" (10)
-starting permutation: s2begin s2nv s1alter2 s2commit s1commit
-step s2begin: BEGIN;
-step s2nv: SELECT nextval('seq1') FROM generate_series(1, 15);
+starting permutation: s1restart s2nv s1commit
+step s1restart: ALTER SEQUENCE seq1 RESTART WITH 5;
+step s2nv: SELECT nextval('seq1') FROM generate_series(1, 15); <waiting ...>
+step s1commit: COMMIT;
+step s2nv: <... completed>
nextval
-1
-2
-3
-4
5
6
7
@@ -33,14 +31,16 @@ nextval
13
14
15
-step s1alter2: ALTER SEQUENCE seq1 MAXVALUE 20; <waiting ...>
-step s2commit: COMMIT;
-step s1alter2: <... completed>
-step s1commit: COMMIT;
+16
+17
+18
+19
starting permutation: s1restart s2nv s1commit
step s1restart: ALTER SEQUENCE seq1 RESTART WITH 5;
-step s2nv: SELECT nextval('seq1') FROM generate_series(1, 15);
+step s2nv: SELECT nextval('seq1') FROM generate_series(1, 15); <waiting ...>
+step s1commit: COMMIT;
+step s2nv: <... completed>
nextval
5
@@ -58,9 +58,8 @@ nextval
17
18
19
-step s1commit: COMMIT;
-starting permutation: s2begin s2nv s1restart s2commit s1commit
+starting permutation: s2begin s2nv s1alter2 s2commit s1commit
step s2begin: BEGIN;
step s2nv: SELECT nextval('seq1') FROM generate_series(1, 15);
nextval
@@ -80,6 +79,7 @@ nextval
13
14
15
-step s1restart: ALTER SEQUENCE seq1 RESTART WITH 5;
+step s1alter2: ALTER SEQUENCE seq1 MAXVALUE 20; <waiting ...>
step s2commit: COMMIT;
+step s1alter2: <... completed>
step s1commit: COMMIT;
diff --git a/src/test/isolation/specs/sequence-ddl.spec b/src/test/isolation/specs/sequence-ddl.spec
index 42ee3b06151..5c51fcdae68 100644
--- a/src/test/isolation/specs/sequence-ddl.spec
+++ b/src/test/isolation/specs/sequence-ddl.spec
@@ -15,6 +15,7 @@ setup { BEGIN; }
step "s1alter" { ALTER SEQUENCE seq1 MAXVALUE 10; }
step "s1alter2" { ALTER SEQUENCE seq1 MAXVALUE 20; }
step "s1restart" { ALTER SEQUENCE seq1 RESTART WITH 5; }
+step "s1setval" { SELECT setval('seq1', 5); }
step "s1commit" { COMMIT; }
session "s2"
@@ -24,16 +25,18 @@ step "s2commit" { COMMIT; }
permutation "s1alter" "s1commit" "s2nv"
-# Prior to PG10, the s2nv would see the uncommitted s1alter change,
-# but now it waits.
+# Prior to PG10, the s2nv step would see the uncommitted s1alter
+# change, but now it waits.
permutation "s1alter" "s2nv" "s1commit"
-# nextval doesn't release lock until transaction end, so s1alter2 has
-# to wait for s2commit.
-permutation "s2begin" "s2nv" "s1alter2" "s2commit" "s1commit"
+# Prior to PG10, the s2nv step would see the uncommitted s1reset
+# change, but now it waits.
+permutation "s1restart" "s2nv" "s1commit"
-# RESTART is nontransactional, so s2nv sees it right away
+# In contrast to ALTER setval() is non-transactional, so it doesn't
+# have to wait.
permutation "s1restart" "s2nv" "s1commit"
-# RESTART does not wait
-permutation "s2begin" "s2nv" "s1restart" "s2commit" "s1commit"
+# nextval doesn't release lock until transaction end, so s1alter2 has
+# to wait for s2commit.
+permutation "s2begin" "s2nv" "s1alter2" "s2commit" "s1commit"