summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2018-10-16 17:56:58 +0000
committerTom Lane2018-10-16 17:56:58 +0000
commit75b3b137009991b996d56e91648cfacd1ed9f66a (patch)
treefde0562dae2d723b6d802f3cfeedc4093853cfa3
parenta485bacef177b4cd476b9437f8fb6cb8dce58944 (diff)
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 33f8e25bfad..016cb8b4a50 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 regress_user1;
CREATE TABLE atest4 (a int);
diff --git a/src/test/regress/sql/privileges.sql b/src/test/regress/sql/privileges.sql
index f587ba3b6df..ccccfb7d481 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 regress_user3;
select has_column_privilege('mytable',2::int2,'select');
+drop table mytable;
-- Grant options