Re: [HACKERS] Re: Apparent bug in _make_subplan

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Vadim Mikheev <vadim(at)krs(dot)ru>
Cc: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Re: Apparent bug in _make_subplan
Date: 1999-06-18 14:19:44
Message-ID: 7441.929715584@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Vadim Mikheev <vadim(at)krs(dot)ru> writes:
>> But the varlevelsup I pass in from the parser are relative to the
>> current level, not absolute.

> subselect.c takes it into account, computes absolute numbers
> and stores them in PlannerParamVar only...

Right, I eventually figured that out, and I see that it's probably the
best way. I have added the following documentation to subselect.c:

/*--------------------
* PlannerParamVar is a list of Var nodes, wherein the n'th entry
* (n counts from 0) corresponds to Param->paramid = n. The Var nodes
* are ordinary except for one thing: their varlevelsup field does NOT
* have the usual interpretation of "subplan levels out from current".
* Instead, it contains the absolute plan level, with the outermost
* plan being level 1 and nested plans having higher level numbers.
* This nonstandardness is useful because we don't have to run around
* and update the list elements when we enter or exit a subplan
* recursion level. But we must pay attention not to confuse this
* meaning with the normal meaning of varlevelsup.
*--------------------
*/

along with other changes that I will commit once I get subselects in
HAVING working right ...

regards, tom lane

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 1999-06-18 14:23:14 Re: [HACKERS] Memory problem?
Previous Message Patrick Welche 1999-06-18 12:03:14 Re: [HACKERS] Memory problem?