diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-04-30 18:30:40 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-04-30 18:30:40 +0000 |
commit | 986085a7f08c72219abf47f8b968213e81ab943c (patch) | |
tree | a80d30e59cffd042ed9adb024afc5f5d6bf00e16 /src/backend/nodes/copyfuncs.c | |
parent | 931bfc96644b8f51a49161f780d43506e55d2b13 (diff) | |
download | postgresql-986085a7f08c72219abf47f8b968213e81ab943c.tar.gz postgresql-986085a7f08c72219abf47f8b968213e81ab943c.zip |
Improve the representation of FOR UPDATE/FOR SHARE so that we can
support both FOR UPDATE and FOR SHARE in one command, as well as both
NOWAIT and normal WAIT behavior. The more general code is actually
simpler and cleaner.
Diffstat (limited to 'src/backend/nodes/copyfuncs.c')
-rw-r--r-- | src/backend/nodes/copyfuncs.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c index b060d38b5ed..6bf342ab92c 100644 --- a/src/backend/nodes/copyfuncs.c +++ b/src/backend/nodes/copyfuncs.c @@ -15,7 +15,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.334 2006/04/22 01:25:58 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.335 2006/04/30 18:30:38 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1409,6 +1409,18 @@ _copyGroupClause(GroupClause *from) return newnode; } +static RowMarkClause * +_copyRowMarkClause(RowMarkClause *from) +{ + RowMarkClause *newnode = makeNode(RowMarkClause); + + COPY_SCALAR_FIELD(rti); + COPY_SCALAR_FIELD(forUpdate); + COPY_SCALAR_FIELD(noWait); + + return newnode; +} + static A_Expr * _copyAExpr(A_Expr *from) { @@ -1650,7 +1662,7 @@ _copyLockingClause(LockingClause *from) COPY_NODE_FIELD(lockedRels); COPY_SCALAR_FIELD(forUpdate); - COPY_SCALAR_FIELD(nowait); + COPY_SCALAR_FIELD(noWait); return newnode; } @@ -1673,9 +1685,6 @@ _copyQuery(Query *from) COPY_SCALAR_FIELD(hasSubLinks); COPY_NODE_FIELD(rtable); COPY_NODE_FIELD(jointree); - COPY_NODE_FIELD(rowMarks); - COPY_SCALAR_FIELD(forUpdate); - COPY_SCALAR_FIELD(rowNoWait); COPY_NODE_FIELD(targetList); COPY_NODE_FIELD(groupClause); COPY_NODE_FIELD(havingQual); @@ -1683,6 +1692,7 @@ _copyQuery(Query *from) COPY_NODE_FIELD(sortClause); COPY_NODE_FIELD(limitOffset); COPY_NODE_FIELD(limitCount); + COPY_NODE_FIELD(rowMarks); COPY_NODE_FIELD(setOperations); COPY_NODE_FIELD(resultRelations); @@ -3284,6 +3294,9 @@ copyObject(void *from) case T_GroupClause: retval = _copyGroupClause(from); break; + case T_RowMarkClause: + retval = _copyRowMarkClause(from); + break; case T_FkConstraint: retval = _copyFkConstraint(from); break; |