mirror of
https://github.com/postgres/postgres.git
synced 2025-06-11 20:28:21 +03:00
Use CallerFInfoFunctionCall with btree_gist for numeric types
None of the existing types actually need to use this mechanism, but this will allow support for enum types which will need it. A separate patch will adjust the varlena types support for consistency. Reviewed by Tom Lane and Anastasia Lubennikova Discussion: http://postgr.es/m/27220.1478360811@sss.pgh.pa.us
This commit is contained in:
@ -28,37 +28,37 @@ PG_FUNCTION_INFO_V1(gbt_macad_same);
|
||||
|
||||
|
||||
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);
|
||||
@ -142,7 +142,7 @@ gbt_macad_consistent(PG_FUNCTION_ARGS)
|
||||
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)
|
||||
);
|
||||
}
|
||||
|
||||
@ -154,7 +154,7 @@ gbt_macad_union(PG_FUNCTION_ARGS)
|
||||
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));
|
||||
}
|
||||
|
||||
|
||||
@ -184,7 +184,7 @@ gbt_macad_picksplit(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_POINTER(gbt_num_picksplit(
|
||||
(GistEntryVector *) PG_GETARG_POINTER(0),
|
||||
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
|
||||
&tinfo
|
||||
&tinfo, fcinfo->flinfo
|
||||
));
|
||||
}
|
||||
|
||||
@ -195,6 +195,6 @@ gbt_macad_same(PG_FUNCTION_ARGS)
|
||||
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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user