From hayamiz. Adding to trunk for testing, acceptance before
applying to 2.1/2.0
git-svn-id: http://svn.osgeo.org/postgis/trunk@12042
b70326c6-7e19-0410-871a-
916f4a2858ee
** The most info we need is the 8 bytes of serialized header plus the
** of floats necessary to hold the bounding box.
*/
- gpart = (GSERIALIZED*)PG_DETOAST_DATUM_SLICE(gsdatum, 0, 8 + sizeof(BOX2DF));
+ if (VARATT_IS_EXTENDED(gsdatum))
+ {
+ gpart = (GSERIALIZED*)PG_DETOAST_DATUM_SLICE(gsdatum, 0, 8 + sizeof(BOX2DF));
+ }
+ else
+ {
+ gpart = (GSERIALIZED*)PG_DETOAST_DATUM(gsdatum);
+ }
+
flags = gpart->flags;
POSTGIS_DEBUGF(4, "got flags %d", gpart->flags);