992{
993 GISTENTRY *entry = (GISTENTRY*) PG_GETARG_POINTER(0);
994 StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
995 bool result;
996 BOX2DF query_gbox_index;
997
998
999
1000 bool *recheck = (bool *) PG_GETARG_POINTER(4);
1001
1002
1003
1004
1005 *recheck = false;
1006
1007 POSTGIS_DEBUG(4, "[GIST] 'consistent' function called");
1008
1009
1010 if ( DatumGetPointer(PG_GETARG_DATUM(1)) == NULL )
1011 {
1012 POSTGIS_DEBUG(4, "[GIST] null query pointer (!?!), returning false");
1013 PG_RETURN_BOOL(false);
1014 }
1015
1016
1017 if ( DatumGetPointer(entry->key) == NULL )
1018 {
1019 POSTGIS_DEBUG(4, "[GIST] null index entry, returning false");
1020 PG_RETURN_BOOL(false);
1021 }
1022
1023
1025 {
1026 POSTGIS_DEBUG(4, "[GIST] null query_gbox_index!");
1027 PG_RETURN_BOOL(false);
1028 }
1029
1030
1031 if (GIST_LEAF(entry))
1032 {
1034 (BOX2DF*)DatumGetPointer(entry->key),
1035 &query_gbox_index, strategy);
1036 }
1037 else
1038 {
1040 (BOX2DF*)DatumGetPointer(entry->key),
1041 &query_gbox_index, strategy);
1042 }
1043
1044 PG_RETURN_BOOL(result);
1045}
static bool gserialized_gist_consistent_internal_2d(BOX2DF *key, BOX2DF *query, StrategyNumber strategy)
int gserialized_datum_get_box2df_p(Datum gsdatum, BOX2DF *box2df)
Peak into a GSERIALIZED datum to find the bounding box.
static bool gserialized_gist_consistent_leaf_2d(BOX2DF *key, BOX2DF *query, StrategyNumber strategy)