Re: A minor correction in comment in heaptuple.c

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: A minor correction in comment in heaptuple.c
Дата
Msg-id 1371578665.93373.YahooMailNeo@web162906.mail.bf1.yahoo.com
обсуждение исходный текст
Ответ на Re: A minor correction in comment in heaptuple.c  ("D'Arcy J.M. Cain" <darcy@druid.net>)
Ответы Re: A minor correction in comment in heaptuple.c  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-hackers
D'Arcy J.M. Cain <darcy@druid.net>

> Although, the more I think about it, the more I think that the comment
> is both confusing and superfluous.  The code itself is much clearer.

Seriously, if there is any comment there at all, it should be a
succinct explanation for why we didn't do this (which passes `make
check-world`):

--- a/src/backend/access/common/heaptuple.c
+++ b/src/backend/access/common/heaptuple.c
@@ -1323,6 +1323,8 @@ slot_attisnull(TupleTableSlot *slot, int attnum)
    HeapTuple   tuple = slot->tts_tuple;
    TupleDesc   tupleDesc = slot->tts_tupleDescriptor;
 
+   Assert(attnum <= tupleDesc->natts);
+
    /*
     * system attributes are handled by heap_attisnull
     */
@@ -1342,12 +1344,6 @@ slot_attisnull(TupleTableSlot *slot, int attnum)
        return slot->tts_isnull[attnum - 1];
 
    /*
-    * return NULL if attnum is out of range according to the tupdesc
-    */
-   if (attnum > tupleDesc->natts)
-       return true;
-
-   /*
     * otherwise we had better have a physical tuple (tts_nvalid should equal
     * natts in all virtual-tuple cases)
     */

--
Kevin Grittner
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: SET work_mem = '1TB';
Следующее
От: Andres Freund
Дата:
Сообщение: Re: extensible external toast tuple support