diff options
Diffstat (limited to 'src/backend/nodes')
-rw-r--r-- | src/backend/nodes/copyfuncs.c | 40 | ||||
-rw-r--r-- | src/backend/nodes/equalfuncs.c | 32 | ||||
-rw-r--r-- | src/backend/nodes/nodeFuncs.c | 48 | ||||
-rw-r--r-- | src/backend/nodes/outfuncs.c | 25 | ||||
-rw-r--r-- | src/backend/nodes/readfuncs.c | 6 |
5 files changed, 3 insertions, 148 deletions
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c index 770ed3b1a88..c7293a60d78 100644 --- a/src/backend/nodes/copyfuncs.c +++ b/src/backend/nodes/copyfuncs.c @@ -207,7 +207,6 @@ _copyModifyTable(const ModifyTable *from) COPY_NODE_FIELD(partitioned_rels); COPY_SCALAR_FIELD(partColsUpdated); COPY_NODE_FIELD(resultRelations); - COPY_SCALAR_FIELD(mergeTargetRelation); COPY_SCALAR_FIELD(resultRelIndex); COPY_SCALAR_FIELD(rootResultRelIndex); COPY_NODE_FIELD(plans); @@ -223,8 +222,6 @@ _copyModifyTable(const ModifyTable *from) COPY_NODE_FIELD(onConflictWhere); COPY_SCALAR_FIELD(exclRelRTI); COPY_NODE_FIELD(exclRelTlist); - COPY_NODE_FIELD(mergeSourceTargetList); - COPY_NODE_FIELD(mergeActionList); return newnode; } @@ -2980,9 +2977,6 @@ _copyQuery(const Query *from) COPY_NODE_FIELD(setOperations); COPY_NODE_FIELD(constraintDeps); COPY_NODE_FIELD(withCheckOptions); - COPY_SCALAR_FIELD(mergeTarget_relation); - COPY_NODE_FIELD(mergeSourceTargetList); - COPY_NODE_FIELD(mergeActionList); COPY_LOCATION_FIELD(stmt_location); COPY_LOCATION_FIELD(stmt_len); @@ -3046,34 +3040,6 @@ _copyUpdateStmt(const UpdateStmt *from) return newnode; } -static MergeStmt * -_copyMergeStmt(const MergeStmt *from) -{ - MergeStmt *newnode = makeNode(MergeStmt); - - COPY_NODE_FIELD(relation); - COPY_NODE_FIELD(source_relation); - COPY_NODE_FIELD(join_condition); - COPY_NODE_FIELD(mergeActionList); - - return newnode; -} - -static MergeAction * -_copyMergeAction(const MergeAction *from) -{ - MergeAction *newnode = makeNode(MergeAction); - - COPY_SCALAR_FIELD(matched); - COPY_SCALAR_FIELD(commandType); - COPY_NODE_FIELD(condition); - COPY_NODE_FIELD(qual); - COPY_NODE_FIELD(stmt); - COPY_NODE_FIELD(targetList); - - return newnode; -} - static SelectStmt * _copySelectStmt(const SelectStmt *from) { @@ -5136,12 +5102,6 @@ copyObjectImpl(const void *from) case T_UpdateStmt: retval = _copyUpdateStmt(from); break; - case T_MergeStmt: - retval = _copyMergeStmt(from); - break; - case T_MergeAction: - retval = _copyMergeAction(from); - break; case T_SelectStmt: retval = _copySelectStmt(from); break; diff --git a/src/backend/nodes/equalfuncs.c b/src/backend/nodes/equalfuncs.c index 5a0151eece5..765b1be74b3 100644 --- a/src/backend/nodes/equalfuncs.c +++ b/src/backend/nodes/equalfuncs.c @@ -987,8 +987,6 @@ _equalQuery(const Query *a, const Query *b) COMPARE_NODE_FIELD(setOperations); COMPARE_NODE_FIELD(constraintDeps); COMPARE_NODE_FIELD(withCheckOptions); - COMPARE_NODE_FIELD(mergeSourceTargetList); - COMPARE_NODE_FIELD(mergeActionList); COMPARE_LOCATION_FIELD(stmt_location); COMPARE_LOCATION_FIELD(stmt_len); @@ -1045,30 +1043,6 @@ _equalUpdateStmt(const UpdateStmt *a, const UpdateStmt *b) } static bool -_equalMergeStmt(const MergeStmt *a, const MergeStmt *b) -{ - COMPARE_NODE_FIELD(relation); - COMPARE_NODE_FIELD(source_relation); - COMPARE_NODE_FIELD(join_condition); - COMPARE_NODE_FIELD(mergeActionList); - - return true; -} - -static bool -_equalMergeAction(const MergeAction *a, const MergeAction *b) -{ - COMPARE_SCALAR_FIELD(matched); - COMPARE_SCALAR_FIELD(commandType); - COMPARE_NODE_FIELD(condition); - COMPARE_NODE_FIELD(qual); - COMPARE_NODE_FIELD(stmt); - COMPARE_NODE_FIELD(targetList); - - return true; -} - -static bool _equalSelectStmt(const SelectStmt *a, const SelectStmt *b) { COMPARE_NODE_FIELD(distinctClause); @@ -3259,12 +3233,6 @@ equal(const void *a, const void *b) case T_UpdateStmt: retval = _equalUpdateStmt(a, b); break; - case T_MergeStmt: - retval = _equalMergeStmt(a, b); - break; - case T_MergeAction: - retval = _equalMergeAction(a, b); - break; case T_SelectStmt: retval = _equalSelectStmt(a, b); break; diff --git a/src/backend/nodes/nodeFuncs.c b/src/backend/nodes/nodeFuncs.c index 68e2cec66e4..6c76c41ebea 100644 --- a/src/backend/nodes/nodeFuncs.c +++ b/src/backend/nodes/nodeFuncs.c @@ -2146,16 +2146,6 @@ expression_tree_walker(Node *node, return true; } break; - case T_MergeAction: - { - MergeAction *action = (MergeAction *) node; - - if (walker(action->targetList, context)) - return true; - if (walker(action->qual, context)) - return true; - } - break; case T_JoinExpr: { JoinExpr *join = (JoinExpr *) node; @@ -2265,10 +2255,6 @@ query_tree_walker(Query *query, return true; if (walker((Node *) query->onConflict, context)) return true; - if (walker((Node *) query->mergeSourceTargetList, context)) - return true; - if (walker((Node *) query->mergeActionList, context)) - return true; if (walker((Node *) query->returningList, context)) return true; if (walker((Node *) query->jointree, context)) @@ -2946,18 +2932,6 @@ expression_tree_mutator(Node *node, return (Node *) newnode; } break; - case T_MergeAction: - { - MergeAction *action = (MergeAction *) node; - MergeAction *newnode; - - FLATCOPY(newnode, action, MergeAction); - MUTATE(newnode->qual, action->qual, Node *); - MUTATE(newnode->targetList, action->targetList, List *); - - return (Node *) newnode; - } - break; case T_JoinExpr: { JoinExpr *join = (JoinExpr *) node; @@ -3109,8 +3083,6 @@ query_tree_mutator(Query *query, MUTATE(query->targetList, query->targetList, List *); MUTATE(query->withCheckOptions, query->withCheckOptions, List *); MUTATE(query->onConflict, query->onConflict, OnConflictExpr *); - MUTATE(query->mergeSourceTargetList, query->mergeSourceTargetList, List *); - MUTATE(query->mergeActionList, query->mergeActionList, List *); MUTATE(query->returningList, query->returningList, List *); MUTATE(query->jointree, query->jointree, FromExpr *); MUTATE(query->setOperations, query->setOperations, Node *); @@ -3252,9 +3224,9 @@ query_or_expression_tree_mutator(Node *node, * boundaries: we descend to everything that's possibly interesting. * * Currently, the node type coverage here extends only to DML statements - * (SELECT/INSERT/UPDATE/DELETE/MERGE) and nodes that can appear in them, - * because this is used mainly during analysis of CTEs, and only DML - * statements can appear in CTEs. + * (SELECT/INSERT/UPDATE/DELETE) and nodes that can appear in them, because + * this is used mainly during analysis of CTEs, and only DML statements can + * appear in CTEs. */ bool raw_expression_tree_walker(Node *node, @@ -3434,20 +3406,6 @@ raw_expression_tree_walker(Node *node, return true; } break; - case T_MergeStmt: - { - MergeStmt *stmt = (MergeStmt *) node; - - if (walker(stmt->relation, context)) - return true; - if (walker(stmt->source_relation, context)) - return true; - if (walker(stmt->join_condition, context)) - return true; - if (walker(stmt->mergeActionList, context)) - return true; - } - break; case T_SelectStmt: { SelectStmt *stmt = (SelectStmt *) node; diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c index 9ebea550485..f61ae03ac50 100644 --- a/src/backend/nodes/outfuncs.c +++ b/src/backend/nodes/outfuncs.c @@ -375,7 +375,6 @@ _outModifyTable(StringInfo str, const ModifyTable *node) WRITE_NODE_FIELD(partitioned_rels); WRITE_BOOL_FIELD(partColsUpdated); WRITE_NODE_FIELD(resultRelations); - WRITE_INT_FIELD(mergeTargetRelation); WRITE_INT_FIELD(resultRelIndex); WRITE_INT_FIELD(rootResultRelIndex); WRITE_NODE_FIELD(plans); @@ -391,21 +390,6 @@ _outModifyTable(StringInfo str, const ModifyTable *node) WRITE_NODE_FIELD(onConflictWhere); WRITE_UINT_FIELD(exclRelRTI); WRITE_NODE_FIELD(exclRelTlist); - WRITE_NODE_FIELD(mergeSourceTargetList); - WRITE_NODE_FIELD(mergeActionList); -} - -static void -_outMergeAction(StringInfo str, const MergeAction *node) -{ - WRITE_NODE_TYPE("MERGEACTION"); - - WRITE_BOOL_FIELD(matched); - WRITE_ENUM_FIELD(commandType, CmdType); - WRITE_NODE_FIELD(condition); - WRITE_NODE_FIELD(qual); - /* We don't dump the stmt node */ - WRITE_NODE_FIELD(targetList); } static void @@ -2130,7 +2114,6 @@ _outModifyTablePath(StringInfo str, const ModifyTablePath *node) WRITE_NODE_FIELD(partitioned_rels); WRITE_BOOL_FIELD(partColsUpdated); WRITE_NODE_FIELD(resultRelations); - WRITE_INT_FIELD(mergeTargetRelation); WRITE_NODE_FIELD(subpaths); WRITE_NODE_FIELD(subroots); WRITE_NODE_FIELD(withCheckOptionLists); @@ -2138,8 +2121,6 @@ _outModifyTablePath(StringInfo str, const ModifyTablePath *node) WRITE_NODE_FIELD(rowMarks); WRITE_NODE_FIELD(onconflict); WRITE_INT_FIELD(epqParam); - WRITE_NODE_FIELD(mergeSourceTargetList); - WRITE_NODE_FIELD(mergeActionList); } static void @@ -2961,9 +2942,6 @@ _outQuery(StringInfo str, const Query *node) WRITE_NODE_FIELD(setOperations); WRITE_NODE_FIELD(constraintDeps); /* withCheckOptions intentionally omitted, see comment in parsenodes.h */ - WRITE_INT_FIELD(mergeTarget_relation); - WRITE_NODE_FIELD(mergeSourceTargetList); - WRITE_NODE_FIELD(mergeActionList); WRITE_LOCATION_FIELD(stmt_location); WRITE_LOCATION_FIELD(stmt_len); } @@ -3679,9 +3657,6 @@ outNode(StringInfo str, const void *obj) case T_ModifyTable: _outModifyTable(str, obj); break; - case T_MergeAction: - _outMergeAction(str, obj); - break; case T_Append: _outAppend(str, obj); break; diff --git a/src/backend/nodes/readfuncs.c b/src/backend/nodes/readfuncs.c index 694bb3fc404..d02d4ec5b7c 100644 --- a/src/backend/nodes/readfuncs.c +++ b/src/backend/nodes/readfuncs.c @@ -270,9 +270,6 @@ _readQuery(void) READ_NODE_FIELD(setOperations); READ_NODE_FIELD(constraintDeps); /* withCheckOptions intentionally omitted, see comment in parsenodes.h */ - READ_INT_FIELD(mergeTarget_relation); - READ_NODE_FIELD(mergeSourceTargetList); - READ_NODE_FIELD(mergeActionList); READ_LOCATION_FIELD(stmt_location); READ_LOCATION_FIELD(stmt_len); @@ -1579,7 +1576,6 @@ _readModifyTable(void) READ_NODE_FIELD(partitioned_rels); READ_BOOL_FIELD(partColsUpdated); READ_NODE_FIELD(resultRelations); - READ_INT_FIELD(mergeTargetRelation); READ_INT_FIELD(resultRelIndex); READ_INT_FIELD(rootResultRelIndex); READ_NODE_FIELD(plans); @@ -1595,8 +1591,6 @@ _readModifyTable(void) READ_NODE_FIELD(onConflictWhere); READ_UINT_FIELD(exclRelRTI); READ_NODE_FIELD(exclRelTlist); - READ_NODE_FIELD(mergeSourceTargetList); - READ_NODE_FIELD(mergeActionList); READ_DONE(); } |