1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +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:
Andrew Dunstan
2017-03-21 09:12:46 -04:00
parent eb2a6131be
commit 4b1c68d63e
17 changed files with 219 additions and 217 deletions

View File

@ -27,33 +27,33 @@ PG_FUNCTION_INFO_V1(gbt_inet_same);
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);
@ -133,7 +133,7 @@ gbt_inet_consistent(PG_FUNCTION_ARGS)
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));
}
@ -144,7 +144,7 @@ gbt_inet_union(PG_FUNCTION_ARGS)
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));
}
@ -167,7 +167,7 @@ gbt_inet_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
));
}
@ -178,6 +178,6 @@ gbt_inet_same(PG_FUNCTION_ARGS)
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);
}