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

Commitb15a8c9

Browse files
committed
Clean up duplicate table and function names in regression tests.
Many of the objects we create during the regression tests are put in thepublic schema, so that using the same names in different regression testscreates 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 twolive hazards.The current situation in this regard is far worse than it was a year or twoback, because practically all of the partitioning-related test cases havereused table names with enthusiasm. I despaired of cleaning up that messwithin 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 usingnames like "foo", "bar", "tmp", etc, without thought for the fact thatother test scripts might use similar names concurrently. I've made aneffort to make all such names more specific.One of the live hazards was that commit7421f4b caused with.sql tocreate a table named "test", conflicting with a similarly-named tablein alter_table.sql; this was exposed in the buildfarm recently.The other one was that join.sql and transactions.sql both create tablesnamed "foo" and "bar"; but join.sql's uses of those names date backonly to December or so.Since commit7421f4b was back-patched to v10, back-patch a minimalfix for that problem. The rest of this is just future-proofing.Discussion:https://postgr.es/m/4627.1521070268@sss.pgh.pa.us
1 parent12bceca commitb15a8c9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

‎src/test/regress/expected/with.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2280,7 +2280,7 @@ LINE 1: WITH test AS (SELECT 42) INSERT INTO test VALUES (1);
22802280
-- check response to attempt to modify table with same name as a CTE (perhaps
22812281
-- surprisingly it works, because CTEs don't hide tables from data-modifying
22822282
-- statements)
2283-
create table test (i int);
2283+
createtemptable test (i int);
22842284
with test as (select 42) insert into test select * from test;
22852285
select * from test;
22862286
i

‎src/test/regress/sql/with.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,7 @@ WITH test AS (SELECT 42) INSERT INTO test VALUES (1);
10351035
-- check response to attempt to modify table with same name as a CTE (perhaps
10361036
-- surprisingly it works, because CTEs don't hide tables from data-modifying
10371037
-- statements)
1038-
createtabletest (iint);
1038+
createtemptable test (iint);
10391039
with testas (select42)insert into testselect*from test;
10401040
select*from test;
10411041
droptable test;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp