Re: [HACKERS] trouble with rules

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: jwieck(at)debis(dot)com
Cc: jwieck(at)debis(dot)com, tgl(at)sss(dot)pgh(dot)pa(dot)us, vadim(at)krs(dot)ru, eberger(at)gewi(dot)kfunigraz(dot)ac(dot)at, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] trouble with rules
Date: 1999-02-22 16:33:33
Message-ID: 199902221633.LAA29343@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> No, it isn't fun any more and I'm getting angry now >:-(
>
> I've checked it and it turns out, that due to the changes
> that came in with INTERSECT/EXPECT many expressions aren't
> any longer copied when they are added from one parsetree to
> another. Thus, multiple parsetrees reference the same Var
> nodes and if multiple rules get applied during the rule
> system recursion (rewritten trees get rewritten again), later
> rules mangle up the ones referenced in trees the rule system
> is already done with.
>
> I've spent night's to fix this all for v6.4. Added many
> copyObject()'s around things that MUST be copied. Now I find
> them commented out, because it was easier to apply v6.3 based
> development onto the v6.5 sources.
>
> I'll now revert things to do the copyObject() again where it
> has to be done and will add the examples from the programmers
> manual to the regression tests.
>
> Surely this will break the INTERSECT/EXPECT code, because it
> depends on nodes beeing at specific memory locations for
> comparisions. But this is impossible due to the requirements
> of the rule system.

That is bad. He wants the Var nodes to have the same address. Why
can't he use equal() like everyone else? Do you want to review his
patch, and reverse anything that looks wrong in it. This may be the
only way to make sure things are OK. The patch isn't that long.

I had the same frustrations with HAVING six months ago.

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-02-22 16:37:57 Re: start on outer join
Previous Message Daryl W. Dunbar 1999-02-22 16:07:31 RE: [HACKERS] Re: Max backend limits cleaned up