mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Add infrastructure for storing a VARIADIC ANY function's VARIADIC flag.
Originally we didn't bother to mark FuncExprs with any indication whether VARIADIC had been given in the source text, because there didn't seem to be any need for it at runtime. However, because we cannot fold a VARIADIC ANY function's arguments into an array (since they're not necessarily all the same type), we do actually need that information at runtime if VARIADIC ANY functions are to respond unsurprisingly to use of the VARIADIC keyword. Add the missing field, and also fix ruleutils.c so that VARIADIC ANY function calls are dumped properly. Extracted from a larger patch that also fixes concat() and format() (the only two extant VARIADIC ANY functions) to behave properly when VARIADIC is specified. This portion seems appropriate to review and commit separately. Pavel Stehule
This commit is contained in:
@@ -53,6 +53,6 @@
|
||||
*/
|
||||
|
||||
/* yyyymmddN */
|
||||
#define CATALOG_VERSION_NO 201301171
|
||||
#define CATALOG_VERSION_NO 201301211
|
||||
|
||||
#endif
|
||||
|
@@ -624,6 +624,7 @@ extern Oid get_fn_expr_argtype(FmgrInfo *flinfo, int argnum);
|
||||
extern Oid get_call_expr_argtype(fmNodePtr expr, int argnum);
|
||||
extern bool get_fn_expr_arg_stable(FmgrInfo *flinfo, int argnum);
|
||||
extern bool get_call_expr_arg_stable(fmNodePtr expr, int argnum);
|
||||
extern bool get_fn_expr_variadic(FmgrInfo *flinfo);
|
||||
|
||||
/*
|
||||
* Routines in dfmgr.c
|
||||
|
@@ -340,6 +340,7 @@ typedef struct FuncExpr
|
||||
Oid funcid; /* PG_PROC OID of the function */
|
||||
Oid funcresulttype; /* PG_TYPE OID of result value */
|
||||
bool funcretset; /* true if function returns set */
|
||||
bool funcvariadic; /* true if VARIADIC was used in call */
|
||||
CoercionForm funcformat; /* how to display this function call */
|
||||
Oid funccollid; /* OID of collation of result */
|
||||
Oid inputcollid; /* OID of collation that function should use */
|
||||
|
Reference in New Issue
Block a user