Re: [HACKERS] Unexpected subselect result. - Mailing list pgsql-hackers

From Vadim B. Mikheev
Subject Re: [HACKERS] Unexpected subselect result.
Date
Msg-id 34EB98C0.75880BA2@sable.krasnoyarsk.su
Whole thread Raw
In response to Unexpected subselect result.  (Keith Parks <emkxp01@mtcc.demon.co.uk>)
List pgsql-hackers
Keith Parks wrote:
>
> Hi,
>
> I was having a play with subselects and found this, not very clever,
> nested subselect didn't work as I expected.
>
> Any Ideas?
>
> I also noticed that the subselect regression tests include only
> int and float columns in the tests.

Thanks, Keith!

Vadim
*** nodeSubplan.c.orig    Thu Feb 19 08:54:19 1998
--- nodeSubplan.c    Thu Feb 19 09:10:25 1998
***************
*** 193,198 ****
--- 193,206 ----
              break;
          }

+         /*
+          * If this is uncorrelated subquery then its plan will be closed
+          * (see below) and this tuple will be free-ed - bad for not byval
+          * types...
+          */
+         if ( plan->extParam == NULL )
+             tup = heap_copytuple (tup);
+
          foreach (lst, node->setParam)
          {
              ParamExecData   *prm = &(plan->state->es_param_exec_vals[lfirsti(lst)]);

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] New locking code
Next
From: Peter Stockwell
Date:
Subject: Status of Alpha/Unix