Skip to content

Commit 9213462

Browse files
committed
Make procedure OUT parameters work with JDBC
The JDBC driver sends OUT parameters with type void. This makes sense when calling a function, so that the parameters are ignored in ParseFuncOrColumn(). For a procedure call we want to treat them as unknown. Reviewed-by: Andrew Dunstan <andrew@dunslane.net> Discussion: https://www.postgresql.org/message-id/flat/d7e49540-ea92-b4e2-5fff-42036102f968%402ndquadrant.com
1 parent 8fed2ea commit 9213462

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/backend/parser/parse_param.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,15 @@ variable_paramref_hook(ParseState *pstate, ParamRef *pref)
163163
if (*pptype == InvalidOid)
164164
*pptype = UNKNOWNOID;
165165

166+
/*
167+
* If the argument is of type void and it's procedure call, interpret it
168+
* as unknown. This allows the JDBC driver to not have to distinguish
169+
* function and procedure calls. See also another component of this hack
170+
* in ParseFuncOrColumn().
171+
*/
172+
if (*pptype == VOIDOID && pstate->p_expr_kind == EXPR_KIND_CALL_ARGUMENT)
173+
*pptype = UNKNOWNOID;
174+
166175
param = makeNode(Param);
167176
param->paramkind = PARAM_EXTERN;
168177
param->paramid = paramno;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy