pgsql: Remove partial, broken support for NULL pointers when fetching

From: rhaas(at)postgresql(dot)org (Robert Haas)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Remove partial, broken support for NULL pointers when fetching
Date: 2010-01-10 04:26:36
Message-ID: 20100110042636.973BB7541B9@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
Remove partial, broken support for NULL pointers when fetching attributes.

Previously, fastgetattr() and heap_getattr() tested their fourth argument
against a null pointer, but any attempt to use them with a literal-NULL
fourth argument evaluated to *(void *)0, resulting in a compiler error.
Remove these NULL tests to avoid leading future readers of this code to
believe that this has a chance of working. Also clean up related legacy
code in nocachegetattr(), heap_getsysattr(), and nocache_index_getattr().

The new coding standard is that any code which calls a getattr-type
function or macro which takes an isnull argument MUST pass a valid
boolean pointer. Per discussion with Bruce Momjian, Tom Lane, Alvaro
Herrera.

Modified Files:
--------------
pgsql/src/backend/access/common:
heaptuple.c (r1.129 -> r1.130)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/common/heaptuple.c?r1=1.129&r2=1.130)
indextuple.c (r1.90 -> r1.91)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/common/indextuple.c?r1=1.90&r2=1.91)
pgsql/src/backend/access/heap:
heapam.c (r1.280 -> r1.281)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/heap/heapam.c?r1=1.280&r2=1.281)
pgsql/src/include/access:
htup.h (r1.109 -> r1.110)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/access/htup.h?r1=1.109&r2=1.110)
itup.h (r1.53 -> r1.54)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/access/itup.h?r1=1.53&r2=1.54)

Browse pgsql-committers by date

  From Date Subject
Next Message Magnus Hagander 2010-01-10 14:16:08 pgsql: Create typedef pgsocket for storing socket descriptors.
Previous Message Robert Haas 2010-01-10 01:23:08 pgsql: Document pg_tablespace.spcoptions.