Re: TupleTableSlot API problem - Mailing list pgsql-hackers

From Andrew Gierth
Subject Re: TupleTableSlot API problem
Date
Msg-id 87wsa7am52.fsf@news-spur.riddles.org.uk
Whole thread Raw
In response to Re: TupleTableSlot API problem  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: TupleTableSlot API problem  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
List pgsql-hackers
>>>>> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:
>> For example, given some function foo(out a text, out b text) returning>> setof record, the query select t.a, t from
foo()t; follows the>> sequence of events you describe, but it doesn't fail because>> slot-> tts_shouldFree is false, so
theoriginal minimaltuple isn't>> freed.
 
Tom> Yeah, good point.  However I think that you could still get aTom> failure.  The cases where a slot might contain a
minimaltupleTom> are generally where we are reading out of a tuplestore orTom> tuplesort object, and all you have to do
toget it to be aTom> palloc'd mintuple is to make the test case big enough so theTom> tuplestore has dumped to disk.
(Nowthat I think about it, ITom> failed to try scaling up the test cases I did try...)
 

Aha; and indeed if you use select t.a, t from func() t; where the
function returns a set larger than work_mem, it does indeed fail
messily (against my -O0 --enable-cassert HEAD I just get corrupted
values for t.a, though, rather than an error). I'll try and reproduce
that on a back branch...

-- 
Andrew.


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: TupleTableSlot API problem
Next
From: Andrew Gierth
Date:
Subject: Re: TupleTableSlot API problem