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/readfuncs.c | |
parent | 931bfc96644b8f51a49161f780d43506e55d2b13 (diff) |
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/readfuncs.c')
-rw-r--r-- | src/backend/nodes/readfuncs.c | 23 |
1 files changed, 19 insertions, 4 deletions
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); @@ -220,6 +218,21 @@ _readGroupClause(void) } /* + * _readRowMarkClause + */ +static RowMarkClause * +_readRowMarkClause(void) +{ + READ_LOCALS(RowMarkClause); + + READ_UINT_FIELD(rti); + READ_BOOL_FIELD(forUpdate); + READ_BOOL_FIELD(noWait); + + READ_DONE(); +} + +/* * _readSetOperationStmt */ static SetOperationStmt * @@ -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)) |