Skip to content

Commit

Permalink
Add support for PG17
Browse files Browse the repository at this point in the history
- A new node type is introduced for JSON support, that is
  JsonConstructorExpr - wrapper over FuncExpr/Aggref/WindowFunc for
  SQL/JSON constructors.
- Added additional checks for JsonConstructorExpr expression node for
  which the walker would crash.
- Removed palloc0fast function call (which is not available in PG17)
  • Loading branch information
uhayat committed Nov 7, 2024
1 parent c75d9e4 commit 77ccce8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/backend/nodes/ag_nodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ ExtensibleNode *_new_ag_node(Size size, ag_node_tag tag)
{
ExtensibleNode *n;

n = (ExtensibleNode *)palloc0fast(size);
n = (ExtensibleNode *)palloc0(size);
n->type = T_ExtensibleNode;
n->extnodename = node_names[tag];

Expand Down
10 changes: 8 additions & 2 deletions src/backend/parser/cypher_analyze.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,17 @@ static bool convert_cypher_walker(Node *node, ParseState *pstate)
* OpExpr - expression node for an operator invocation
* Const - constant value or expression node
* BoolExpr - expression node for the basic Boolean operators AND, OR, NOT
* JsonConstructorExpr - wrapper over FuncExpr/Aggref/WindowFunc for
* SQL/JSON constructors
*
* These are a special case that needs to be ignored.
*
*/
if (IsA(funcexpr, SQLValueFunction)
|| IsA(funcexpr, CoerceViaIO)
|| IsA(funcexpr, Var) || IsA(funcexpr, OpExpr)
|| IsA(funcexpr, Const) || IsA(funcexpr, BoolExpr))
|| IsA(funcexpr, Const) || IsA(funcexpr, BoolExpr)
|| IsA(funcexpr, JsonConstructorExpr))
{
return false;
}
Expand Down Expand Up @@ -346,14 +349,17 @@ static bool is_func_cypher(FuncExpr *funcexpr)
* OpExpr - expression node for an operator invocation
* Const - constant value or expression node
* BoolExpr - expression node for the basic Boolean operators AND, OR, NOT
* JsonConstructorExpr - wrapper over FuncExpr/Aggref/WindowFunc for
* SQL/JSON constructors
*
* These are a special case that needs to be ignored.
*
*/
if (IsA(funcexpr, SQLValueFunction)
|| IsA(funcexpr, CoerceViaIO)
|| IsA(funcexpr, Var) || IsA(funcexpr, OpExpr)
|| IsA(funcexpr, Const) || IsA(funcexpr, BoolExpr))
|| IsA(funcexpr, Const) || IsA(funcexpr, BoolExpr)
|| IsA(funcexpr, JsonConstructorExpr))
{
return false;
}
Expand Down

0 comments on commit 77ccce8

Please sign in to comment.