aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKevin Grittner <kgrittn@postgresql.org>2013-10-08 16:55:12 -0500
committerKevin Grittner <kgrittn@postgresql.org>2013-10-08 16:55:12 -0500
commit31a877f18bdf60dd1dfe92e7502469ed4c40d75b (patch)
treeae7ff26473a10c3449ba2de704b3d315600e5c5e /src
parent6648775028a85bc024f37eab5e572510977008b1 (diff)
downloadpostgresql-31a877f18bdf60dd1dfe92e7502469ed4c40d75b.tar.gz
postgresql-31a877f18bdf60dd1dfe92e7502469ed4c40d75b.zip
Allow drop-index-concurrently-1 test to run at any isolation level.
It previously reported failure at REPEATABLE READ and SERIALIZABLE transaction isolation levels for make installcheck.
Diffstat (limited to 'src')
-rw-r--r--src/test/isolation/expected/drop-index-concurrently-1.out6
-rw-r--r--src/test/isolation/expected/drop-index-concurrently-1_2.out42
-rw-r--r--src/test/isolation/specs/drop-index-concurrently-1.spec7
3 files changed, 52 insertions, 3 deletions
diff --git a/src/test/isolation/expected/drop-index-concurrently-1.out b/src/test/isolation/expected/drop-index-concurrently-1.out
index 8bedf13d338..75dff56bc46 100644
--- a/src/test/isolation/expected/drop-index-concurrently-1.out
+++ b/src/test/isolation/expected/drop-index-concurrently-1.out
@@ -1,7 +1,11 @@
Parsed test spec with 3 sessions
-starting permutation: noseq prepi preps begin explaini explains select2 drop insert2 end2 selecti selects end
+starting permutation: noseq chkiso prepi preps begin explaini explains select2 drop insert2 end2 selecti selects end
step noseq: SET enable_seqscan = false;
+step chkiso: SELECT (setting in ('read committed','read uncommitted')) AS is_read_committed FROM pg_settings WHERE name = 'default_transaction_isolation';
+is_read_committed
+
+t
step prepi: PREPARE getrow_idx AS SELECT * FROM test_dc WHERE data=34 ORDER BY id,data;
step preps: PREPARE getrow_seq AS SELECT * FROM test_dc WHERE data::text=34::text ORDER BY id,data;
step begin: BEGIN;
diff --git a/src/test/isolation/expected/drop-index-concurrently-1_2.out b/src/test/isolation/expected/drop-index-concurrently-1_2.out
new file mode 100644
index 00000000000..e540bbe1d7f
--- /dev/null
+++ b/src/test/isolation/expected/drop-index-concurrently-1_2.out
@@ -0,0 +1,42 @@
+Parsed test spec with 3 sessions
+
+starting permutation: noseq chkiso prepi preps begin explaini explains select2 drop insert2 end2 selecti selects end
+step noseq: SET enable_seqscan = false;
+step chkiso: SELECT (setting in ('read committed','read uncommitted')) AS is_read_committed FROM pg_settings WHERE name = 'default_transaction_isolation';
+is_read_committed
+
+f
+step prepi: PREPARE getrow_idx AS SELECT * FROM test_dc WHERE data=34 ORDER BY id,data;
+step preps: PREPARE getrow_seq AS SELECT * FROM test_dc WHERE data::text=34::text ORDER BY id,data;
+step begin: BEGIN;
+step explaini: EXPLAIN (COSTS OFF) EXECUTE getrow_idx;
+QUERY PLAN
+
+Sort
+ Sort Key: id
+ -> Index Scan using test_dc_data on test_dc
+ Index Cond: (data = 34)
+step explains: EXPLAIN (COSTS OFF) EXECUTE getrow_seq;
+QUERY PLAN
+
+Sort
+ Sort Key: id, data
+ -> Seq Scan on test_dc
+ Filter: ((data)::text = '34'::text)
+step select2: SELECT * FROM test_dc WHERE data=34 ORDER BY id,data;
+id data
+
+34 34
+step drop: DROP INDEX CONCURRENTLY test_dc_data; <waiting ...>
+step insert2: INSERT INTO test_dc(data) SELECT * FROM generate_series(1, 100);
+step end2: COMMIT;
+step selecti: EXECUTE getrow_idx;
+id data
+
+34 34
+step selects: EXECUTE getrow_seq;
+id data
+
+34 34
+step end: COMMIT;
+step drop: <... completed>
diff --git a/src/test/isolation/specs/drop-index-concurrently-1.spec b/src/test/isolation/specs/drop-index-concurrently-1.spec
index 8ebe5e6f0d9..dd42b70ddf3 100644
--- a/src/test/isolation/specs/drop-index-concurrently-1.spec
+++ b/src/test/isolation/specs/drop-index-concurrently-1.spec
@@ -1,7 +1,9 @@
# DROP INDEX CONCURRENTLY
#
# This test shows that the concurrent write behaviour works correctly
-# with the expected output being 2 rows.
+# with the expected output being 2 rows at the READ COMMITTED and READ
+# UNCOMMITTED transaction isolation levels, and 1 row at the other
+# transaction isolation levels.
#
setup
{
@@ -17,6 +19,7 @@ teardown
session "s1"
step "noseq" { SET enable_seqscan = false; }
+step "chkiso" { SELECT (setting in ('read committed','read uncommitted')) AS is_read_committed FROM pg_settings WHERE name = 'default_transaction_isolation'; }
step "prepi" { PREPARE getrow_idx AS SELECT * FROM test_dc WHERE data=34 ORDER BY id,data; }
step "preps" { PREPARE getrow_seq AS SELECT * FROM test_dc WHERE data::text=34::text ORDER BY id,data; }
step "begin" { BEGIN; }
@@ -35,4 +38,4 @@ step "end2" { COMMIT; }
session "s3"
step "drop" { DROP INDEX CONCURRENTLY test_dc_data; }
-permutation "noseq" "prepi" "preps" "begin" "explaini" "explains" "select2" "drop" "insert2" "end2" "selecti" "selects" "end"
+permutation "noseq" "chkiso" "prepi" "preps" "begin" "explaini" "explains" "select2" "drop" "insert2" "end2" "selecti" "selects" "end"