Avoid rare race condition in privileges.sql regression test.
authorTom Lane <[email protected]>
Tue, 16 Oct 2018 17:56:58 +0000 (13:56 -0400)
committerTom Lane <[email protected]>
Tue, 16 Oct 2018 17:56:58 +0000 (13:56 -0400)
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

src/test/regress/expected/privileges.out
src/test/regress/sql/privileges.sql

index d544fc9001e1d3f030e91fd18f7c6e565595b68d..996b4d9fd78c6f5928c933ec6b138ada3b4307a8 100644 (file)
@@ -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);
index 42af65bc7ed36d914413fdd34e16848cf38385fd..27441a8b23c530bbf31b55a9b6de6cbe192e3e25 100644 (file)
@@ -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