RE: [BUG] (firsttupleslot)==NULL is redundant or is possible nulldereference?

Поиск
Список
Период
Сортировка
От Ranier Vilela
Тема RE: [BUG] (firsttupleslot)==NULL is redundant or is possible nulldereference?
Дата
Msg-id MN2PR18MB29277475FE1330608B738C93E3480@MN2PR18MB2927.namprd18.prod.outlook.com
обсуждение исходный текст
Ответ на Re: [BUG] (firsttupleslot)==NULL is redundant or is possible nulldereference?  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Список pgsql-hackers
>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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Mark Dilger
Дата:
Сообщение: Re: Assertion failing in master, predicate.c
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: Ordering of header file inclusion