Skip to content

Commit 7bee1d5

Browse files
committed
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
1 parent 0a576cd commit 7bee1d5

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/test/regress/expected/privileges.out

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,6 +1155,7 @@ select has_column_privilege('mytable',2::int2,'select');
11551155

11561156
(1 row)
11571157

1158+
drop table mytable;
11581159
-- Grant options
11591160
SET SESSION AUTHORIZATION regress_user1;
11601161
CREATE TABLE atest4 (a int);

src/test/regress/sql/privileges.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,7 @@ select has_column_privilege('mytable','........pg.dropped.2........','select');
715715
select has_column_privilege('mytable',2::int2,'select');
716716
revoke select on table mytable from regress_user3;
717717
select has_column_privilege('mytable',2::int2,'select');
718+
drop table mytable;
718719

719720
-- Grant options
720721

0 commit comments

Comments
 (0)