dbTalk Databases Forums  

Re: [BUGS] variable not found in subplan target list? + test case

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss Re: [BUGS] variable not found in subplan target list? + test case in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] variable not found in subplan target list? + test case - 11-25-2003 , 06:05 PM






Klint Gore <kg (AT) kgb (DOT) une.edu.au> writes:
Quote:
Can you send a test case with table and view definitions, it's hard to
generate one from just the information above.

ok. the last select generates the error.
Hoo, that was a fun one. Here's the patch.

regards, tom lane

*** src/backend/optimizer/plan/subselect.c.orig Tue Nov 25 16:00:54 2003
--- src/backend/optimizer/plan/subselect.c Tue Nov 25 18:25:32 2003
***************
*** 118,123 ****
--- 118,128 ----
* well, I believe that this sort of aliasing will cause no trouble.
* The correct field should get stored into the Param slot at
* execution in each part of the tree.
+ *
+ * We also need to demand a match on vartypmod. This does not matter
+ * for the Param itself, since those are not typmod-dependent, but it
+ * does matter when make_subplan() instantiates a modified copy of the
+ * Var for a subplan's args list.
*/
i = 0;
foreach(ppl, PlannerParamList)
***************
*** 129,135 ****

if (pvar->varno == var->varno &&
pvar->varattno == var->varattno &&
! pvar->vartype == var->vartype)
break;
}
i++;
--- 134,141 ----

if (pvar->varno == var->varno &&
pvar->varattno == var->varattno &&
! pvar->vartype == var->vartype &&
! pvar->vartypmod == var->vartypmod)
break;
}
i++;

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend


Reply With Quote
  #2  
Old   
Klint Gore
 
Posts: n/a

Default Re: [BUGS] variable not found in subplan target list? + test case - 11-25-2003 , 07:43 PM






On Tue, 25 Nov 2003 19:02:54 -0500, Tom Lane <tgl (AT) sss (DOT) pgh.pa.us> wrote:
Quote:
Klint Gore <kg (AT) kgb (DOT) une.edu.au> writes:
Can you send a test case with table and view definitions, it's hard to
generate one from just the information above.

ok. the last select generates the error.

Hoo, that was a fun one. Here's the patch.

regards, tom lane

works on linux and cygwin.

thanks for the fix.

klint.

+---------------------------------------+-----------------+
: Klint Gore : "Non rhyming :
: EMail : kg (AT) kgb (DOT) une.edu.au : slang - the :
: Snail : A.B.R.I. : possibilities :
: Mail University of New England : are useless" :
: Armidale NSW 2351 Australia : L.J.J. :
: Fax : +61 2 6772 5376 : :
+---------------------------------------+-----------------+

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.