PG_FUNCTION_INFO_V1(gbt_cash_same);
static bool
-gbt_cashgt(const void *a, const void *b)
+gbt_cashgt(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const Cash *) a) > *((const Cash *) b));
}
static bool
-gbt_cashge(const void *a, const void *b)
+gbt_cashge(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const Cash *) a) >= *((const Cash *) b));
}
static bool
-gbt_casheq(const void *a, const void *b)
+gbt_casheq(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const Cash *) a) == *((const Cash *) b));
}
static bool
-gbt_cashle(const void *a, const void *b)
+gbt_cashle(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const Cash *) a) <= *((const Cash *) b));
}
static bool
-gbt_cashlt(const void *a, const void *b)
+gbt_cashlt(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const Cash *) a) < *((const Cash *) b));
}
static int
-gbt_cashkey_cmp(const void *a, const void *b)
+gbt_cashkey_cmp(const void *a, const void *b, FmgrInfo *flinfo)
{
cashKEY *ia = (cashKEY *) (((const Nsrt *) a)->t);
cashKEY *ib = (cashKEY *) (((const Nsrt *) b)->t);
}
static float8
-gbt_cash_dist(const void *a, const void *b)
+gbt_cash_dist(const void *a, const void *b, FmgrInfo *flinfo)
{
return GET_FLOAT_DISTANCE(Cash, a, b);
}
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_BOOL(
- gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo)
+ gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
);
}
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_FLOAT8(
- gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
+ gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
);
}
void *out = palloc(sizeof(cashKEY));
*(int *) PG_GETARG_POINTER(1) = sizeof(cashKEY);
- PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo));
+ PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo, fcinfo->flinfo));
}
PG_RETURN_POINTER(gbt_num_picksplit(
(GistEntryVector *) PG_GETARG_POINTER(0),
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
- &tinfo
+ &tinfo, fcinfo->flinfo
));
}
cashKEY *b2 = (cashKEY *) PG_GETARG_POINTER(1);
bool *result = (bool *) PG_GETARG_POINTER(2);
- *result = gbt_num_same((void *) b1, (void *) b2, &tinfo);
+ *result = gbt_num_same((void *) b1, (void *) b2, &tinfo, fcinfo->flinfo);
PG_RETURN_POINTER(result);
}
PG_FUNCTION_INFO_V1(gbt_date_same);
static bool
-gbt_dategt(const void *a, const void *b)
+gbt_dategt(const void *a, const void *b, FmgrInfo *flinfo)
{
return DatumGetBool(
DirectFunctionCall2(date_gt, DateADTGetDatum(*((const DateADT *) a)), DateADTGetDatum(*((const DateADT *) b)))
}
static bool
-gbt_datege(const void *a, const void *b)
+gbt_datege(const void *a, const void *b, FmgrInfo *flinfo)
{
return DatumGetBool(
DirectFunctionCall2(date_ge, DateADTGetDatum(*((const DateADT *) a)), DateADTGetDatum(*((const DateADT *) b)))
}
static bool
-gbt_dateeq(const void *a, const void *b)
+gbt_dateeq(const void *a, const void *b, FmgrInfo *flinfo)
{
return DatumGetBool(
DirectFunctionCall2(date_eq, DateADTGetDatum(*((const DateADT *) a)), DateADTGetDatum(*((const DateADT *) b)))
}
static bool
-gbt_datele(const void *a, const void *b)
+gbt_datele(const void *a, const void *b, FmgrInfo *flinfo)
{
return DatumGetBool(
DirectFunctionCall2(date_le, DateADTGetDatum(*((const DateADT *) a)), DateADTGetDatum(*((const DateADT *) b)))
}
static bool
-gbt_datelt(const void *a, const void *b)
+gbt_datelt(const void *a, const void *b, FmgrInfo *flinfo)
{
return DatumGetBool(
DirectFunctionCall2(date_lt, DateADTGetDatum(*((const DateADT *) a)), DateADTGetDatum(*((const DateADT *) b)))
static int
-gbt_datekey_cmp(const void *a, const void *b)
+gbt_datekey_cmp(const void *a, const void *b, FmgrInfo *flinfo)
{
dateKEY *ia = (dateKEY *) (((const Nsrt *) a)->t);
dateKEY *ib = (dateKEY *) (((const Nsrt *) b)->t);
}
static float8
-gdb_date_dist(const void *a, const void *b)
+gdb_date_dist(const void *a, const void *b, FmgrInfo *flinfo)
{
/* we assume the difference can't overflow */
Datum diff = DirectFunctionCall2(date_mi,
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_BOOL(
- gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo)
+ gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
);
}
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_FLOAT8(
- gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
+ gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
);
}
void *out = palloc(sizeof(dateKEY));
*(int *) PG_GETARG_POINTER(1) = sizeof(dateKEY);
- PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo));
+ PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo, fcinfo->flinfo));
}
PG_RETURN_POINTER(gbt_num_picksplit(
(GistEntryVector *) PG_GETARG_POINTER(0),
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
- &tinfo
+ &tinfo, fcinfo->flinfo
));
}
dateKEY *b2 = (dateKEY *) PG_GETARG_POINTER(1);
bool *result = (bool *) PG_GETARG_POINTER(2);
- *result = gbt_num_same((void *) b1, (void *) b2, &tinfo);
+ *result = gbt_num_same((void *) b1, (void *) b2, &tinfo, fcinfo->flinfo);
PG_RETURN_POINTER(result);
}
PG_FUNCTION_INFO_V1(gbt_float4_same);
static bool
-gbt_float4gt(const void *a, const void *b)
+gbt_float4gt(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const float4 *) a) > *((const float4 *) b));
}
static bool
-gbt_float4ge(const void *a, const void *b)
+gbt_float4ge(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const float4 *) a) >= *((const float4 *) b));
}
static bool
-gbt_float4eq(const void *a, const void *b)
+gbt_float4eq(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const float4 *) a) == *((const float4 *) b));
}
static bool
-gbt_float4le(const void *a, const void *b)
+gbt_float4le(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const float4 *) a) <= *((const float4 *) b));
}
static bool
-gbt_float4lt(const void *a, const void *b)
+gbt_float4lt(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const float4 *) a) < *((const float4 *) b));
}
static int
-gbt_float4key_cmp(const void *a, const void *b)
+gbt_float4key_cmp(const void *a, const void *b, FmgrInfo *flinfo)
{
float4KEY *ia = (float4KEY *) (((const Nsrt *) a)->t);
float4KEY *ib = (float4KEY *) (((const Nsrt *) b)->t);
}
static float8
-gbt_float4_dist(const void *a, const void *b)
+gbt_float4_dist(const void *a, const void *b, FmgrInfo *flinfo)
{
return GET_FLOAT_DISTANCE(float4, a, b);
}
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_BOOL(
- gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo)
+ gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
);
}
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_FLOAT8(
- gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
+ gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
);
}
void *out = palloc(sizeof(float4KEY));
*(int *) PG_GETARG_POINTER(1) = sizeof(float4KEY);
- PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo));
+ PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo, fcinfo->flinfo));
}
PG_RETURN_POINTER(gbt_num_picksplit(
(GistEntryVector *) PG_GETARG_POINTER(0),
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
- &tinfo
+ &tinfo, fcinfo->flinfo
));
}
float4KEY *b2 = (float4KEY *) PG_GETARG_POINTER(1);
bool *result = (bool *) PG_GETARG_POINTER(2);
- *result = gbt_num_same((void *) b1, (void *) b2, &tinfo);
+ *result = gbt_num_same((void *) b1, (void *) b2, &tinfo, fcinfo->flinfo);
PG_RETURN_POINTER(result);
}
static bool
-gbt_float8gt(const void *a, const void *b)
+gbt_float8gt(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const float8 *) a) > *((const float8 *) b));
}
static bool
-gbt_float8ge(const void *a, const void *b)
+gbt_float8ge(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const float8 *) a) >= *((const float8 *) b));
}
static bool
-gbt_float8eq(const void *a, const void *b)
+gbt_float8eq(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const float8 *) a) == *((const float8 *) b));
}
static bool
-gbt_float8le(const void *a, const void *b)
+gbt_float8le(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const float8 *) a) <= *((const float8 *) b));
}
static bool
-gbt_float8lt(const void *a, const void *b)
+gbt_float8lt(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const float8 *) a) < *((const float8 *) b));
}
static int
-gbt_float8key_cmp(const void *a, const void *b)
+gbt_float8key_cmp(const void *a, const void *b, FmgrInfo *flinfo)
{
float8KEY *ia = (float8KEY *) (((const Nsrt *) a)->t);
float8KEY *ib = (float8KEY *) (((const Nsrt *) b)->t);
}
static float8
-gbt_float8_dist(const void *a, const void *b)
+gbt_float8_dist(const void *a, const void *b, FmgrInfo *flinfo)
{
float8 arg1 = *(const float8 *) a;
float8 arg2 = *(const float8 *) b;
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_BOOL(
- gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo)
+ gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
);
}
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_FLOAT8(
- gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
+ gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
);
}
void *out = palloc(sizeof(float8KEY));
*(int *) PG_GETARG_POINTER(1) = sizeof(float8KEY);
- PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo));
+ PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo, fcinfo->flinfo));
}
PG_RETURN_POINTER(gbt_num_picksplit(
(GistEntryVector *) PG_GETARG_POINTER(0),
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
- &tinfo
+ &tinfo, fcinfo->flinfo
));
}
float8KEY *b2 = (float8KEY *) PG_GETARG_POINTER(1);
bool *result = (bool *) PG_GETARG_POINTER(2);
- *result = gbt_num_same((void *) b1, (void *) b2, &tinfo);
+ *result = gbt_num_same((void *) b1, (void *) b2, &tinfo, fcinfo->flinfo);
PG_RETURN_POINTER(result);
}
static bool
-gbt_inetgt(const void *a, const void *b)
+gbt_inetgt(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const double *) a) > *((const double *) b));
}
static bool
-gbt_inetge(const void *a, const void *b)
+gbt_inetge(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const double *) a) >= *((const double *) b));
}
static bool
-gbt_ineteq(const void *a, const void *b)
+gbt_ineteq(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const double *) a) == *((const double *) b));
}
static bool
-gbt_inetle(const void *a, const void *b)
+gbt_inetle(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const double *) a) <= *((const double *) b));
}
static bool
-gbt_inetlt(const void *a, const void *b)
+gbt_inetlt(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const double *) a) < *((const double *) b));
}
static int
-gbt_inetkey_cmp(const void *a, const void *b)
+gbt_inetkey_cmp(const void *a, const void *b, FmgrInfo *flinfo)
{
inetKEY *ia = (inetKEY *) (((const Nsrt *) a)->t);
inetKEY *ib = (inetKEY *) (((const Nsrt *) b)->t);
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query,
- &strategy, GIST_LEAF(entry), &tinfo));
+ &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
}
void *out = palloc(sizeof(inetKEY));
*(int *) PG_GETARG_POINTER(1) = sizeof(inetKEY);
- PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo));
+ PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo, fcinfo->flinfo));
}
PG_RETURN_POINTER(gbt_num_picksplit(
(GistEntryVector *) PG_GETARG_POINTER(0),
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
- &tinfo
+ &tinfo, fcinfo->flinfo
));
}
inetKEY *b2 = (inetKEY *) PG_GETARG_POINTER(1);
bool *result = (bool *) PG_GETARG_POINTER(2);
- *result = gbt_num_same((void *) b1, (void *) b2, &tinfo);
+ *result = gbt_num_same((void *) b1, (void *) b2, &tinfo, fcinfo->flinfo);
PG_RETURN_POINTER(result);
}
PG_FUNCTION_INFO_V1(gbt_int2_same);
static bool
-gbt_int2gt(const void *a, const void *b)
+gbt_int2gt(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const int16 *) a) > *((const int16 *) b));
}
static bool
-gbt_int2ge(const void *a, const void *b)
+gbt_int2ge(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const int16 *) a) >= *((const int16 *) b));
}
static bool
-gbt_int2eq(const void *a, const void *b)
+gbt_int2eq(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const int16 *) a) == *((const int16 *) b));
}
static bool
-gbt_int2le(const void *a, const void *b)
+gbt_int2le(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const int16 *) a) <= *((const int16 *) b));
}
static bool
-gbt_int2lt(const void *a, const void *b)
+gbt_int2lt(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const int16 *) a) < *((const int16 *) b));
}
static int
-gbt_int2key_cmp(const void *a, const void *b)
+gbt_int2key_cmp(const void *a, const void *b, FmgrInfo *flinfo)
{
int16KEY *ia = (int16KEY *) (((const Nsrt *) a)->t);
int16KEY *ib = (int16KEY *) (((const Nsrt *) b)->t);
}
static float8
-gbt_int2_dist(const void *a, const void *b)
+gbt_int2_dist(const void *a, const void *b, FmgrInfo *flinfo)
{
return GET_FLOAT_DISTANCE(int16, a, b);
}
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_BOOL(
- gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo)
+ gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
);
}
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_FLOAT8(
- gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
+ gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
);
}
void *out = palloc(sizeof(int16KEY));
*(int *) PG_GETARG_POINTER(1) = sizeof(int16KEY);
- PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo));
+ PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo, fcinfo->flinfo));
}
PG_RETURN_POINTER(gbt_num_picksplit(
(GistEntryVector *) PG_GETARG_POINTER(0),
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
- &tinfo
+ &tinfo, fcinfo->flinfo
));
}
int16KEY *b2 = (int16KEY *) PG_GETARG_POINTER(1);
bool *result = (bool *) PG_GETARG_POINTER(2);
- *result = gbt_num_same((void *) b1, (void *) b2, &tinfo);
+ *result = gbt_num_same((void *) b1, (void *) b2, &tinfo, fcinfo->flinfo);
PG_RETURN_POINTER(result);
}
static bool
-gbt_int4gt(const void *a, const void *b)
+gbt_int4gt(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const int32 *) a) > *((const int32 *) b));
}
static bool
-gbt_int4ge(const void *a, const void *b)
+gbt_int4ge(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const int32 *) a) >= *((const int32 *) b));
}
static bool
-gbt_int4eq(const void *a, const void *b)
+gbt_int4eq(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const int32 *) a) == *((const int32 *) b));
}
static bool
-gbt_int4le(const void *a, const void *b)
+gbt_int4le(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const int32 *) a) <= *((const int32 *) b));
}
static bool
-gbt_int4lt(const void *a, const void *b)
+gbt_int4lt(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const int32 *) a) < *((const int32 *) b));
}
static int
-gbt_int4key_cmp(const void *a, const void *b)
+gbt_int4key_cmp(const void *a, const void *b, FmgrInfo *flinfo)
{
int32KEY *ia = (int32KEY *) (((const Nsrt *) a)->t);
int32KEY *ib = (int32KEY *) (((const Nsrt *) b)->t);
}
static float8
-gbt_int4_dist(const void *a, const void *b)
+gbt_int4_dist(const void *a, const void *b, FmgrInfo *flinfo)
{
return GET_FLOAT_DISTANCE(int32, a, b);
}
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_BOOL(
- gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo)
+ gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
);
}
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_FLOAT8(
- gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
+ gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
);
}
void *out = palloc(sizeof(int32KEY));
*(int *) PG_GETARG_POINTER(1) = sizeof(int32KEY);
- PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo));
+ PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo, fcinfo->flinfo));
}
PG_RETURN_POINTER(gbt_num_picksplit(
(GistEntryVector *) PG_GETARG_POINTER(0),
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
- &tinfo
+ &tinfo, fcinfo->flinfo
));
}
int32KEY *b2 = (int32KEY *) PG_GETARG_POINTER(1);
bool *result = (bool *) PG_GETARG_POINTER(2);
- *result = gbt_num_same((void *) b1, (void *) b2, &tinfo);
+ *result = gbt_num_same((void *) b1, (void *) b2, &tinfo, fcinfo->flinfo);
PG_RETURN_POINTER(result);
}
static bool
-gbt_int8gt(const void *a, const void *b)
+gbt_int8gt(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const int64 *) a) > *((const int64 *) b));
}
static bool
-gbt_int8ge(const void *a, const void *b)
+gbt_int8ge(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const int64 *) a) >= *((const int64 *) b));
}
static bool
-gbt_int8eq(const void *a, const void *b)
+gbt_int8eq(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const int64 *) a) == *((const int64 *) b));
}
static bool
-gbt_int8le(const void *a, const void *b)
+gbt_int8le(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const int64 *) a) <= *((const int64 *) b));
}
static bool
-gbt_int8lt(const void *a, const void *b)
+gbt_int8lt(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const int64 *) a) < *((const int64 *) b));
}
static int
-gbt_int8key_cmp(const void *a, const void *b)
+gbt_int8key_cmp(const void *a, const void *b, FmgrInfo *flinfo)
{
int64KEY *ia = (int64KEY *) (((const Nsrt *) a)->t);
int64KEY *ib = (int64KEY *) (((const Nsrt *) b)->t);
}
static float8
-gbt_int8_dist(const void *a, const void *b)
+gbt_int8_dist(const void *a, const void *b, FmgrInfo *flinfo)
{
return GET_FLOAT_DISTANCE(int64, a, b);
}
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_BOOL(
- gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo)
+ gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
);
}
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_FLOAT8(
- gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
+ gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
);
}
void *out = palloc(sizeof(int64KEY));
*(int *) PG_GETARG_POINTER(1) = sizeof(int64KEY);
- PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo));
+ PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo, fcinfo->flinfo));
}
PG_RETURN_POINTER(gbt_num_picksplit(
(GistEntryVector *) PG_GETARG_POINTER(0),
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
- &tinfo
+ &tinfo, fcinfo->flinfo
));
}
int64KEY *b2 = (int64KEY *) PG_GETARG_POINTER(1);
bool *result = (bool *) PG_GETARG_POINTER(2);
- *result = gbt_num_same((void *) b1, (void *) b2, &tinfo);
+ *result = gbt_num_same((void *) b1, (void *) b2, &tinfo, fcinfo->flinfo);
PG_RETURN_POINTER(result);
}
static bool
-gbt_intvgt(const void *a, const void *b)
+gbt_intvgt(const void *a, const void *b, FmgrInfo *flinfo)
{
return DatumGetBool(DirectFunctionCall2(interval_gt, IntervalPGetDatum(a), IntervalPGetDatum(b)));
}
static bool
-gbt_intvge(const void *a, const void *b)
+gbt_intvge(const void *a, const void *b, FmgrInfo *flinfo)
{
return DatumGetBool(DirectFunctionCall2(interval_ge, IntervalPGetDatum(a), IntervalPGetDatum(b)));
}
static bool
-gbt_intveq(const void *a, const void *b)
+gbt_intveq(const void *a, const void *b, FmgrInfo *flinfo)
{
return DatumGetBool(DirectFunctionCall2(interval_eq, IntervalPGetDatum(a), IntervalPGetDatum(b)));
}
static bool
-gbt_intvle(const void *a, const void *b)
+gbt_intvle(const void *a, const void *b, FmgrInfo *flinfo)
{
return DatumGetBool(DirectFunctionCall2(interval_le, IntervalPGetDatum(a), IntervalPGetDatum(b)));
}
static bool
-gbt_intvlt(const void *a, const void *b)
+gbt_intvlt(const void *a, const void *b, FmgrInfo *flinfo)
{
return DatumGetBool(DirectFunctionCall2(interval_lt, IntervalPGetDatum(a), IntervalPGetDatum(b)));
}
static int
-gbt_intvkey_cmp(const void *a, const void *b)
+gbt_intvkey_cmp(const void *a, const void *b, FmgrInfo *flinfo)
{
intvKEY *ia = (intvKEY *) (((const Nsrt *) a)->t);
intvKEY *ib = (intvKEY *) (((const Nsrt *) b)->t);
}
static float8
-gbt_intv_dist(const void *a, const void *b)
+gbt_intv_dist(const void *a, const void *b, FmgrInfo *flinfo)
{
return (float8) Abs(intr2num((const Interval *) a) - intr2num((const Interval *) b));
}
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_BOOL(
- gbt_num_consistent(&key, (void *) query, &strategy, GIST_LEAF(entry), &tinfo)
+ gbt_num_consistent(&key, (void *) query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
);
}
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_FLOAT8(
- gbt_num_distance(&key, (void *) query, GIST_LEAF(entry), &tinfo)
+ gbt_num_distance(&key, (void *) query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
);
}
void *out = palloc(sizeof(intvKEY));
*(int *) PG_GETARG_POINTER(1) = sizeof(intvKEY);
- PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo));
+ PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo, fcinfo->flinfo));
}
PG_RETURN_POINTER(gbt_num_picksplit(
(GistEntryVector *) PG_GETARG_POINTER(0),
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
- &tinfo
+ &tinfo, fcinfo->flinfo
));
}
intvKEY *b2 = (intvKEY *) PG_GETARG_POINTER(1);
bool *result = (bool *) PG_GETARG_POINTER(2);
- *result = gbt_num_same((void *) b1, (void *) b2, &tinfo);
+ *result = gbt_num_same((void *) b1, (void *) b2, &tinfo, fcinfo->flinfo);
PG_RETURN_POINTER(result);
}
static bool
-gbt_macadgt(const void *a, const void *b)
+gbt_macadgt(const void *a, const void *b, FmgrInfo *flinfo)
{
return DatumGetBool(DirectFunctionCall2(macaddr_gt, PointerGetDatum(a), PointerGetDatum(b)));
}
static bool
-gbt_macadge(const void *a, const void *b)
+gbt_macadge(const void *a, const void *b, FmgrInfo *flinfo)
{
return DatumGetBool(DirectFunctionCall2(macaddr_ge, PointerGetDatum(a), PointerGetDatum(b)));
}
static bool
-gbt_macadeq(const void *a, const void *b)
+gbt_macadeq(const void *a, const void *b, FmgrInfo *flinfo)
{
return DatumGetBool(DirectFunctionCall2(macaddr_eq, PointerGetDatum(a), PointerGetDatum(b)));
}
static bool
-gbt_macadle(const void *a, const void *b)
+gbt_macadle(const void *a, const void *b, FmgrInfo *flinfo)
{
return DatumGetBool(DirectFunctionCall2(macaddr_le, PointerGetDatum(a), PointerGetDatum(b)));
}
static bool
-gbt_macadlt(const void *a, const void *b)
+gbt_macadlt(const void *a, const void *b, FmgrInfo *flinfo)
{
return DatumGetBool(DirectFunctionCall2(macaddr_lt, PointerGetDatum(a), PointerGetDatum(b)));
}
static int
-gbt_macadkey_cmp(const void *a, const void *b)
+gbt_macadkey_cmp(const void *a, const void *b, FmgrInfo *flinfo)
{
macKEY *ia = (macKEY *) (((const Nsrt *) a)->t);
macKEY *ib = (macKEY *) (((const Nsrt *) b)->t);
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_BOOL(
- gbt_num_consistent(&key, (void *) query, &strategy, GIST_LEAF(entry), &tinfo)
+ gbt_num_consistent(&key, (void *) query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
);
}
void *out = palloc0(sizeof(macKEY));
*(int *) PG_GETARG_POINTER(1) = sizeof(macKEY);
- PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo));
+ PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo, fcinfo->flinfo));
}
PG_RETURN_POINTER(gbt_num_picksplit(
(GistEntryVector *) PG_GETARG_POINTER(0),
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
- &tinfo
+ &tinfo, fcinfo->flinfo
));
}
macKEY *b2 = (macKEY *) PG_GETARG_POINTER(1);
bool *result = (bool *) PG_GETARG_POINTER(2);
- *result = gbt_num_same((void *) b1, (void *) b2, &tinfo);
+ *result = gbt_num_same((void *) b1, (void *) b2, &tinfo, fcinfo->flinfo);
PG_RETURN_POINTER(result);
}
static bool
-gbt_macad8gt(const void *a, const void *b)
+gbt_macad8gt(const void *a, const void *b, FmgrInfo *flinfo)
{
return DatumGetBool(DirectFunctionCall2(macaddr8_gt, PointerGetDatum(a), PointerGetDatum(b)));
}
static bool
-gbt_macad8ge(const void *a, const void *b)
+gbt_macad8ge(const void *a, const void *b, FmgrInfo *flinfo)
{
return DatumGetBool(DirectFunctionCall2(macaddr8_ge, PointerGetDatum(a), PointerGetDatum(b)));
}
static bool
-gbt_macad8eq(const void *a, const void *b)
+gbt_macad8eq(const void *a, const void *b, FmgrInfo *flinfo)
{
return DatumGetBool(DirectFunctionCall2(macaddr8_eq, PointerGetDatum(a), PointerGetDatum(b)));
}
static bool
-gbt_macad8le(const void *a, const void *b)
+gbt_macad8le(const void *a, const void *b, FmgrInfo *flinfo)
{
return DatumGetBool(DirectFunctionCall2(macaddr8_le, PointerGetDatum(a), PointerGetDatum(b)));
}
static bool
-gbt_macad8lt(const void *a, const void *b)
+gbt_macad8lt(const void *a, const void *b, FmgrInfo *flinfo)
{
return DatumGetBool(DirectFunctionCall2(macaddr8_lt, PointerGetDatum(a), PointerGetDatum(b)));
}
static int
-gbt_macad8key_cmp(const void *a, const void *b)
+gbt_macad8key_cmp(const void *a, const void *b, FmgrInfo *flinfo)
{
mac8KEY *ia = (mac8KEY *) (((const Nsrt *) a)->t);
mac8KEY *ib = (mac8KEY *) (((const Nsrt *) b)->t);
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_BOOL(
- gbt_num_consistent(&key, (void *) query, &strategy, GIST_LEAF(entry), &tinfo)
+ gbt_num_consistent(&key, (void *) query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
);
}
void *out = palloc0(sizeof(mac8KEY));
*(int *) PG_GETARG_POINTER(1) = sizeof(mac8KEY);
- PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo));
+ PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo, fcinfo->flinfo));
}
PG_RETURN_POINTER(gbt_num_picksplit(
(GistEntryVector *) PG_GETARG_POINTER(0),
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
- &tinfo
+ &tinfo, fcinfo->flinfo
));
}
mac8KEY *b2 = (mac8KEY *) PG_GETARG_POINTER(1);
bool *result = (bool *) PG_GETARG_POINTER(2);
- *result = gbt_num_same((void *) b1, (void *) b2, &tinfo);
+ *result = gbt_num_same((void *) b1, (void *) b2, &tinfo, fcinfo->flinfo);
PG_RETURN_POINTER(result);
}
static bool
-gbt_oidgt(const void *a, const void *b)
+gbt_oidgt(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const Oid *) a) > *((const Oid *) b));
}
static bool
-gbt_oidge(const void *a, const void *b)
+gbt_oidge(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const Oid *) a) >= *((const Oid *) b));
}
static bool
-gbt_oideq(const void *a, const void *b)
+gbt_oideq(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const Oid *) a) == *((const Oid *) b));
}
static bool
-gbt_oidle(const void *a, const void *b)
+gbt_oidle(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const Oid *) a) <= *((const Oid *) b));
}
static bool
-gbt_oidlt(const void *a, const void *b)
+gbt_oidlt(const void *a, const void *b, FmgrInfo *flinfo)
{
return (*((const Oid *) a) < *((const Oid *) b));
}
static int
-gbt_oidkey_cmp(const void *a, const void *b)
+gbt_oidkey_cmp(const void *a, const void *b, FmgrInfo *flinfo)
{
oidKEY *ia = (oidKEY *) (((const Nsrt *) a)->t);
oidKEY *ib = (oidKEY *) (((const Nsrt *) b)->t);
}
static float8
-gbt_oid_dist(const void *a, const void *b)
+gbt_oid_dist(const void *a, const void *b, FmgrInfo *flinfo)
{
Oid aa = *(const Oid *) a;
Oid bb = *(const Oid *) b;
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_BOOL(
- gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo)
+ gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
);
}
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_FLOAT8(
- gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
+ gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
);
}
void *out = palloc(sizeof(oidKEY));
*(int *) PG_GETARG_POINTER(1) = sizeof(oidKEY);
- PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo));
+ PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo, fcinfo->flinfo));
}
PG_RETURN_POINTER(gbt_num_picksplit(
(GistEntryVector *) PG_GETARG_POINTER(0),
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
- &tinfo
+ &tinfo, fcinfo->flinfo
));
}
oidKEY *b2 = (oidKEY *) PG_GETARG_POINTER(1);
bool *result = (bool *) PG_GETARG_POINTER(2);
- *result = gbt_num_same((void *) b1, (void *) b2, &tinfo);
+ *result = gbt_num_same((void *) b1, (void *) b2, &tinfo, fcinfo->flinfo);
PG_RETURN_POINTER(result);
}
static bool
-gbt_timegt(const void *a, const void *b)
+gbt_timegt(const void *a, const void *b, FmgrInfo *flinfo)
{
const TimeADT *aa = (const TimeADT *) a;
const TimeADT *bb = (const TimeADT *) b;
}
static bool
-gbt_timege(const void *a, const void *b)
+gbt_timege(const void *a, const void *b, FmgrInfo *flinfo)
{
const TimeADT *aa = (const TimeADT *) a;
const TimeADT *bb = (const TimeADT *) b;
}
static bool
-gbt_timeeq(const void *a, const void *b)
+gbt_timeeq(const void *a, const void *b, FmgrInfo *flinfo)
{
const TimeADT *aa = (const TimeADT *) a;
const TimeADT *bb = (const TimeADT *) b;
}
static bool
-gbt_timele(const void *a, const void *b)
+gbt_timele(const void *a, const void *b, FmgrInfo *flinfo)
{
const TimeADT *aa = (const TimeADT *) a;
const TimeADT *bb = (const TimeADT *) b;
}
static bool
-gbt_timelt(const void *a, const void *b)
+gbt_timelt(const void *a, const void *b, FmgrInfo *flinfo)
{
const TimeADT *aa = (const TimeADT *) a;
const TimeADT *bb = (const TimeADT *) b;
static int
-gbt_timekey_cmp(const void *a, const void *b)
+gbt_timekey_cmp(const void *a, const void *b, FmgrInfo *flinfo)
{
timeKEY *ia = (timeKEY *) (((const Nsrt *) a)->t);
timeKEY *ib = (timeKEY *) (((const Nsrt *) b)->t);
}
static float8
-gbt_time_dist(const void *a, const void *b)
+gbt_time_dist(const void *a, const void *b, FmgrInfo *flinfo)
{
const TimeADT *aa = (const TimeADT *) a;
const TimeADT *bb = (const TimeADT *) b;
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_BOOL(
- gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo)
+ gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
);
}
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_FLOAT8(
- gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
+ gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
);
}
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_BOOL(
- gbt_num_consistent(&key, (void *) &qqq, &strategy, GIST_LEAF(entry), &tinfo)
+ gbt_num_consistent(&key, (void *) &qqq, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
);
}
void *out = palloc(sizeof(timeKEY));
*(int *) PG_GETARG_POINTER(1) = sizeof(timeKEY);
- PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo));
+ PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo, fcinfo->flinfo));
}
PG_RETURN_POINTER(gbt_num_picksplit(
(GistEntryVector *) PG_GETARG_POINTER(0),
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
- &tinfo
+ &tinfo, fcinfo->flinfo
));
}
timeKEY *b2 = (timeKEY *) PG_GETARG_POINTER(1);
bool *result = (bool *) PG_GETARG_POINTER(2);
- *result = gbt_num_same((void *) b1, (void *) b2, &tinfo);
+ *result = gbt_num_same((void *) b1, (void *) b2, &tinfo, fcinfo->flinfo);
PG_RETURN_POINTER(result);
}
static bool
-gbt_tsgt(const void *a, const void *b)
+gbt_tsgt(const void *a, const void *b, FmgrInfo *flinfo)
{
const Timestamp *aa = (const Timestamp *) a;
const Timestamp *bb = (const Timestamp *) b;
}
static bool
-gbt_tsge(const void *a, const void *b)
+gbt_tsge(const void *a, const void *b, FmgrInfo *flinfo)
{
const Timestamp *aa = (const Timestamp *) a;
const Timestamp *bb = (const Timestamp *) b;
}
static bool
-gbt_tseq(const void *a, const void *b)
+gbt_tseq(const void *a, const void *b, FmgrInfo *flinfo)
{
const Timestamp *aa = (const Timestamp *) a;
const Timestamp *bb = (const Timestamp *) b;
}
static bool
-gbt_tsle(const void *a, const void *b)
+gbt_tsle(const void *a, const void *b, FmgrInfo *flinfo)
{
const Timestamp *aa = (const Timestamp *) a;
const Timestamp *bb = (const Timestamp *) b;
}
static bool
-gbt_tslt(const void *a, const void *b)
+gbt_tslt(const void *a, const void *b, FmgrInfo *flinfo)
{
const Timestamp *aa = (const Timestamp *) a;
const Timestamp *bb = (const Timestamp *) b;
static int
-gbt_tskey_cmp(const void *a, const void *b)
+gbt_tskey_cmp(const void *a, const void *b, FmgrInfo *flinfo)
{
tsKEY *ia = (tsKEY *) (((const Nsrt *) a)->t);
tsKEY *ib = (tsKEY *) (((const Nsrt *) b)->t);
}
static float8
-gbt_ts_dist(const void *a, const void *b)
+gbt_ts_dist(const void *a, const void *b, FmgrInfo *flinfo)
{
const Timestamp *aa = (const Timestamp *) a;
const Timestamp *bb = (const Timestamp *) b;
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_BOOL(
- gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo)
+ gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
);
}
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_FLOAT8(
- gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
+ gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
);
}
qqq = tstz_to_ts_gmt(query);
PG_RETURN_BOOL(
- gbt_num_consistent(&key, (void *) &qqq, &strategy, GIST_LEAF(entry), &tinfo)
+ gbt_num_consistent(&key, (void *) &qqq, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
);
}
qqq = tstz_to_ts_gmt(query);
PG_RETURN_FLOAT8(
- gbt_num_distance(&key, (void *) &qqq, GIST_LEAF(entry), &tinfo)
+ gbt_num_distance(&key, (void *) &qqq, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
);
}
void *out = palloc(sizeof(tsKEY));
*(int *) PG_GETARG_POINTER(1) = sizeof(tsKEY);
- PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo));
+ PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo, fcinfo->flinfo));
}
PG_RETURN_POINTER(gbt_num_picksplit(
(GistEntryVector *) PG_GETARG_POINTER(0),
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
- &tinfo
+ &tinfo, fcinfo->flinfo
));
}
tsKEY *b2 = (tsKEY *) PG_GETARG_POINTER(1);
bool *result = (bool *) PG_GETARG_POINTER(2);
- *result = gbt_num_same((void *) b1, (void *) b2, &tinfo);
+ *result = gbt_num_same((void *) b1, (void *) b2, &tinfo, fcinfo->flinfo);
PG_RETURN_POINTER(result);
}
*/
void *
-gbt_num_union(GBT_NUMKEY *out, const GistEntryVector *entryvec, const gbtree_ninfo *tinfo)
+gbt_num_union(GBT_NUMKEY *out, const GistEntryVector *entryvec, const gbtree_ninfo *tinfo, FmgrInfo *flinfo)
{
int i,
numranges;
cur = (GBT_NUMKEY *) DatumGetPointer((entryvec->vector[i].key));
c.lower = &cur[0];
c.upper = &cur[tinfo->size];
- if ((*tinfo->f_gt) (o.lower, c.lower)) /* out->lower > cur->lower */
+ if ((*tinfo->f_gt) (o.lower, c.lower, flinfo)) /* out->lower > cur->lower */
memcpy((void *) o.lower, (void *) c.lower, tinfo->size);
- if ((*tinfo->f_lt) (o.upper, c.upper)) /* out->upper < cur->upper */
+ if ((*tinfo->f_lt) (o.upper, c.upper, flinfo)) /* out->upper < cur->upper */
memcpy((void *) o.upper, (void *) c.upper, tinfo->size);
}
*/
bool
-gbt_num_same(const GBT_NUMKEY *a, const GBT_NUMKEY *b, const gbtree_ninfo *tinfo)
+gbt_num_same(const GBT_NUMKEY *a, const GBT_NUMKEY *b, const gbtree_ninfo *tinfo, FmgrInfo *flinfo)
{
GBT_NUMKEY_R b1,
b2;
b2.lower = &(((GBT_NUMKEY *) b)[0]);
b2.upper = &(((GBT_NUMKEY *) b)[tinfo->size]);
- return ((*tinfo->f_eq) (b1.lower, b2.lower) &&
- (*tinfo->f_eq) (b1.upper, b2.upper));
+ return ((*tinfo->f_eq) (b1.lower, b2.lower, flinfo) &&
+ (*tinfo->f_eq) (b1.upper, b2.upper, flinfo));
}
void
-gbt_num_bin_union(Datum *u, GBT_NUMKEY *e, const gbtree_ninfo *tinfo)
+gbt_num_bin_union(Datum *u, GBT_NUMKEY *e, const gbtree_ninfo *tinfo, FmgrInfo *flinfo)
{
GBT_NUMKEY_R rd;
ur.lower = &(((GBT_NUMKEY *) DatumGetPointer(*u))[0]);
ur.upper = &(((GBT_NUMKEY *) DatumGetPointer(*u))[tinfo->size]);
- if ((*tinfo->f_gt) ((void *) ur.lower, (void *) rd.lower))
+ if ((*tinfo->f_gt) ((void *) ur.lower, (void *) rd.lower, flinfo))
memcpy((void *) ur.lower, (void *) rd.lower, tinfo->size);
- if ((*tinfo->f_lt) ((void *) ur.upper, (void *) rd.upper))
+ if ((*tinfo->f_lt) ((void *) ur.upper, (void *) rd.upper, flinfo))
memcpy((void *) ur.upper, (void *) rd.upper, tinfo->size);
}
}
const void *query,
const StrategyNumber *strategy,
bool is_leaf,
- const gbtree_ninfo *tinfo)
+ const gbtree_ninfo *tinfo,
+ FmgrInfo *flinfo)
{
bool retval;
switch (*strategy)
{
case BTLessEqualStrategyNumber:
- retval = (*tinfo->f_ge) (query, key->lower);
+ retval = (*tinfo->f_ge) (query, key->lower, flinfo);
break;
case BTLessStrategyNumber:
if (is_leaf)
- retval = (*tinfo->f_gt) (query, key->lower);
+ retval = (*tinfo->f_gt) (query, key->lower, flinfo);
else
- retval = (*tinfo->f_ge) (query, key->lower);
+ retval = (*tinfo->f_ge) (query, key->lower, flinfo);
break;
case BTEqualStrategyNumber:
if (is_leaf)
- retval = (*tinfo->f_eq) (query, key->lower);
+ retval = (*tinfo->f_eq) (query, key->lower, flinfo);
else
- retval = ((*tinfo->f_le) (key->lower, query) && (*tinfo->f_le) (query, key->upper)) ? true : false;
+ retval = ((*tinfo->f_le) (key->lower, query, flinfo) && (*tinfo->f_le) (query, key->upper, flinfo)) ? true : false;
break;
case BTGreaterStrategyNumber:
if (is_leaf)
- retval = (*tinfo->f_lt) (query, key->upper);
+ retval = (*tinfo->f_lt) (query, key->upper, flinfo);
else
- retval = (*tinfo->f_le) (query, key->upper);
+ retval = (*tinfo->f_le) (query, key->upper, flinfo);
break;
case BTGreaterEqualStrategyNumber:
- retval = (*tinfo->f_le) (query, key->upper);
+ retval = (*tinfo->f_le) (query, key->upper, flinfo);
break;
case BtreeGistNotEqualStrategyNumber:
- retval = (!((*tinfo->f_eq) (query, key->lower) &&
- (*tinfo->f_eq) (query, key->upper))) ? true : false;
+ retval = (!((*tinfo->f_eq) (query, key->lower, flinfo) &&
+ (*tinfo->f_eq) (query, key->upper, flinfo))) ? true : false;
break;
default:
retval = false;
gbt_num_distance(const GBT_NUMKEY_R *key,
const void *query,
bool is_leaf,
- const gbtree_ninfo *tinfo)
+ const gbtree_ninfo *tinfo,
+ FmgrInfo *flinfo)
{
float8 retval;
if (tinfo->f_dist == NULL)
elog(ERROR, "KNN search is not supported for btree_gist type %d",
(int) tinfo->t);
- if (tinfo->f_le(query, key->lower))
- retval = tinfo->f_dist(query, key->lower);
- else if (tinfo->f_ge(query, key->upper))
- retval = tinfo->f_dist(query, key->upper);
+ if (tinfo->f_le(query, key->lower, flinfo))
+ retval = tinfo->f_dist(query, key->lower, flinfo);
+ else if (tinfo->f_ge(query, key->upper, flinfo))
+ retval = tinfo->f_dist(query, key->upper, flinfo);
else
retval = 0.0;
GIST_SPLITVEC *
gbt_num_picksplit(const GistEntryVector *entryvec, GIST_SPLITVEC *v,
- const gbtree_ninfo *tinfo)
+ const gbtree_ninfo *tinfo, FmgrInfo *flinfo)
{
OffsetNumber i,
maxoff = entryvec->n - 1;
arr[i].t = (GBT_NUMKEY *) DatumGetPointer((entryvec->vector[i].key));
arr[i].i = i;
}
- qsort((void *) &arr[FirstOffsetNumber], maxoff - FirstOffsetNumber + 1, sizeof(Nsrt), tinfo->f_cmp);
+ qsort_arg((void *) &arr[FirstOffsetNumber], maxoff - FirstOffsetNumber + 1, sizeof(Nsrt), (qsort_arg_comparator) tinfo->f_cmp, (void *) flinfo);
/* We do simply create two parts */
{
if (i <= (maxoff - FirstOffsetNumber + 1) / 2)
{
- gbt_num_bin_union(&v->spl_ldatum, arr[i].t, tinfo);
+ gbt_num_bin_union(&v->spl_ldatum, arr[i].t, tinfo, flinfo);
v->spl_left[v->spl_nleft] = arr[i].i;
v->spl_nleft++;
}
else
{
- gbt_num_bin_union(&v->spl_rdatum, arr[i].t, tinfo);
+ gbt_num_bin_union(&v->spl_rdatum, arr[i].t, tinfo, flinfo);
v->spl_right[v->spl_nright] = arr[i].i;
v->spl_nright++;
}
/* Methods */
- bool (*f_gt) (const void *, const void *); /* greater than */
- bool (*f_ge) (const void *, const void *); /* greater or equal */
- bool (*f_eq) (const void *, const void *); /* equal */
- bool (*f_le) (const void *, const void *); /* less or equal */
- bool (*f_lt) (const void *, const void *); /* less than */
- int (*f_cmp) (const void *, const void *); /* key compare function */
- float8 (*f_dist) (const void *, const void *); /* key distance function */
+ bool (*f_gt) (const void *, const void *, FmgrInfo *); /* greater than */
+ bool (*f_ge) (const void *, const void *, FmgrInfo *); /* greater or equal */
+ bool (*f_eq) (const void *, const void *, FmgrInfo *); /* equal */
+ bool (*f_le) (const void *, const void *, FmgrInfo *); /* less or equal */
+ bool (*f_lt) (const void *, const void *, FmgrInfo *); /* less than */
+ int (*f_cmp) (const void *, const void *, FmgrInfo *); /* key compare function */
+ float8 (*f_dist) (const void *, const void *, FmgrInfo *); /* key distance function */
} gbtree_ninfo;
extern bool gbt_num_consistent(const GBT_NUMKEY_R *key, const void *query,
const StrategyNumber *strategy, bool is_leaf,
- const gbtree_ninfo *tinfo);
+ const gbtree_ninfo *tinfo, FmgrInfo *flinfo);
extern float8 gbt_num_distance(const GBT_NUMKEY_R *key, const void *query,
- bool is_leaf, const gbtree_ninfo *tinfo);
+ bool is_leaf, const gbtree_ninfo *tinfo, FmgrInfo *flinfo);
extern GIST_SPLITVEC *gbt_num_picksplit(const GistEntryVector *entryvec, GIST_SPLITVEC *v,
- const gbtree_ninfo *tinfo);
+ const gbtree_ninfo *tinfo, FmgrInfo *flinfo);
extern GISTENTRY *gbt_num_compress(GISTENTRY *entry, const gbtree_ninfo *tinfo);
extern GISTENTRY *gbt_num_fetch(GISTENTRY *entry, const gbtree_ninfo *tinfo);
extern void *gbt_num_union(GBT_NUMKEY *out, const GistEntryVector *entryvec,
- const gbtree_ninfo *tinfo);
+ const gbtree_ninfo *tinfo, FmgrInfo *flinfo);
extern bool gbt_num_same(const GBT_NUMKEY *a, const GBT_NUMKEY *b,
- const gbtree_ninfo *tinfo);
+ const gbtree_ninfo *tinfo, FmgrInfo *flinfo);
extern void gbt_num_bin_union(Datum *u, GBT_NUMKEY *e,
- const gbtree_ninfo *tinfo);
+ const gbtree_ninfo *tinfo, FmgrInfo *flinfo);
#endif
}
static bool
-gbt_uuidgt(const void *a, const void *b)
+gbt_uuidgt(const void *a, const void *b, FmgrInfo *flinfo)
{
return uuid_internal_cmp((const pg_uuid_t *) a, (const pg_uuid_t *) b) > 0;
}
static bool
-gbt_uuidge(const void *a, const void *b)
+gbt_uuidge(const void *a, const void *b, FmgrInfo *flinfo)
{
return uuid_internal_cmp((const pg_uuid_t *) a, (const pg_uuid_t *) b) >= 0;
}
static bool
-gbt_uuideq(const void *a, const void *b)
+gbt_uuideq(const void *a, const void *b, FmgrInfo *flinfo)
{
return uuid_internal_cmp((const pg_uuid_t *) a, (const pg_uuid_t *) b) == 0;
}
static bool
-gbt_uuidle(const void *a, const void *b)
+gbt_uuidle(const void *a, const void *b, FmgrInfo *flinfo)
{
return uuid_internal_cmp((const pg_uuid_t *) a, (const pg_uuid_t *) b) <= 0;
}
static bool
-gbt_uuidlt(const void *a, const void *b)
+gbt_uuidlt(const void *a, const void *b, FmgrInfo *flinfo)
{
return uuid_internal_cmp((const pg_uuid_t *) a, (const pg_uuid_t *) b) < 0;
}
static int
-gbt_uuidkey_cmp(const void *a, const void *b)
+gbt_uuidkey_cmp(const void *a, const void *b, FmgrInfo *flinfo)
{
uuidKEY *ia = (uuidKEY *) (((const Nsrt *) a)->t);
uuidKEY *ib = (uuidKEY *) (((const Nsrt *) b)->t);
PG_RETURN_BOOL(
gbt_num_consistent(&key, (void *) query, &strategy,
- GIST_LEAF(entry), &tinfo)
+ GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
);
}
void *out = palloc(sizeof(uuidKEY));
*(int *) PG_GETARG_POINTER(1) = sizeof(uuidKEY);
- PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo));
+ PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo, fcinfo->flinfo));
}
/*
PG_RETURN_POINTER(gbt_num_picksplit(
(GistEntryVector *) PG_GETARG_POINTER(0),
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
- &tinfo
+ &tinfo, fcinfo->flinfo
));
}
uuidKEY *b2 = (uuidKEY *) PG_GETARG_POINTER(1);
bool *result = (bool *) PG_GETARG_POINTER(2);
- *result = gbt_num_same((void *) b1, (void *) b2, &tinfo);
+ *result = gbt_num_same((void *) b1, (void *) b2, &tinfo, fcinfo->flinfo);
PG_RETURN_POINTER(result);
}