mirror of https://github.com/citusdata/citus.git
Fix assorted missing logic for GroupingFunc nodes in ruleutils_15.c
Relevant PG commit: 2591ee8ec44d8cbc8e1226550337a64c684746e4naisila/failure_pg15
parent
c5a16eece5
commit
0764f315d0
|
@ -4698,12 +4698,13 @@ get_parameter(Param *param, deparse_context *context)
|
|||
context->varprefix = true;
|
||||
|
||||
/*
|
||||
* A Param's expansion is typically a Var, Aggref, or upper-level
|
||||
* Param, which wouldn't need extra parentheses. Otherwise, insert
|
||||
* parens to ensure the expression looks atomic.
|
||||
* A Param's expansion is typically a Var, Aggref, GroupingFunc, or
|
||||
* upper-level Param, which wouldn't need extra parentheses.
|
||||
* Otherwise, insert parens to ensure the expression looks atomic.
|
||||
*/
|
||||
need_paren = !(IsA(expr, Var) ||
|
||||
IsA(expr, Aggref) ||
|
||||
IsA(expr, GroupingFunc) ||
|
||||
IsA(expr, Param));
|
||||
if (need_paren)
|
||||
appendStringInfoChar(context->buf, '(');
|
||||
|
@ -4842,6 +4843,7 @@ isSimpleNode(Node *node, Node *parentNode, int prettyFlags)
|
|||
case T_NextValueExpr:
|
||||
case T_NullIfExpr:
|
||||
case T_Aggref:
|
||||
case T_GroupingFunc:
|
||||
case T_WindowFunc:
|
||||
case T_FuncExpr:
|
||||
/* function-like: name(..) or name[..] */
|
||||
|
@ -4958,6 +4960,7 @@ isSimpleNode(Node *node, Node *parentNode, int prettyFlags)
|
|||
case T_XmlExpr: /* own parentheses */
|
||||
case T_NullIfExpr: /* other separators */
|
||||
case T_Aggref: /* own parentheses */
|
||||
case T_GroupingFunc: /* own parentheses */
|
||||
case T_WindowFunc: /* own parentheses */
|
||||
case T_CaseExpr: /* other separators */
|
||||
return true;
|
||||
|
@ -5008,6 +5011,7 @@ isSimpleNode(Node *node, Node *parentNode, int prettyFlags)
|
|||
case T_XmlExpr: /* own parentheses */
|
||||
case T_NullIfExpr: /* other separators */
|
||||
case T_Aggref: /* own parentheses */
|
||||
case T_GroupingFunc: /* own parentheses */
|
||||
case T_WindowFunc: /* own parentheses */
|
||||
case T_CaseExpr: /* other separators */
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue