Hello,

In the following code in execTuples.c, shouldn' srcdesc point to the source 
slot's tuple descriptor?  The attached fix passes make check.  What kind of 
failure could this cause?

BTW, I thought that in PostgreSQL coding convention, local variables should be 
defined at the top of blocks, but this function writes "for (int natts;".  I 
didn't modify it because many other source files also write in that way.


--------------------------------------------------
static void
tts_virtual_copyslot(TupleTableSlot *dstslot, TupleTableSlot *srcslot)
{
    TupleDesc   srcdesc = dstslot->tts_tupleDescriptor;

    Assert(srcdesc->natts <= dstslot->tts_tupleDescriptor->natts);

    tts_virtual_clear(dstslot);

    slot_getallattrs(srcslot);

    for (int natt = 0; natt < srcdesc->natts; natt++)
    {
        dstslot->tts_values[natt] = srcslot->tts_values[natt];
        dstslot->tts_isnull[natt] = srcslot->tts_isnull[natt];
    }
--------------------------------------------------


Regards
Takayuki Tsunakawa

Attachment: virtslot_tiny_fix.patch
Description: virtslot_tiny_fix.patch

Reply via email to