mirror of https://github.com/citusdata/citus.git
Fix display of SQL-std func's args in INSERT/SELECT in ruleutils_15.c
Relevant PG commit: a8d8445a7b2f80f6d0bfe97b19f90bd2cbef8759boolean_node
parent
c5650a06e4
commit
8539162bfc
|
@ -3269,7 +3269,7 @@ get_insert_query_def(Query *query, deparse_context *context)
|
|||
if (select_rte)
|
||||
{
|
||||
/* Add the SELECT */
|
||||
get_query_def(select_rte->subquery, buf, NIL, NULL,
|
||||
get_query_def(select_rte->subquery, buf, context->namespaces, NULL,
|
||||
context->prettyFlags, context->wrapColumn,
|
||||
context->indentLevel);
|
||||
}
|
||||
|
@ -4722,10 +4722,12 @@ get_parameter(Param *param, deparse_context *context)
|
|||
* If it's an external parameter, see if the outermost namespace provides
|
||||
* function argument names.
|
||||
*/
|
||||
if (param->paramkind == PARAM_EXTERN)
|
||||
if (param->paramkind == PARAM_EXTERN && context->namespaces != NIL)
|
||||
{
|
||||
dpns = lfirst(list_tail(context->namespaces));
|
||||
if (dpns->argnames)
|
||||
dpns = llast(context->namespaces);
|
||||
if (dpns->argnames &&
|
||||
param->paramid > 0 &&
|
||||
param->paramid <= dpns->numargs)
|
||||
{
|
||||
char *argname = dpns->argnames[param->paramid - 1];
|
||||
|
||||
|
|
Loading…
Reference in New Issue