1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-08 11:42:09 +03:00

Modified files for MERGE

This commit is contained in:
Simon Riggs
2018-04-02 21:12:47 +01:00
parent e6597dc353
commit 354f13855e
82 changed files with 2570 additions and 165 deletions

View File

@ -207,6 +207,7 @@ _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);
@ -222,6 +223,8 @@ _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;
}
@ -2977,6 +2980,9 @@ _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);
@ -3040,6 +3046,34 @@ _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)
{
@ -5102,6 +5136,12 @@ 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;