Skip to content
Snippets Groups Projects
Commit 58af84f4 authored by Tom Lane's avatar Tom Lane
Browse files

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.
parent 06d5803f
No related branches found
No related tags found
No related merge requests found
...@@ -2846,14 +2846,13 @@ REINDEX SCHEMA schema_to_reindex; -- failure, cannot run in a transaction ...@@ -2846,14 +2846,13 @@ REINDEX SCHEMA schema_to_reindex; -- failure, cannot run in a transaction
ERROR: REINDEX SCHEMA cannot run inside a transaction block ERROR: REINDEX SCHEMA cannot run inside a transaction block
END; END;
-- Failure for unauthorized user -- Failure for unauthorized user
CREATE ROLE reindexuser login; CREATE ROLE regression_reindexuser NOLOGIN;
SET SESSION ROLE user_reindex; SET SESSION ROLE regression_reindexuser;
ERROR: role "user_reindex" does not exist
REINDEX SCHEMA schema_to_reindex; REINDEX SCHEMA schema_to_reindex;
ERROR: must be owner of schema schema_to_reindex
-- Clean up -- Clean up
RESET ROLE; RESET ROLE;
DROP ROLE user_reindex; DROP ROLE regression_reindexuser;
ERROR: role "user_reindex" does not exist
DROP SCHEMA schema_to_reindex CASCADE; DROP SCHEMA schema_to_reindex CASCADE;
NOTICE: drop cascades to 2 other objects NOTICE: drop cascades to 2 other objects
DETAIL: drop cascades to table schema_to_reindex.table1 DETAIL: drop cascades to table schema_to_reindex.table1
......
...@@ -979,11 +979,11 @@ REINDEX SCHEMA schema_to_reindex; -- failure, cannot run in a transaction ...@@ -979,11 +979,11 @@ REINDEX SCHEMA schema_to_reindex; -- failure, cannot run in a transaction
END; END;
-- Failure for unauthorized user -- Failure for unauthorized user
CREATE ROLE reindexuser login; CREATE ROLE regression_reindexuser NOLOGIN;
SET SESSION ROLE user_reindex; SET SESSION ROLE regression_reindexuser;
REINDEX SCHEMA schema_to_reindex; REINDEX SCHEMA schema_to_reindex;
-- Clean up -- Clean up
RESET ROLE; RESET ROLE;
DROP ROLE user_reindex; DROP ROLE regression_reindexuser;
DROP SCHEMA schema_to_reindex CASCADE; DROP SCHEMA schema_to_reindex CASCADE;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment