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_text_same);
/* define for comparison */
static bool
gbt_textgt(const void *a, const void *b, Oid collation)
gbt_textgt(const void *a, const void *b, Oid collation, FmgrInfo *flinfo)
{
return DatumGetBool(DirectFunctionCall2Coll(text_gt,
collation,
@ -32,7 +32,7 @@ gbt_textgt(const void *a, const void *b, Oid collation)
}
static bool
gbt_textge(const void *a, const void *b, Oid collation)
gbt_textge(const void *a, const void *b, Oid collation, FmgrInfo *flinfo)
{
return DatumGetBool(DirectFunctionCall2Coll(text_ge,
collation,
@ -41,7 +41,7 @@ gbt_textge(const void *a, const void *b, Oid collation)
}
static bool
gbt_texteq(const void *a, const void *b, Oid collation)
gbt_texteq(const void *a, const void *b, Oid collation, FmgrInfo *flinfo)
{
return DatumGetBool(DirectFunctionCall2Coll(texteq,
collation,
@ -50,7 +50,7 @@ gbt_texteq(const void *a, const void *b, Oid collation)
}
static bool
gbt_textle(const void *a, const void *b, Oid collation)
gbt_textle(const void *a, const void *b, Oid collation, FmgrInfo *flinfo)
{
return DatumGetBool(DirectFunctionCall2Coll(text_le,
collation,
@ -59,7 +59,7 @@ gbt_textle(const void *a, const void *b, Oid collation)
}
static bool
gbt_textlt(const void *a, const void *b, Oid collation)
gbt_textlt(const void *a, const void *b, Oid collation, FmgrInfo *flinfo)
{
return DatumGetBool(DirectFunctionCall2Coll(text_lt,
collation,
@ -68,7 +68,7 @@ gbt_textlt(const void *a, const void *b, Oid collation)
}
static int32
gbt_textcmp(const void *a, const void *b, Oid collation)
gbt_textcmp(const void *a, const void *b, Oid collation, FmgrInfo *flinfo)
{
return DatumGetInt32(DirectFunctionCall2Coll(bttextcmp,
collation,
@ -161,7 +161,7 @@ gbt_text_consistent(PG_FUNCTION_ARGS)
}
retval = gbt_var_consistent(&r, query, strategy, PG_GET_COLLATION(),
GIST_LEAF(entry), &tinfo);
GIST_LEAF(entry), &tinfo, fcinfo->flinfo);
PG_RETURN_BOOL(retval);
}
@ -190,7 +190,7 @@ gbt_bpchar_consistent(PG_FUNCTION_ARGS)
}
retval = gbt_var_consistent(&r, trim, strategy, PG_GET_COLLATION(),
GIST_LEAF(entry), &tinfo);
GIST_LEAF(entry), &tinfo, fcinfo->flinfo);
PG_RETURN_BOOL(retval);
}
@ -202,7 +202,7 @@ gbt_text_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));
}
@ -213,7 +213,7 @@ gbt_text_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);
}
@ -224,7 +224,7 @@ gbt_text_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);
}
@ -237,5 +237,5 @@ gbt_text_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));
}