Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit58af84f

Browse files
committed
Fix completely broken REINDEX SCHEMA testcase.
Aside from not testing the case it claimed to test (namely a permissionsfailure), it left a login-capable role lying around, which quite asidefrom possibly being a security hole would cause subsequent regression runsto fail since the role would already exist.
1 parent06d5803 commit58af84f

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 ROLEreindexuser login;
983-
SET SESSION ROLEuser_reindex;
982+
CREATE ROLEregression_reindexuser NOLOGIN;
983+
SET SESSION ROLEregression_reindexuser;
984984
REINDEX SCHEMA schema_to_reindex;
985985

986986
-- Clean up
987987
RESET ROLE;
988-
DROP ROLEuser_reindex;
988+
DROP ROLEregression_reindexuser;
989989
DROPSCHEMA schema_to_reindex CASCADE;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp