From: Tom Lane Date: Tue, 16 Oct 2018 17:56:58 +0000 (-0400) Subject: Avoid rare race condition in privileges.sql regression test. X-Git-Tag: REL9_3_25~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9d974fa39d264df2033ea04bf740d39acd5a3943;p=thirdparty%2Fpostgresql.git 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 --- diff --git a/src/test/regress/expected/privileges.out b/src/test/regress/expected/privileges.out index 24ec2a82f64..b41cad1b6e6 100644 --- a/src/test/regress/expected/privileges.out +++ b/src/test/regress/expected/privileges.out @@ -1093,6 +1093,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 85004b1128d..09403fe0a86 100644 --- a/src/test/regress/sql/privileges.sql +++ b/src/test/regress/sql/privileges.sql @@ -674,6 +674,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