Re: [HACKERS] trouble with rules

From: jwieck(at)debis(dot)com (Jan Wieck)
To: jwieck(at)debis(dot)com
Cc: 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-08 00:14:58
Message-ID: m109eLq-000EBPC@orion.SAPserv.Hamburg.dsh.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
>
> Tom Lane wrote:
>
> > Calm down Jan ;-). I think what happened here is a slightly careless
> > merge of the 6.3 - based INTERSECT/EXPECT code into the current code.
> > Not a deliberate removal of a feature, just a foulup.
>
> Was my fault too. I should have added this new syntax to the
> regression (as I did now). That way I would have noticed as
> early as can that something disappeared.
>
> >
> > This does suggest that we need to be more careful when applying patches
> > developed against old system versions.
>
> This does suggest that we need to pay more attention that all
> the nifty things we do are added to the regression suite.
>
> Saying this I've just checked and the examples I've written
> in the rule system section of the programmers manual cause
> the backend to dump core.
>
> Isn't if funny? All I'm telling could be used against me. :-)

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.

Sorry for that.

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#======================================== jwieck(at)debis(dot)com (Jan Wieck) #

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Sascha Schumann 1999-02-08 00:15:19 Re: [HACKERS] v6.4.3 ?
Previous Message D'Arcy J.M. Cain 1999-02-08 00:14:00 Re: [HACKERS] Problems with >2GB tables on Linux 2.0