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 varlena types

Follow up to commit 393bb504d7 which did this for numeric types.
This commit is contained in:
Andrew Dunstan
2017-03-21 09:53:35 -04:00
parent 4b1c68d63e
commit 65a9138b9b
6 changed files with 100 additions and 97 deletions

View File

@ -23,7 +23,7 @@ PG_FUNCTION_INFO_V1(gbt_bytea_same);
/* define for comparison */
static bool
gbt_byteagt(const void *a, const void *b, Oid collation)
gbt_byteagt(const void *a, const void *b, Oid collation, FmgrInfo *flinfo)
{
return DatumGetBool(DirectFunctionCall2(byteagt,
PointerGetDatum(a),
@ -31,7 +31,7 @@ gbt_byteagt(const void *a, const void *b, Oid collation)
}
static bool
gbt_byteage(const void *a, const void *b, Oid collation)
gbt_byteage(const void *a, const void *b, Oid collation, FmgrInfo *flinfo)
{
return DatumGetBool(DirectFunctionCall2(byteage,
PointerGetDatum(a),
@ -39,7 +39,7 @@ gbt_byteage(const void *a, const void *b, Oid collation)
}
static bool
gbt_byteaeq(const void *a, const void *b, Oid collation)
gbt_byteaeq(const void *a, const void *b, Oid collation, FmgrInfo *flinfo)
{
return DatumGetBool(DirectFunctionCall2(byteaeq,
PointerGetDatum(a),
@ -47,7 +47,7 @@ gbt_byteaeq(const void *a, const void *b, Oid collation)
}
static bool
gbt_byteale(const void *a, const void *b, Oid collation)
gbt_byteale(const void *a, const void *b, Oid collation, FmgrInfo *flinfo)
{
return DatumGetBool(DirectFunctionCall2(byteale,
PointerGetDatum(a),
@ -55,7 +55,7 @@ gbt_byteale(const void *a, const void *b, Oid collation)
}
static bool
gbt_bytealt(const void *a, const void *b, Oid collation)
gbt_bytealt(const void *a, const void *b, Oid collation, FmgrInfo *flinfo)
{
return DatumGetBool(DirectFunctionCall2(bytealt,
PointerGetDatum(a),
@ -63,7 +63,7 @@ gbt_bytealt(const void *a, const void *b, Oid collation)
}
static int32
gbt_byteacmp(const void *a, const void *b, Oid collation)
gbt_byteacmp(const void *a, const void *b, Oid collation, FmgrInfo *flinfo)
{
return DatumGetInt32(DirectFunctionCall2(byteacmp,
PointerGetDatum(a),
@ -118,7 +118,7 @@ gbt_bytea_consistent(PG_FUNCTION_ARGS)
*recheck = false;
retval = gbt_var_consistent(&r, query, strategy, PG_GET_COLLATION(),
GIST_LEAF(entry), &tinfo);
GIST_LEAF(entry), &tinfo, fcinfo->flinfo);
PG_RETURN_BOOL(retval);
}
@ -131,7 +131,7 @@ gbt_bytea_union(PG_FUNCTION_ARGS)
int32 *size = (int *) PG_GETARG_POINTER(1);
PG_RETURN_POINTER(gbt_var_union(entryvec, size, PG_GET_COLLATION(),
&tinfo));
&tinfo, fcinfo->flinfo));
}
@ -142,7 +142,7 @@ gbt_bytea_picksplit(PG_FUNCTION_ARGS)
GIST_SPLITVEC *v = (GIST_SPLITVEC *) PG_GETARG_POINTER(1);
gbt_var_picksplit(entryvec, v, PG_GET_COLLATION(),
&tinfo);
&tinfo, fcinfo->flinfo);
PG_RETURN_POINTER(v);
}
@ -153,7 +153,7 @@ gbt_bytea_same(PG_FUNCTION_ARGS)
Datum d2 = PG_GETARG_DATUM(1);
bool *result = (bool *) PG_GETARG_POINTER(2);
*result = gbt_var_same(d1, d2, PG_GET_COLLATION(), &tinfo);
*result = gbt_var_same(d1, d2, PG_GET_COLLATION(), &tinfo, fcinfo->flinfo);
PG_RETURN_POINTER(result);
}
@ -166,5 +166,5 @@ gbt_bytea_penalty(PG_FUNCTION_ARGS)
float *result = (float *) PG_GETARG_POINTER(2);
PG_RETURN_POINTER(gbt_var_penalty(result, o, n, PG_GET_COLLATION(),
&tinfo));
&tinfo, fcinfo->flinfo));
}