[BUG] (firsttupleslot)==NULL is redundant or is possible nulldereference? - Mailing list pgsql-hackers

From Ranier Vilela
Subject [BUG] (firsttupleslot)==NULL is redundant or is possible nulldereference?
Date
Msg-id MN2PR18MB292769EAD143EE4C574C5468E3490@MN2PR18MB2927.namprd18.prod.outlook.com
Whole thread Raw
Responses Re: [BUG] (firsttupleslot)==NULL is redundant or is possible nulldereference?
List pgsql-hackers
Hi,
This is real bug? firsttupleslot == NULL.

\backend\executor\nodeGroup.c
    if (TupIsNull(firsttupleslot))
    {
        outerslot = ExecProcNode(outerPlanState(node));
        if (TupIsNull(outerslot))
        {
            /* empty input, so return nothing */
            node->grp_done = true;
            return NULL;
        }
        /* Copy tuple into firsttupleslot */
        ExecCopySlot(firsttupleslot, outerslot);

include\executor\tuptable.h:
#define TupIsNull(slot) \
    ((slot) == NULL || TTS_EMPTY(slot))

static inline TupleTableSlot *
ExecCopySlot(TupleTableSlot *dstslot, TupleTableSlot *srcslot)
{
    Assert(!TTS_EMPTY(srcslot));

    dstslot->tts_ops->copyslot(dstslot, srcslot);

    return dstslot;
}



pgsql-hackers by date:

Previous
From: David Steele
Date:
Subject: Re: backup manifests
Next
From: Tomas Vondra
Date:
Subject: Re: [BUG] (firsttupleslot)==NULL is redundant or is possible nulldereference?