I am realizing gist index and get a bug, that crashes DB. I' debugged my program as Robert(thanks !) advised me and I know which procedure crashed.
Datum gist_mov_consistent(PG_FUNCTION_ARGS)
{
GISTENTRY *entry = (GISTENTRY *)PG_GETARG_POINTER(0);
BOX *query = PG_GETARG_BOX_P(1);
StrategyNumber strategy = (StrategyNumber)PG_GETARG_UINT16(2);
if (DatumGetMovP(entry->key) == NULL || query == NULL)
PG_RETURN_BOOL(FALSE);
PG_RETURN_BOOL(obj_contains(DatumGetMovP(entry->key), query));
}
int obj_contains(moving_object *a, BOX *b)
{
if (b->low.x > a->x_low)
return 0;
if (b->low.y > a->y_low)
return 0;
if (b->high.x < a->x_high)
return 0;
if (b->high.y < a->y_high)
return 0;
return 1;
}
Do you have any ideas ?
Best regards,
Sergej Galkin