File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 6
6
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
7
7
* Portions Copyright (c) 1994, Regents of the University of California
8
8
*
9
- * $Id: analyze.c,v 1.171 2000/12/06 23:55:19 tgl Exp $
9
+ * $Id: analyze.c,v 1.172 2000/12/07 01:12:08 tgl Exp $
10
10
*
11
11
*-------------------------------------------------------------------------
12
12
*/
@@ -2503,6 +2503,7 @@ transformAlterTableStmt(ParseState *pstate, AlterTableStmt *stmt)
2503
2503
return qry ;
2504
2504
}
2505
2505
2506
+ /* exported so planner can check again after rewriting, query pullup, etc */
2506
2507
void
2507
2508
CheckSelectForUpdate (Query * qry )
2508
2509
{
@@ -2519,7 +2520,7 @@ CheckSelectForUpdate(Query *qry)
2519
2520
static void
2520
2521
transformForUpdate (Query * qry , List * forUpdate )
2521
2522
{
2522
- List * rowMarks = NIL ;
2523
+ List * rowMarks = qry -> rowMarks ;
2523
2524
List * l ;
2524
2525
List * rt ;
2525
2526
Index i ;
@@ -2542,7 +2543,8 @@ transformForUpdate(Query *qry, List *forUpdate)
2542
2543
}
2543
2544
else
2544
2545
{
2545
- rowMarks = lappendi (rowMarks , i );
2546
+ if (!intMember (i , rowMarks )) /* avoid duplicates */
2547
+ rowMarks = lappendi (rowMarks , i );
2546
2548
rte -> checkForWrite = true;
2547
2549
}
2548
2550
}
You can’t perform that action at this time.
0 commit comments