Fix two new-in-9.0 bugs in hstore.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: c5ed269164f5bff46aaf13d05cd6e23dfd362728
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2010-09-16T02:54:07Z
Releases: 9.0.0
Fix two new-in-9.0 bugs in hstore.

There was an incorrect Assert in hstoreValidOldFormat(), which would cause
immediate core dumps when attempting to work with pre-9.0 hstore data,
but of course only in an assert-enabled build.

Also, ghstore_decompress() incorrectly applied DatumGetHStoreP() to a datum
that wasn't actually an hstore, but rather a ghstore (ie, a gist signature
bitstring).  That used to be harmless, but could now result in misbehavior
if the hstore format conversion code happened to trigger.  In reality,
since ghstore is not marked toastable (and doesn't need to be), this
function is useless anyway; we can lobotomize it down to returning the
passed-in pointer.

Both bugs found by Andrew Gierth, though this isn't exactly his proposed
patch.

Files

PathChange+/−
contrib/hstore/hstore_compat.c modified +3 −2
contrib/hstore/hstore_gist.c modified +6 −20