65 char gboxmem[GIDX_MAX_SIZE];
66 GIDX *gidx_geom, *gidx_key;
67 int dims_geom, dims_key, i;
69 Assert(max_dims <= GIDX_MAX_DIM);
77 if (column->bv_hasnulls)
78 PG_RETURN_BOOL(
false);
80 column->bv_hasnulls =
true;
88 if (!column->bv_allnulls &&
90 PG_RETURN_BOOL(
false);
93 gidx_geom = (GIDX *) gboxmem;
98 if (gserialized_datum_get_gidx_p(newval, gidx_geom) ==
LW_FAILURE)
110 PG_RETURN_BOOL(
true);
113 PG_RETURN_BOOL(
false);
120 elog(ERROR,
"Error while extracting the gidx from the geom");
125 dims_geom = GIDX_NDIMS(gidx_geom);
128 if (column->bv_allnulls)
137 if (dims_geom > max_dims)
143 SET_VARSIZE(gidx_geom, VARHDRSZ + max_dims * 2 *
sizeof(
float));
144 dims_geom = max_dims;
147 column->bv_values[
INCLUSION_UNION] = datumCopy((Datum) gidx_geom,
false,
148 GIDX_SIZE(dims_geom));
151 column->bv_allnulls =
false;
152 PG_RETURN_BOOL(
true);
156 dims_key = GIDX_NDIMS(gidx_key);
162 if (dims_key != dims_geom)
165 PG_RETURN_BOOL(
true);
170 PG_RETURN_BOOL(
false);
177 for ( i = 0; i < dims_key; i++ )
180 GIDX_SET_MIN(gidx_key, i,
181 Min(GIDX_GET_MIN(gidx_key,i),GIDX_GET_MIN(gidx_geom,i)));
183 GIDX_SET_MAX(gidx_key, i,
184 Max(GIDX_GET_MAX(gidx_key,i),GIDX_GET_MAX(gidx_geom,i)));
187 PG_RETURN_BOOL(
true);
#define INCLUSION_CONTAINS_EMPTY
bool gidx_contains(GIDX *a, GIDX *b)
bool is_gserialized_from_datum_empty(Datum the_datum)
#define INCLUSION_UNMERGEABLE