From 986085a7f08c72219abf47f8b968213e81ab943c Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 30 Apr 2006 18:30:40 +0000 Subject: 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. --- src/backend/nodes/outfuncs.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'src/backend/nodes/outfuncs.c') diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c index 314d68d2ef..25d3a11279 100644 --- a/src/backend/nodes/outfuncs.c +++ b/src/backend/nodes/outfuncs.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.273 2006/04/22 01:25:59 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.274 2006/04/30 18:30:39 tgl Exp $ * * NOTES * Every node type that can appear in stored rules' parsetrees *must* @@ -1418,7 +1418,7 @@ _outLockingClause(StringInfo str, LockingClause *node) WRITE_NODE_FIELD(lockedRels); WRITE_BOOL_FIELD(forUpdate); - WRITE_BOOL_FIELD(nowait); + WRITE_BOOL_FIELD(noWait); } static void @@ -1514,9 +1514,6 @@ _outQuery(StringInfo str, Query *node) WRITE_BOOL_FIELD(hasSubLinks); WRITE_NODE_FIELD(rtable); WRITE_NODE_FIELD(jointree); - WRITE_NODE_FIELD(rowMarks); - WRITE_BOOL_FIELD(forUpdate); - WRITE_BOOL_FIELD(rowNoWait); WRITE_NODE_FIELD(targetList); WRITE_NODE_FIELD(groupClause); WRITE_NODE_FIELD(havingQual); @@ -1524,6 +1521,7 @@ _outQuery(StringInfo str, Query *node) WRITE_NODE_FIELD(sortClause); WRITE_NODE_FIELD(limitOffset); WRITE_NODE_FIELD(limitCount); + WRITE_NODE_FIELD(rowMarks); WRITE_NODE_FIELD(setOperations); WRITE_NODE_FIELD(resultRelations); } @@ -1546,6 +1544,16 @@ _outGroupClause(StringInfo str, GroupClause *node) WRITE_OID_FIELD(sortop); } +static void +_outRowMarkClause(StringInfo str, RowMarkClause *node) +{ + WRITE_NODE_TYPE("ROWMARKCLAUSE"); + + WRITE_UINT_FIELD(rti); + WRITE_BOOL_FIELD(forUpdate); + WRITE_BOOL_FIELD(noWait); +} + static void _outSetOperationStmt(StringInfo str, SetOperationStmt *node) { @@ -2113,6 +2121,9 @@ _outNode(StringInfo str, void *obj) case T_GroupClause: _outGroupClause(str, obj); break; + case T_RowMarkClause: + _outRowMarkClause(str, obj); + break; case T_SetOperationStmt: _outSetOperationStmt(str, obj); break; -- cgit v1.2.1