pgsql: Adjust DatumGetBool macro so that it isn't fooled by garbage in - Mailing list pgsql-committers

From tgl@postgresql.org (Tom Lane)
Subject pgsql: Adjust DatumGetBool macro so that it isn't fooled by garbage in
Date
Msg-id 20070323202441.95A009FB68B@postgresql.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
Adjust DatumGetBool macro so that it isn't fooled by garbage in the Datum
to the left of the actual bool value.  While in most cases there won't be
any, our support for old-style user-defined functions violates the C spec
to the extent of calling functions that might return char or short through
a function pointer declared to return "char *", which we then coerce to
Datum.  It is not surprising that the result might contain garbage
high-order bits ... what is surprising is that we didn't see such cases
long ago.  Per report from Magnus.

Modified Files:
--------------
    pgsql/src/include:
        postgres.h (r1.77 -> r1.78)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/postgres.h.diff?r1=1.77&r2=1.78)

pgsql-committers by date:

Previous
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Fix plancache so that any required replanning is done with the
Next
From: alvherre@postgresql.org (Alvaro Herrera)
Date:
Subject: pgsql: We no longer need to palloc the VacuumStmt node; keeping it on