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.
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.

arcivanov/postgres-xl,greenplum-db/gpdb,jmcatamney/gpdb,tpostgres-projects/tPostgres,yazun/postgres-xl,ashwinstar/gpdb,zeroae/postgres-xl,xinzweb/gpdb,pavanvd/postgres-xl,jmcatamney/gpdb,oberstet/postgres-xl,snaga/postgres-xl,arcivanov/postgres-xl,adam8157/gpdb,pavanvd/postgres-xl,50wu/gpdb,kmjungersen/PostgresXL,tpostgres-projects/tPostgres,oberstet/postgres-xl,kmjungersen/PostgresXL,postmind-net/postgres-xl,50wu/gpdb,lisakowen/gpdb,snaga/postgres-xl,greenplum-db/gpdb,oberstet/postgres-xl,ashwinstar/gpdb,pavanvd/postgres-xl,ovr/postgres-xl,yazun/postgres-xl,jmcatamney/gpdb,50wu/gpdb,yazun/postgres-xl,techdragon/Postgres-XL,oberstet/postgres-xl,arcivanov/postgres-xl,ashwinstar/gpdb,ashwinstar/gpdb,ovr/postgres-xl,zeroae/postgres-xl,tpostgres-projects/tPostgres,snaga/postgres-xl,kmjungersen/PostgresXL,adam8157/gpdb,xinzweb/gpdb,arcivanov/postgres-xl,xinzweb/gpdb,ovr/postgres-xl,jmcatamney/gpdb,50wu/gpdb,postmind-net/postgres-xl,lisakowen/gpdb,Postgres-XL/Postgres-XL,lisakowen/gpdb,zeroae/postgres-xl,adam8157/gpdb,lisakowen/gpdb,techdragon/Postgres-XL,50wu/gpdb,zeroae/postgres-xl,ovr/postgres-xl,greenplum-db/gpdb,tpostgres-projects/tPostgres,adam8157/gpdb,xinzweb/gpdb,ovr/postgres-xl,kmjungersen/PostgresXL,lisakowen/gpdb,Postgres-XL/Postgres-XL,techdragon/Postgres-XL,kmjungersen/PostgresXL,zeroae/postgres-xl,oberstet/postgres-xl,snaga/postgres-xl,50wu/gpdb,arcivanov/postgres-xl,jmcatamney/gpdb,Postgres-XL/Postgres-XL,xinzweb/gpdb,adam8157/gpdb,lisakowen/gpdb,greenplum-db/gpdb,arcivanov/postgres-xl,ashwinstar/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,adam8157/gpdb,ashwinstar/gpdb,jmcatamney/gpdb,xinzweb/gpdb,snaga/postgres-xl,pavanvd/postgres-xl,greenplum-db/gpdb,postmind-net/postgres-xl,techdragon/Postgres-XL,jmcatamney/gpdb,postmind-net/postgres-xl,tpostgres-projects/tPostgres,yazun/postgres-xl,jmcatamney/gpdb,techdragon/Postgres-XL,50wu/gpdb,Postgres-XL/Postgres-XL,adam8157/gpdb,xinzweb/gpdb,greenplum-db/gpdb,pavanvd/postgres-xl,ashwinstar/gpdb,postmind-net/postgres-xl,yazun/postgres-xl,Postgres-XL/Postgres-XL,adam8157/gpdb,lisakowen/gpdb,xinzweb/gpdb,50wu/gpdb,greenplum-db/gpdb,lisakowen/gpdb