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

Commitee63709

Browse files
committed
Solve cross-version-upgrade testing problem induced by1fb57af.
Renaming varchar_transform to varchar_support had a side effectI hadn't foreseen: the core regression tests leave around atransform object that relies on that function, so the namechange breaks cross-version upgrade tests, because the nameused in the older branches doesn't match.Since the dependency on varchar_transform was chosen with theaid of a dartboard anyway (it would surely not work as alanguage transform support function), fix by just choosinga different random builtin function with the right signature.Also add some comments explaining why this isn't horribly unsafe.I chose to make the same substitution in a couple of othercopied-and-pasted test cases, for consistency, though thosearen't directly contributing to the testing problem.Per buildfarm. Back-patch, else it doesn't fix the problem.
1 parentef9bf35 commitee63709

File tree

5 files changed

+16
-8
lines changed

5 files changed

+16
-8
lines changed

‎src/bin/pg_dump/t/002_pg_dump.pl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1936,9 +1936,9 @@
19361936
'CREATE TRANSFORM FOR int' => {
19371937
create_order => 34,
19381938
create_sql =>
1939-
'CREATE TRANSFORM FOR int LANGUAGE SQL (FROM SQL WITH FUNCTIONvarchar_transform(internal), TO SQL WITH FUNCTION int4recv(internal));',
1939+
'CREATE TRANSFORM FOR int LANGUAGE SQL (FROM SQL WITH FUNCTIONprsd_lextype(internal), TO SQL WITH FUNCTION int4recv(internal));',
19401940
regexp =>
1941-
qr/CREATE TRANSFORM FOR integer LANGUAGE sql\(FROM SQL WITH FUNCTION pg_catalog\.varchar_transform\(internal\), TO SQL WITH FUNCTION pg_catalog\.int4recv\(internal\)\);/m,
1941+
qr/CREATE TRANSFORM FOR integer LANGUAGE sql\(FROM SQL WITH FUNCTION pg_catalog\.prsd_lextype\(internal\), TO SQL WITH FUNCTION pg_catalog\.int4recv\(internal\)\);/m,
19421942
like => {%full_runs, section_pre_data => 1, },
19431943
},
19441944

‎src/test/modules/test_ddl_deparse/expected/create_transform.out

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
-- The function FROM SQL should have internal as single argument as well
66
-- as return type. The function TO SQL should have as single argument
77
-- internal and as return argument the datatype of the transform done.
8-
-- pl/plpgsql does not authorize the use of internal as data type.
8+
-- We choose some random built-in functions that have the right signature.
9+
-- This won't actually be used, because the SQL function language
10+
-- doesn't implement transforms (there would be no point).
911
CREATE TRANSFORM FOR int LANGUAGE SQL (
10-
FROM SQL WITH FUNCTIONvarchar_transform(internal),
12+
FROM SQL WITH FUNCTIONprsd_lextype(internal),
1113
TO SQL WITH FUNCTION int4recv(internal));
1214
NOTICE: DDL test: type simple, tag CREATE TRANSFORM
1315
DROP TRANSFORM FOR int LANGUAGE SQL;

‎src/test/modules/test_ddl_deparse/sql/create_transform.sql

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
-- The function FROM SQL should have internal as single argument as well
77
-- as return type. The function TO SQL should have as single argument
88
-- internal and as return argument the datatype of the transform done.
9-
-- pl/plpgsql does not authorize the use of internal as data type.
9+
-- We choose some random built-in functions that have the right signature.
10+
-- This won't actually be used, because the SQL function language
11+
-- doesn't implement transforms (there would be no point).
1012
CREATE TRANSFORM FORint LANGUAGE SQL (
11-
FROM SQL WITH FUNCTIONvarchar_transform(internal),
13+
FROM SQL WITH FUNCTIONprsd_lextype(internal),
1214
TO SQL WITH FUNCTION int4recv(internal));
1315

1416
DROP TRANSFORM FORint LANGUAGE SQL;

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ CREATE SERVER "integer" FOREIGN DATA WRAPPER addr_fdw;
3737
CREATE USER MAPPING FOR regress_addr_user SERVER "integer";
3838
ALTER DEFAULT PRIVILEGES FOR ROLE regress_addr_user IN SCHEMA public GRANT ALL ON TABLES TO regress_addr_user;
3939
ALTER DEFAULT PRIVILEGES FOR ROLE regress_addr_user REVOKE DELETE ON TABLES FROM regress_addr_user;
40+
-- this transform would be quite unsafe to leave lying around,
41+
-- except that the SQL language pays no attention to transforms:
4042
CREATE TRANSFORM FOR int LANGUAGE SQL (
41-
FROM SQL WITH FUNCTIONvarchar_transform(internal),
43+
FROM SQL WITH FUNCTIONprsd_lextype(internal),
4244
TO SQL WITH FUNCTION int4recv(internal));
4345
CREATE PUBLICATION addr_pub FOR TABLE addr_nsp.gentable;
4446
CREATE SUBSCRIPTION addr_sub CONNECTION '' PUBLICATION bar WITH (connect = false, slot_name = NONE);

‎src/test/regress/sql/object_address.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ CREATE SERVER "integer" FOREIGN DATA WRAPPER addr_fdw;
4040
CREATEUSERMAPPING FOR regress_addr_user SERVER"integer";
4141
ALTER DEFAULT PRIVILEGES FOR ROLE regress_addr_userIN SCHEMA publicGRANT ALLON TABLES TO regress_addr_user;
4242
ALTER DEFAULT PRIVILEGES FOR ROLE regress_addr_userREVOKEDELETEON TABLESFROM regress_addr_user;
43+
-- this transform would be quite unsafe to leave lying around,
44+
-- except that the SQL language pays no attention to transforms:
4345
CREATE TRANSFORM FORint LANGUAGE SQL (
44-
FROM SQL WITH FUNCTIONvarchar_transform(internal),
46+
FROM SQL WITH FUNCTIONprsd_lextype(internal),
4547
TO SQL WITH FUNCTION int4recv(internal));
4648
CREATE PUBLICATION addr_pub FOR TABLEaddr_nsp.gentable;
4749
CREATE SUBSCRIPTION addr_sub CONNECTION'' PUBLICATION bar WITH (connect= false, slot_name= NONE);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp