pgsql: Fix SysCacheGetAttr() to handle the case where the specified - Mailing list pgsql-committers

From tgl@postgresql.org (Tom Lane)
Subject pgsql: Fix SysCacheGetAttr() to handle the case where the specified
Date
Msg-id 20061006182335.CAEA39FB40F@postgresql.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
Fix SysCacheGetAttr() to handle the case where the specified syscache has not
been initialized yet.  This can happen because there are code paths that call
SysCacheGetAttr() on a tuple originally fetched from a different syscache
(hopefully on the same catalog) than the one specified in the call.  It
doesn't seem useful or robust to try to prevent that from happening, so just
improve the function to cope instead.  Per bug#2678 from Jeff Trout.  The
specific example shown by Jeff is new in 8.1, but to be on the safe side
I'm backpatching 8.0 as well.  We could patch 7.x similarly but I think
that's probably overkill, given the lack of evidence of old bugs of this ilk.

Modified Files:
--------------
    pgsql/src/backend/utils/cache:
        catcache.c (r1.133 -> r1.134)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/cache/catcache.c.diff?r1=1.133&r2=1.134)
        syscache.c (r1.107 -> r1.108)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/cache/syscache.c.diff?r1=1.107&r2=1.108)
    pgsql/src/include/utils:
        catcache.h (r1.62 -> r1.63)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/utils/catcache.h.diff?r1=1.62&r2=1.63)

pgsql-committers by date:

Previous
From: petere@postgresql.org (Peter Eisentraut)
Date:
Subject: pgsql: Message style improvements
Next
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Fix SysCacheGetAttr() to handle the case where the specified