aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Gierth <rhodiumtoad@postgresql.org>2017-03-17 14:35:54 +0000
committerAndrew Gierth <rhodiumtoad@postgresql.org>2017-03-17 14:46:15 +0000
commit733488dc6bbfb5027be9fdfcde1ee579c65187fe (patch)
tree4f13498b358852013775974b47cdfd12edbbb400 /src
parentd0aebf02b0a076c438837bafbb502c14575a0d37 (diff)
downloadpostgresql-733488dc6bbfb5027be9fdfcde1ee579c65187fe.tar.gz
postgresql-733488dc6bbfb5027be9fdfcde1ee579c65187fe.zip
Repair test for vacuum reltuples fix.
Concurrent auto-analyze could be holding a snapshot, affecting the removal of deleted row versions. Remove the deletion to avoid this happening. Per buildfarm. In passing, make the test independent of assumptions of physical row order, just out of sheer paranoia.
Diffstat (limited to 'src')
-rw-r--r--src/test/isolation/expected/vacuum-reltuples.out13
-rw-r--r--src/test/isolation/specs/vacuum-reltuples.spec7
2 files changed, 10 insertions, 10 deletions
diff --git a/src/test/isolation/expected/vacuum-reltuples.out b/src/test/isolation/expected/vacuum-reltuples.out
index ee3adf58050..337b7ab2528 100644
--- a/src/test/isolation/expected/vacuum-reltuples.out
+++ b/src/test/isolation/expected/vacuum-reltuples.out
@@ -3,7 +3,6 @@ Parsed test spec with 2 sessions
starting permutation: modify vac stats
step modify:
insert into smalltbl select max(id)+1 from smalltbl;
- delete from smalltbl where id in (select min(id) from smalltbl);
step vac:
vacuum smalltbl;
@@ -14,23 +13,22 @@ step stats:
relpages reltuples
-1 20
+1 21
starting permutation: modify open fetch1 vac close stats
step modify:
insert into smalltbl select max(id)+1 from smalltbl;
- delete from smalltbl where id in (select min(id) from smalltbl);
step open:
begin;
- declare c1 cursor for select * from smalltbl;
+ declare c1 cursor for select 1 as dummy from smalltbl;
step fetch1:
fetch next from c1;
-id
+dummy
-2
+1
step vac:
vacuum smalltbl;
@@ -48,7 +46,6 @@ relpages reltuples
starting permutation: modify vac stats
step modify:
insert into smalltbl select max(id)+1 from smalltbl;
- delete from smalltbl where id in (select min(id) from smalltbl);
step vac:
vacuum smalltbl;
@@ -59,4 +56,4 @@ step stats:
relpages reltuples
-1 20
+1 21
diff --git a/src/test/isolation/specs/vacuum-reltuples.spec b/src/test/isolation/specs/vacuum-reltuples.spec
index 52bc405547a..6d9fa010b3c 100644
--- a/src/test/isolation/specs/vacuum-reltuples.spec
+++ b/src/test/isolation/specs/vacuum-reltuples.spec
@@ -1,6 +1,10 @@
# Test for vacuum's handling of reltuples when pages are skipped due
# to page pins. We absolutely need to avoid setting reltuples=0 in
# such cases, since that interferes badly with planning.
+#
+# Expected result in second permutation is 20 tuples rather than 21 as
+# for the others, because vacuum should leave the previous result
+# (from before the insert) in place.
setup {
create table smalltbl
@@ -18,7 +22,7 @@ teardown {
session "worker"
step "open" {
begin;
- declare c1 cursor for select * from smalltbl;
+ declare c1 cursor for select 1 as dummy from smalltbl;
}
step "fetch1" {
fetch next from c1;
@@ -37,7 +41,6 @@ step "vac" {
}
step "modify" {
insert into smalltbl select max(id)+1 from smalltbl;
- delete from smalltbl where id in (select min(id) from smalltbl);
}
permutation "modify" "vac" "stats"