]> granicus.if.org Git - postgresql/commit
Fix SysCacheGetAttr() to handle the case where the specified syscache has not
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 6 Oct 2006 18:23:41 +0000 (18:23 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 6 Oct 2006 18:23:41 +0000 (18:23 +0000)
commita222a158b08205e89a5e291763c854277906fc8c
treed276cba652f98fd08ff7c1af0578ddeee3c39807
parent4af74cc00751d250d6f3c7b6f28b6f7daae07e1d
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.
src/backend/utils/cache/catcache.c
src/backend/utils/cache/syscache.c
src/include/utils/catcache.h