From c484134a53d3b1a82449305b0f0710f604f8e8cc Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 15 Mar 2018 14:00:31 -0400 Subject: [PATCH] Clean up duplicate role and schema names in regression tests. Since these names are global, using the same ones in different regression tests creates a hazard of test failures if any two such scripts run concurrently. Let's establish a policy of not doing that. In the cases where a conflict existed, I chose to rename both sides: in principle one script or the other could've been left in possession of the common name, but that seems to just invite more trouble of the same sort. There are a number of places where scripts are using names that seem unduly generic, but in the absence of actual conflicts I left them alone. In addition, fix insert.sql's use of "someone_else" as a role name. That's a flat out violation of longstanding project policy, so back-patch that change to v10 where the usage appeared. The rest of this is just future-proofing, as no two of these scripts are actually run concurrently in the existing parallel_schedule. Conflicts of schema-qualified names also exist, but will be dealt with separately. Discussion: https://postgr.es/m/4627.1521070268@sss.pgh.pa.us --- src/test/regress/expected/insert.out | 18 +++++++++--------- src/test/regress/sql/insert.sql | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/test/regress/expected/insert.out b/src/test/regress/expected/insert.out index 471426f5f7..e2f63933ec 100644 --- a/src/test/regress/expected/insert.out +++ b/src/test/regress/expected/insert.out @@ -429,16 +429,16 @@ drop table mlparted5; -- appropriate key description (or none) in various situations create table key_desc (a int, b int) partition by list ((a+0)); create table key_desc_1 partition of key_desc for values in (1) partition by range (b); -create user someone_else; -grant select (a) on key_desc_1 to someone_else; -grant insert on key_desc to someone_else; -set role someone_else; +create user regress_insert_other_user; +grant select (a) on key_desc_1 to regress_insert_other_user; +grant insert on key_desc to regress_insert_other_user; +set role regress_insert_other_user; -- no key description is shown insert into key_desc values (1, 1); ERROR: no partition of relation "key_desc_1" found for row reset role; -grant select (b) on key_desc_1 to someone_else; -set role someone_else; +grant select (b) on key_desc_1 to regress_insert_other_user; +set role regress_insert_other_user; -- key description (b)=(1) is now shown insert into key_desc values (1, 1); ERROR: no partition of relation "key_desc_1" found for row @@ -447,9 +447,9 @@ DETAIL: Partition key of the failing row contains (b) = (1). insert into key_desc values (2, 1); ERROR: no partition of relation "key_desc" found for row reset role; -revoke all on key_desc from someone_else; -revoke all on key_desc_1 from someone_else; -drop role someone_else; +revoke all on key_desc from regress_insert_other_user; +revoke all on key_desc_1 from regress_insert_other_user; +drop role regress_insert_other_user; drop table key_desc, key_desc_1; -- test minvalue/maxvalue restrictions create table mcrparted (a int, b int, c int) partition by range (a, abs(b), c); diff --git a/src/test/regress/sql/insert.sql b/src/test/regress/sql/insert.sql index c53f8bbb26..3e869acba8 100644 --- a/src/test/regress/sql/insert.sql +++ b/src/test/regress/sql/insert.sql @@ -280,26 +280,26 @@ drop table mlparted5; create table key_desc (a int, b int) partition by list ((a+0)); create table key_desc_1 partition of key_desc for values in (1) partition by range (b); -create user someone_else; -grant select (a) on key_desc_1 to someone_else; -grant insert on key_desc to someone_else; +create user regress_insert_other_user; +grant select (a) on key_desc_1 to regress_insert_other_user; +grant insert on key_desc to regress_insert_other_user; -set role someone_else; +set role regress_insert_other_user; -- no key description is shown insert into key_desc values (1, 1); reset role; -grant select (b) on key_desc_1 to someone_else; -set role someone_else; +grant select (b) on key_desc_1 to regress_insert_other_user; +set role regress_insert_other_user; -- key description (b)=(1) is now shown insert into key_desc values (1, 1); -- key description is not shown if key contains expression insert into key_desc values (2, 1); reset role; -revoke all on key_desc from someone_else; -revoke all on key_desc_1 from someone_else; -drop role someone_else; +revoke all on key_desc from regress_insert_other_user; +revoke all on key_desc_1 from regress_insert_other_user; +drop role regress_insert_other_user; drop table key_desc, key_desc_1; -- test minvalue/maxvalue restrictions -- 2.40.0