]> granicus.if.org Git - postgresql/commit
Avoid an Assert failure in deconstruct_array() by making get_attstatsslot()
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 9 Jul 2010 22:58:01 +0000 (22:58 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 9 Jul 2010 22:58:01 +0000 (22:58 +0000)
commit8c21b4e9226df1f6f16091e557fb313f5d308cde
tree2433475a95ad3222dcd856202a7bc9ff9fc61e41
parent67ba60ef5788cfa9101221764f606b953a1258c3
Avoid an Assert failure in deconstruct_array() by making get_attstatsslot()
use the actual element type of the array it's disassembling, rather than
trusting the type OID passed in by its caller.  This is needed because
sometimes the planner passes in a type OID that's only binary-compatible
with the target column's type, rather than being an exact match.  Per an
example from Bernd Helmle.

Possibly we should refactor get_attstatsslot/free_attstatsslot to not expect
the caller to supply type ID data at all, but for now I'll just do the
minimum-change fix.

Back-patch to 7.4.  Bernd's test case only crashes back to 8.0, but since
these subroutines are the same in 7.4, I suspect there may be variant
cases that would crash 7.4 as well.
src/backend/utils/cache/lsyscache.c