Commit f7a953c2 authored by Tom Lane's avatar Tom Lane

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
parent fd85e9f7
...@@ -1189,6 +1189,7 @@ select has_column_privilege('mytable',2::int2,'select'); ...@@ -1189,6 +1189,7 @@ select has_column_privilege('mytable',2::int2,'select');
(1 row) (1 row)
drop table mytable;
-- Grant options -- Grant options
SET SESSION AUTHORIZATION regress_priv_user1; SET SESSION AUTHORIZATION regress_priv_user1;
CREATE TABLE atest4 (a int); CREATE TABLE atest4 (a int);
......
...@@ -732,6 +732,7 @@ select has_column_privilege('mytable','........pg.dropped.2........','select'); ...@@ -732,6 +732,7 @@ select has_column_privilege('mytable','........pg.dropped.2........','select');
select has_column_privilege('mytable',2::int2,'select'); select has_column_privilege('mytable',2::int2,'select');
revoke select on table mytable from regress_priv_user3; revoke select on table mytable from regress_priv_user3;
select has_column_privilege('mytable',2::int2,'select'); select has_column_privilege('mytable',2::int2,'select');
drop table mytable;
-- Grant options -- Grant options
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment