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/outfuncs.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/outfuncs.c')
-rw-r--r-- | src/backend/nodes/outfuncs.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c index 314d68d2ef9..25d3a112799 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); } @@ -1547,6 +1545,16 @@ _outGroupClause(StringInfo str, GroupClause *node) } 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) { WRITE_NODE_TYPE("SETOPERATIONSTMT"); @@ -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; |