BUG #14984: function "heap_tuple_from_minimal_tuple" lostHeapTupleHeader->t_len value - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #14984: function "heap_tuple_from_minimal_tuple" lostHeapTupleHeader->t_len value
Date
Msg-id 20171220094958.25744.94506@wrigleys.postgresql.org
Whole thread Raw
Responses Re: BUG #14984: function "heap_tuple_from_minimal_tuple" lostHeapTupleHeader->t_len value  (Andres Freund <andres@anarazel.de>)
Re: BUG #14984: function "heap_tuple_from_minimal_tuple" lost HeapTupleHeader->t_len value  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      14984
Logged by:          bucoo hsiao
Email address:      bucoo@sohu.com
PostgreSQL version: 10.1
Operating system:   all
Description:

HeapTuple
heap_tuple_from_minimal_tuple(MinimalTuple mtup)
{
    HeapTuple    result;
    uint32        len = mtup->t_len + MINIMAL_TUPLE_OFFSET;

    result = (HeapTuple) palloc(HEAPTUPLESIZE + len);
    result->t_len = len;
    ItemPointerSetInvalid(&(result->t_self));
    result->t_tableOid = InvalidOid;
    result->t_data = (HeapTupleHeader) ((char *) result + HEAPTUPLESIZE);
    memcpy((char *) result->t_data + MINIMAL_TUPLE_OFFSET, mtup,
mtup->t_len);
    memset(result->t_data, 0, offsetof(HeapTupleHeaderData, t_infomask2));
/* when memset return, result->t_data->t_len value lost
   should append code:
   HeapTupleHeaderSetDatumLength(result->t_data, len);
*/
    return result;
}


pgsql-bugs by date:

Previous
From: Jaroslav Urik
Date:
Subject: Re: BUG #14949: array_append() - performance issues (in update)
Next
From: PG Bug reporting form
Date:
Subject: BUG #14985: ExecCopySlotTuple not set "type id" and "type mod" whenfrom minial tuple"