Re: BUG #14985: ExecCopySlotTuple not set "type id" and "type mod"when from minial tuple" - Mailing list pgsql-bugs

From Andres Freund
Subject Re: BUG #14985: ExecCopySlotTuple not set "type id" and "type mod"when from minial tuple"
Date
Msg-id 20171220153346.cxsl7nmf5372v76s@alap3.anarazel.de
Whole thread Raw
In response to BUG #14985: ExecCopySlotTuple not set "type id" and "type mod" whenfrom minial tuple"  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
Hi,

On 2017-12-20 10:05:40 +0000, PG Bug reporting form wrote:
> The following bug has been logged on the website:
> 
> Bug reference:      14985
> Logged by:          bucoo hsiao
> Email address:      bucoo@sohu.com
> PostgreSQL version: 10.1
> Operating system:   all
> Description:        

This also isn't a proper bug report. If you've API questions you
shouldn't open bug reports, instead ask on the general mailing list or
such.


> HeapTuple
> ExecCopySlotTuple(TupleTableSlot *slot)
> {
>     /*
>      * sanity checks
>      */
>     Assert(slot != NULL);
>     Assert(!slot->tts_isempty);
> 
>     /*
>      * If we have a physical tuple (either format) then just copy it.
>      */
>     if (TTS_HAS_PHYSICAL_TUPLE(slot))
>         return heap_copytuple(slot->tts_tuple);
>     if (slot->tts_mintuple)
>         return heap_tuple_from_minimal_tuple(slot->tts_mintuple);
> /* should be:
>         if (slot->tts_mintuple)
>         {
>                 HeapTuple result =
> heap_tuple_from_minimal_tuple(slot->tts_mintuple);
>                 HeapTupleHeaderSetTypeId(result->t_data,
> slot->tts_tupleDescriptor->tdtypeid);
>                 HeapTupleHeaderSetTypMod(result->t_data,
> slot->tts_tupleDescriptor->tdtypmod);
>                 return result;
>         }
> */
>     ...
> }
> 

No, it shouldn't. It seems you're looking for ExecFetchSlotTupleDatum().

Greetings,

Andres Freund


pgsql-bugs by date:

Previous
From: Andres Freund
Date:
Subject: Re: BUG #14984: function "heap_tuple_from_minimal_tuple" lostHeapTupleHeader->t_len value
Next
From: Tom Lane
Date:
Subject: Re: BUG #14985: ExecCopySlotTuple not set "type id" and "type mod" when from minial tuple"