From 266e771435bfed648138f6b684c895c8225dc8fc Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 17 Jul 2015 14:10:52 -0400 Subject: [PATCH] Fix entirely broken permissions test in new alter_operator regression test. Not only did this test fail to test what it was supposed to test, but it left a user definition lying around, which caused subsequent runs of the regression tests to fail. --- src/test/regress/expected/alter_operator.out | 9 ++++----- src/test/regress/sql/alter_operator.sql | 8 +++----- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/test/regress/expected/alter_operator.out b/src/test/regress/expected/alter_operator.out index 2b996544c1..ce8366a139 100644 --- a/src/test/regress/expected/alter_operator.out +++ b/src/test/regress/expected/alter_operator.out @@ -66,11 +66,10 @@ ERROR: operator attribute "negator" can not be changed -- Test permission check. Must be owner to ALTER OPERATOR. -- CREATE USER regtest_alter_user; -SET SESSION AUTHORIZATION regtest_alter_user_user; -ERROR: role "regtest_alter_user_user" does not exist +SET SESSION AUTHORIZATION regtest_alter_user; ALTER OPERATOR === (boolean, boolean) SET (RESTRICT = NONE); -RESET SESSION AUTHORIZATION; +ERROR: must be owner of operator === -- Clean up -DROP USER regression_alter_user; -ERROR: role "regression_alter_user" does not exist +RESET SESSION AUTHORIZATION; +DROP USER regtest_alter_user; DROP OPERATOR === (boolean, boolean); diff --git a/src/test/regress/sql/alter_operator.sql b/src/test/regress/sql/alter_operator.sql index 535052731a..a7e1988682 100644 --- a/src/test/regress/sql/alter_operator.sql +++ b/src/test/regress/sql/alter_operator.sql @@ -48,17 +48,15 @@ ALTER OPERATOR === (boolean, boolean) SET (JOIN = non_existent_func); ALTER OPERATOR === (boolean, boolean) SET (COMMUTATOR = !==); ALTER OPERATOR === (boolean, boolean) SET (NEGATOR = !==); - -- -- Test permission check. Must be owner to ALTER OPERATOR. -- CREATE USER regtest_alter_user; -SET SESSION AUTHORIZATION regtest_alter_user_user; +SET SESSION AUTHORIZATION regtest_alter_user; ALTER OPERATOR === (boolean, boolean) SET (RESTRICT = NONE); -RESET SESSION AUTHORIZATION; - -- Clean up -DROP USER regression_alter_user; +RESET SESSION AUTHORIZATION; +DROP USER regtest_alter_user; DROP OPERATOR === (boolean, boolean); -- 2.40.0