Skip site navigation (1) Skip section navigation (2)

pgsql: Adjust DatumGetBool macro so that it isn't fooled by garbage in

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Adjust DatumGetBool macro so that it isn't fooled by garbage in
Date: 2007-03-23 20:24:41
Message-ID: 20070323202441.95A009FB68B@postgresql.org (view raw or flat)
Thread:
Lists: 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

Next:From: Alvaro HerreraDate: 2007-03-23 20:56:40
Subject: pgsql: We no longer need to palloc the VacuumStmt node; keeping it on
Previous:From: Tom LaneDate: 2007-03-23 19:53:52
Subject: pgsql: Fix plancache so that any required replanning is done with the

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group