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

Commitcd5afd8

Browse files
committed
Add collation assignment to CALL statement
Otherwise functions that require collation information will not haveit if they are called in arguments to a CALL statement.Reported-by: Jean-Marc Voillequin <Jean-Marc.Voillequin@moodys.com>Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>Discussion:https://www.postgresql.org/message-id/flat/1EC8157EB499BF459A516ADCF135ADCE39FFAC54%40LON-WGMSX712.ad.moodys.net
1 parent793c736 commitcd5afd8

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

‎src/backend/parser/analyze.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2636,6 +2636,8 @@ transformCallStmt(ParseState *pstate, CallStmt *stmt)
26362636
true,
26372637
stmt->funccall->location);
26382638

2639+
assign_expr_collations(pstate,node);
2640+
26392641
stmt->funcexpr=castNode(FuncExpr,node);
26402642

26412643
result=makeNode(Query);

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,13 @@ AS $$
139139
SELECT NULL::int;
140140
$$;
141141
CALL ptest6(1, 2);
142+
-- collation assignment
143+
CREATE PROCEDURE ptest7(a text, b text)
144+
LANGUAGE SQL
145+
AS $$
146+
SELECT a = b;
147+
$$;
148+
CALL ptest7(least('a', 'b'), 'a');
142149
-- various error cases
143150
CALL version(); -- error: not a procedure
144151
ERROR: version() is not a procedure

‎src/test/regress/sql/create_procedure.sql

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,17 @@ $$;
101101
CALL ptest6(1,2);
102102

103103

104+
-- collation assignment
105+
106+
CREATE PROCEDURE ptest7(atext, btext)
107+
LANGUAGE SQL
108+
AS $$
109+
SELECT a= b;
110+
$$;
111+
112+
CALL ptest7(least('a','b'),'a');
113+
114+
104115
-- various error cases
105116

106117
CALL version();-- error: not a procedure

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp