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