1
0
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:
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

@ -34,37 +34,37 @@ uuid_internal_cmp(const pg_uuid_t *arg1, const pg_uuid_t *arg2)
}
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);
@ -150,7 +150,7 @@ gbt_uuid_consistent(PG_FUNCTION_ARGS)
PG_RETURN_BOOL(
gbt_num_consistent(&key, (void *) query, &strategy,
GIST_LEAF(entry), &tinfo)
GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
);
}
@ -161,7 +161,7 @@ gbt_uuid_union(PG_FUNCTION_ARGS)
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));
}
/*
@ -222,7 +222,7 @@ gbt_uuid_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
));
}
@ -233,6 +233,6 @@ gbt_uuid_same(PG_FUNCTION_ARGS)
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);
}