pgsql: Clean up duplicate table and function names in regressiontests. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Clean up duplicate table and function names in regressiontests.
Date
Msg-id E1ewa7c-0005CR-N7@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Clean up duplicate table and function names in regression tests.

Many of the objects we create during the regression tests are put in the
public schema, so that using the same names in different regression tests
creates a hazard of test failures if any two such scripts run concurrently.
This patch cleans up a bunch of latent hazards of that sort, as well as two
live hazards.

The current situation in this regard is far worse than it was a year or two
back, because practically all of the partitioning-related test cases have
reused table names with enthusiasm.  I despaired of cleaning up that mess
within the five most-affected tests (create_table, alter_table, insert,
update, inherit); fortunately those don't run concurrently.

Other than partitioning problems, most of the issues boil down to using
names like "foo", "bar", "tmp", etc, without thought for the fact that
other test scripts might use similar names concurrently.  I've made an
effort to make all such names more specific.

One of the live hazards was that commit 7421f4b8 caused with.sql to
create a table named "test", conflicting with a similarly-named table
in alter_table.sql; this was exposed in the buildfarm recently.
The other one was that join.sql and transactions.sql both create tables
named "foo" and "bar"; but join.sql's uses of those names date back
only to December or so.

Since commit 7421f4b8 was back-patched to v10, back-patch a minimal
fix for that problem.  The rest of this is just future-proofing.

Discussion: https://postgr.es/m/4627.1521070268@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/2cf8c7aa48559699f0607f5cb77b661156ad9750

Modified Files
--------------
src/test/regress/expected/alter_table.out      | 456 +++++++-------
src/test/regress/expected/create_procedure.out |  16 +-
src/test/regress/expected/foreign_data.out     | 338 +++++------
src/test/regress/expected/indirect_toast.out   |  48 +-
src/test/regress/expected/join.out             | 166 +++---
src/test/regress/expected/plancache.out        |  24 +-
src/test/regress/expected/plpgsql.out          | 126 ++--
src/test/regress/expected/polymorphism.out     |  26 +-
src/test/regress/expected/privileges.out       | 302 +++++-----
src/test/regress/expected/rangefuncs.out       | 788 ++++++++++++-------------
src/test/regress/expected/rules.out            |  90 +--
src/test/regress/expected/select_into.out      |   8 +-
src/test/regress/expected/select_parallel.out  |  36 +-
src/test/regress/expected/transactions.out     |  64 +-
src/test/regress/expected/updatable_views.out  |  60 +-
src/test/regress/expected/with.out             |  38 +-
src/test/regress/sql/alter_table.sql           | 368 ++++++------
src/test/regress/sql/create_procedure.sql      |  12 +-
src/test/regress/sql/foreign_data.sql          | 192 +++---
src/test/regress/sql/indirect_toast.sql        |  48 +-
src/test/regress/sql/join.sql                  | 106 ++--
src/test/regress/sql/plancache.sql             |  18 +-
src/test/regress/sql/plpgsql.sql               |  80 +--
src/test/regress/sql/polymorphism.sql          |  20 +-
src/test/regress/sql/privileges.sql            | 226 +++----
src/test/regress/sql/rangefuncs.sql            | 524 ++++++++--------
src/test/regress/sql/rules.sql                 |  76 +--
src/test/regress/sql/select_into.sql           |   8 +-
src/test/regress/sql/select_parallel.sql       |  20 +-
src/test/regress/sql/transactions.sql          |  48 +-
src/test/regress/sql/updatable_views.sql       |  50 +-
src/test/regress/sql/with.sql                  |  38 +-
32 files changed, 2210 insertions(+), 2210 deletions(-)


pgsql-committers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: pgsql: Move strtoint() to common
Next
From: Tom Lane
Date:
Subject: Re: pgsql: Move strtoint() to common