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/readfuncs.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'src/backend/nodes/readfuncs.c') diff --git a/src/backend/nodes/readfuncs.c b/src/backend/nodes/readfuncs.c index 9fdf02fd568..dd6995a1722 100644 --- a/src/backend/nodes/readfuncs.c +++ b/src/backend/nodes/readfuncs.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/nodes/readfuncs.c,v 1.188 2006/04/22 01:25:59 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/nodes/readfuncs.c,v 1.189 2006/04/30 18:30:39 tgl Exp $ * * NOTES * Path and Plan nodes do not have any readfuncs support, because we @@ -147,9 +147,6 @@ _readQuery(void) READ_BOOL_FIELD(hasSubLinks); READ_NODE_FIELD(rtable); READ_NODE_FIELD(jointree); - READ_NODE_FIELD(rowMarks); - READ_BOOL_FIELD(forUpdate); - READ_BOOL_FIELD(rowNoWait); READ_NODE_FIELD(targetList); READ_NODE_FIELD(groupClause); READ_NODE_FIELD(havingQual); @@ -157,6 +154,7 @@ _readQuery(void) READ_NODE_FIELD(sortClause); READ_NODE_FIELD(limitOffset); READ_NODE_FIELD(limitCount); + READ_NODE_FIELD(rowMarks); READ_NODE_FIELD(setOperations); READ_NODE_FIELD(resultRelations); @@ -219,6 +217,21 @@ _readGroupClause(void) READ_DONE(); } +/* + * _readRowMarkClause + */ +static RowMarkClause * +_readRowMarkClause(void) +{ + READ_LOCALS(RowMarkClause); + + READ_UINT_FIELD(rti); + READ_BOOL_FIELD(forUpdate); + READ_BOOL_FIELD(noWait); + + READ_DONE(); +} + /* * _readSetOperationStmt */ @@ -934,6 +947,8 @@ parseNodeString(void) return_value = _readSortClause(); else if (MATCH("GROUPCLAUSE", 11)) return_value = _readGroupClause(); + else if (MATCH("ROWMARKCLAUSE", 13)) + return_value = _readRowMarkClause(); else if (MATCH("SETOPERATIONSTMT", 16)) return_value = _readSetOperationStmt(); else if (MATCH("ALIAS", 5)) -- cgit v1.2.3