Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 58af84f

Browse files
committed
Fix completely broken REINDEX SCHEMA testcase.
Aside from not testing the case it claimed to test (namely a permissions failure), it left a login-capable role lying around, which quite aside from possibly being a security hole would cause subsequent regression runs to fail since the role would already exist.
1 parent 06d5803 commit 58af84f

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/test/regress/expected/create_index.out

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2846,14 +2846,13 @@ REINDEX SCHEMA schema_to_reindex; -- failure, cannot run in a transaction
28462846
ERROR: REINDEX SCHEMA cannot run inside a transaction block
28472847
END;
28482848
-- Failure for unauthorized user
2849-
CREATE ROLE reindexuser login;
2850-
SET SESSION ROLE user_reindex;
2851-
ERROR: role "user_reindex" does not exist
2849+
CREATE ROLE regression_reindexuser NOLOGIN;
2850+
SET SESSION ROLE regression_reindexuser;
28522851
REINDEX SCHEMA schema_to_reindex;
2852+
ERROR: must be owner of schema schema_to_reindex
28532853
-- Clean up
28542854
RESET ROLE;
2855-
DROP ROLE user_reindex;
2856-
ERROR: role "user_reindex" does not exist
2855+
DROP ROLE regression_reindexuser;
28572856
DROP SCHEMA schema_to_reindex CASCADE;
28582857
NOTICE: drop cascades to 2 other objects
28592858
DETAIL: drop cascades to table schema_to_reindex.table1

src/test/regress/sql/create_index.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -979,11 +979,11 @@ REINDEX SCHEMA schema_to_reindex; -- failure, cannot run in a transaction
979979
END;
980980

981981
-- Failure for unauthorized user
982-
CREATE ROLE reindexuser login;
983-
SET SESSION ROLE user_reindex;
982+
CREATE ROLE regression_reindexuser NOLOGIN;
983+
SET SESSION ROLE regression_reindexuser;
984984
REINDEX SCHEMA schema_to_reindex;
985985

986986
-- Clean up
987987
RESET ROLE;
988-
DROP ROLE user_reindex;
988+
DROP ROLE regression_reindexuser;
989989
DROP SCHEMA schema_to_reindex CASCADE;

0 commit comments

Comments
 (0)