aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2018-10-16 13:56:58 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2018-10-16 13:56:58 -0400
commit7249d1d64127b0856d81d3774c7641712ab3a6ef (patch)
tree3ce8bc1fe58b26bbd5a4f326d5547b87fdd3e735
parent94ccffb2b5b22408f0f5395b820bcfa5c1b172d3 (diff)
downloadpostgresql-7249d1d64127b0856d81d3774c7641712ab3a6ef.tar.gz
postgresql-7249d1d64127b0856d81d3774c7641712ab3a6ef.zip
Avoid rare race condition in privileges.sql regression test.
We created a temp table, then switched to a new session, leaving the old session to clean up its temp objects in background. If that took long enough, the eventual attempt to drop the user that owns the temp table could fail, as exhibited today by sidewinder. Fix by dropping the temp table explicitly when we're done with it. It's been like this for quite some time, so back-patch to all supported branches. Report: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=sidewinder&dt=2018-10-16%2014%3A45%3A00
-rw-r--r--src/test/regress/expected/privileges.out1
-rw-r--r--src/test/regress/sql/privileges.sql1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/test/regress/expected/privileges.out b/src/test/regress/expected/privileges.out
index d08e9ede481..8f5e42bd681 100644
--- a/src/test/regress/expected/privileges.out
+++ b/src/test/regress/expected/privileges.out
@@ -1136,6 +1136,7 @@ select has_column_privilege('mytable',2::int2,'select');
(1 row)
+drop table mytable;
-- Grant options
SET SESSION AUTHORIZATION regressuser1;
CREATE TABLE atest4 (a int);
diff --git a/src/test/regress/sql/privileges.sql b/src/test/regress/sql/privileges.sql
index 3d75b6c5ef8..62641276517 100644
--- a/src/test/regress/sql/privileges.sql
+++ b/src/test/regress/sql/privileges.sql
@@ -706,6 +706,7 @@ select has_column_privilege('mytable','........pg.dropped.2........','select');
select has_column_privilege('mytable',2::int2,'select');
revoke select on table mytable from regressuser3;
select has_column_privilege('mytable',2::int2,'select');
+drop table mytable;
-- Grant options