Skip to content

Commit 41accb0

Browse files
committed
Fix another place that assumed 'x = lcons(y, z)' would not have any
side-effect on the original list z. I fear we have a few more of these to track down yet :-(.
1 parent f54b956 commit 41accb0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/backend/rewrite/rewriteHandler.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
* $PostgreSQL: pgsql/src/backend/rewrite/rewriteHandler.c,v 1.136 2004/05/26 04:41:33 neilc Exp $
10+
* $PostgreSQL: pgsql/src/backend/rewrite/rewriteHandler.c,v 1.137 2004/05/29 05:55:13 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -864,15 +864,14 @@ fireRIRrules(Query *parsetree, List *activeRIRs)
864864
*/
865865
if (locks != NIL)
866866
{
867-
List *newActiveRIRs;
868867
ListCell *l;
869868

870869
if (oidMember(RelationGetRelid(rel), activeRIRs))
871870
ereport(ERROR,
872871
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
873872
errmsg("infinite recursion detected in rules for relation \"%s\"",
874873
RelationGetRelationName(rel))));
875-
newActiveRIRs = lconso(RelationGetRelid(rel), activeRIRs);
874+
activeRIRs = lconso(RelationGetRelid(rel), activeRIRs);
876875

877876
foreach(l, locks)
878877
{
@@ -884,8 +883,10 @@ fireRIRrules(Query *parsetree, List *activeRIRs)
884883
rule->attrno == -1,
885884
rel,
886885
relIsUsed,
887-
newActiveRIRs);
886+
activeRIRs);
888887
}
888+
889+
activeRIRs = list_delete_first(activeRIRs);
889890
}
890891

891892
heap_close(rel, NoLock);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy