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

Commit2cf8c7a

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 parent1466bcf commit2cf8c7a

32 files changed

+2210
-2210
lines changed

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

Lines changed: 228 additions & 228 deletions
Large diffs are not rendered by default.

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ERROR: random() is not a procedure
88
LINE 1: CALL random();
99
^
1010
HINT: To call a function, use SELECT.
11-
CREATE FUNCTIONtestfunc1(a int) RETURNS int LANGUAGE SQL AS $$ SELECT a $$;
11+
CREATE FUNCTIONcp_testfunc1(a int) RETURNS int LANGUAGE SQL AS $$ SELECT a $$;
1212
CREATE TABLE cp_test (a int, b text);
1313
CREATE PROCEDURE ptest1(x text)
1414
LANGUAGE SQL
@@ -118,14 +118,14 @@ LINE 1: ALTER PROCEDURE ptest1(text) STRICT;
118118
^
119119
ALTER FUNCTION ptest1(text) VOLATILE; -- error: not a function
120120
ERROR: ptest1(text) is not a function
121-
ALTER PROCEDUREtestfunc1(int) VOLATILE; -- error: not a procedure
122-
ERROR:testfunc1(integer) is not a procedure
121+
ALTER PROCEDUREcp_testfunc1(int) VOLATILE; -- error: not a procedure
122+
ERROR:cp_testfunc1(integer) is not a procedure
123123
ALTER PROCEDURE nonexistent() VOLATILE;
124124
ERROR: procedure nonexistent() does not exist
125125
DROP FUNCTION ptest1(text); -- error: not a function
126126
ERROR: ptest1(text) is not a function
127-
DROP PROCEDUREtestfunc1(int); -- error: not a procedure
128-
ERROR:testfunc1(integer) is not a procedure
127+
DROP PROCEDUREcp_testfunc1(int); -- error: not a procedure
128+
ERROR:cp_testfunc1(integer) is not a procedure
129129
DROP PROCEDURE nonexistent();
130130
ERROR: procedure nonexistent() does not exist
131131
-- privileges
@@ -141,11 +141,11 @@ SET ROLE regress_cp_user1;
141141
CALL ptest1('a'); -- ok
142142
RESET ROLE;
143143
-- ROUTINE syntax
144-
ALTER ROUTINEtestfunc1(int) RENAME TOtestfunc1a;
145-
ALTER ROUTINEtestfunc1a RENAME TOtestfunc1;
144+
ALTER ROUTINEcp_testfunc1(int) RENAME TOcp_testfunc1a;
145+
ALTER ROUTINEcp_testfunc1a RENAME TOcp_testfunc1;
146146
ALTER ROUTINE ptest1(text) RENAME TO ptest1a;
147147
ALTER ROUTINE ptest1a RENAME TO ptest1;
148-
DROP ROUTINEtestfunc1(int);
148+
DROP ROUTINEcp_testfunc1(int);
149149
-- cleanup
150150
DROP PROCEDURE ptest1;
151151
DROP PROCEDURE ptest2;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp