>And why do you think this is a bug? Immediately before the part of code
>you copied we have this:
>
>     /*
>      * The ScanTupleSlot holds the (copied) first tuple of each group.
>      */
>     firsttupleslot = node->ss.ss_ScanTupleSlot;
>And node->ss.ss_ScanTupleSlot is expected to be non-NULL. So the initial
>assumption that firsttupleslot is NULL is incorrect.

IMHO, the test could be improved, this way it silences the scan tool.

--- \dll\postgresql-12.0\a\backend\executor\nodeGroup.c Mon Sep 30 17:06:55 2019
+++ nodeGroup.c Sat Nov 23 00:23:27 2019
@@ -64,7 +64,7 @@
         * If first time through, acquire first input tuple and determine 
whether
         * to return it or not.
         */
-       if (TupIsNull(firsttupleslot))
+    if ((firsttupleslot != NULL) && TTS_EMPTY(firsttupleslot))
        {
                outerslot = ExecProcNode(outerPlanState(node));
                if (TupIsNull(outerslot))

best regards.
Ranier Vilela

Reply via email to