Re: [HACKERS] Possible bug in plpgsql/src/gram.y

2001-07-12 Thread Jan Wieck
Tom Lane wrote: > Bruce Momjian <[EMAIL PROTECTED]> writes: > > Also, can someone tell my why we use malloc in plpgsql? > > Plain palloc() won't do because the compiled tree for the function needs > to outlive the current query. However, malloc() is not cool. Really, > these structures ought to

Re: [HACKERS] Possible bug in plpgsql/src/gram.y

2001-07-12 Thread Jan Wieck
Bruce Momjian wrote: > > Confirmed. I found a second problem in the file too, very similar. > Patch applied. Cut'n paste error. Thanks to both of you, good catch. Jan > > > In this bit of code in src/pl/plpgsql/src/gram.y in the current CVS > > sources, curname_def is defined as PLpgSQL_e

Re: [HACKERS] Possible bug in plpgsql/src/gram.y

2001-07-11 Thread Bruce Momjian
> Bruce Momjian <[EMAIL PROTECTED]> writes: > > Also, can someone tell my why we use malloc in plpgsql? > > Plain palloc() won't do because the compiled tree for the function needs > to outlive the current query. However, malloc() is not cool. Really, > these structures ought to be built in a m

Re: [HACKERS] Possible bug in plpgsql/src/gram.y

2001-07-11 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > Also, can someone tell my why we use malloc in plpgsql? Plain palloc() won't do because the compiled tree for the function needs to outlive the current query. However, malloc() is not cool. Really, these structures ought to be built in a memory contex

Re: [HACKERS] Possible bug in plpgsql/src/gram.y

2001-07-11 Thread Bruce Momjian
Also, can someone tell my why we use malloc in plpgsql? > In this bit of code in src/pl/plpgsql/src/gram.y in the current CVS > sources, curname_def is defined as PLpgSQL_expr * but it is is > allocated the space required for a PLpgSQL_var. This looks like a > bug. > > Ian > >

Re: [HACKERS] Possible bug in plpgsql/src/gram.y

2001-07-11 Thread Bruce Momjian
Confirmed. I found a second problem in the file too, very similar. Patch applied. > In this bit of code in src/pl/plpgsql/src/gram.y in the current CVS > sources, curname_def is defined as PLpgSQL_expr * but it is is > allocated the space required for a PLpgSQL_var. This looks like a > bug. >

[HACKERS] Possible bug in plpgsql/src/gram.y

2001-07-11 Thread Ian Lance Taylor
In this bit of code in src/pl/plpgsql/src/gram.y in the current CVS sources, curname_def is defined as PLpgSQL_expr * but it is is allocated the space required for a PLpgSQL_var. This looks like a bug. Ian | decl_varname K_CURSOR decl_cursor_args decl_is_from K_