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

pgsql: Avoid an Assert failure in deconstruct_array() by making

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Avoid an Assert failure in deconstruct_array() by making
Date: 2010-07-09 22:58:12
Message-ID: 20100709225812.768FB7541D6@cvs.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
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.

Tags:
----
REL8_1_STABLE

Modified Files:
--------------
    pgsql/src/backend/utils/cache:
        lsyscache.c (r1.129.2.1 -> r1.129.2.2)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/cache/lsyscache.c?r1=1.129.2.1&r2=1.129.2.2)

pgsql-committers by date

Next:From: Tom LaneDate: 2010-07-09 22:58:17
Subject: pgsql: Avoid an Assert failure in deconstruct_array() by making
Previous:From: Tom LaneDate: 2010-07-09 22:58:07
Subject: pgsql: Avoid an Assert failure in deconstruct_array() by making

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