mirror of
https://github.com/postgres/postgres.git
synced 2025-11-12 05:01:15 +03:00
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.
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.270 2006/04/22 01:25:59 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.271 2006/04/30 18:30:38 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -665,9 +665,6 @@ _equalQuery(Query *a, Query *b)
|
||||
COMPARE_SCALAR_FIELD(hasSubLinks);
|
||||
COMPARE_NODE_FIELD(rtable);
|
||||
COMPARE_NODE_FIELD(jointree);
|
||||
COMPARE_NODE_FIELD(rowMarks);
|
||||
COMPARE_SCALAR_FIELD(forUpdate);
|
||||
COMPARE_SCALAR_FIELD(rowNoWait);
|
||||
COMPARE_NODE_FIELD(targetList);
|
||||
COMPARE_NODE_FIELD(groupClause);
|
||||
COMPARE_NODE_FIELD(havingQual);
|
||||
@@ -675,6 +672,7 @@ _equalQuery(Query *a, Query *b)
|
||||
COMPARE_NODE_FIELD(sortClause);
|
||||
COMPARE_NODE_FIELD(limitOffset);
|
||||
COMPARE_NODE_FIELD(limitCount);
|
||||
COMPARE_NODE_FIELD(rowMarks);
|
||||
COMPARE_NODE_FIELD(setOperations);
|
||||
COMPARE_NODE_FIELD(resultRelations);
|
||||
|
||||
@@ -1688,7 +1686,7 @@ _equalLockingClause(LockingClause *a, LockingClause *b)
|
||||
{
|
||||
COMPARE_NODE_FIELD(lockedRels);
|
||||
COMPARE_SCALAR_FIELD(forUpdate);
|
||||
COMPARE_SCALAR_FIELD(nowait);
|
||||
COMPARE_SCALAR_FIELD(noWait);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1723,6 +1721,16 @@ _equalSortClause(SortClause *a, SortClause *b)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
_equalRowMarkClause(RowMarkClause *a, RowMarkClause *b)
|
||||
{
|
||||
COMPARE_SCALAR_FIELD(rti);
|
||||
COMPARE_SCALAR_FIELD(forUpdate);
|
||||
COMPARE_SCALAR_FIELD(noWait);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
_equalFkConstraint(FkConstraint *a, FkConstraint *b)
|
||||
{
|
||||
@@ -2297,6 +2305,9 @@ equal(void *a, void *b)
|
||||
/* GroupClause is equivalent to SortClause */
|
||||
retval = _equalSortClause(a, b);
|
||||
break;
|
||||
case T_RowMarkClause:
|
||||
retval = _equalRowMarkClause(a, b);
|
||||
break;
|
||||
case T_FkConstraint:
|
||||
retval = _equalFkConstraint(a, b);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user