mirror of
https://github.com/postgres/postgres.git
synced 2025-05-03 22:24:49 +03:00
neqjoinsel must now pass through collation to eqjoinsel.
Since commit 044c99bc5, eqjoinsel passes the passed-in collation to any operators it invokes. However, neqjoinsel failed to pass on whatever collation it got, so that if we invoked a collation-dependent operator via that code path, we'd get "could not determine which collation to use for string comparison" or the like. Per report from Justin Pryzby. Back-patch to v12, like the previous commit. Discussion: https://postgr.es/m/20200721191606.GL5748@telsasoft.com
This commit is contained in:
parent
43ef3c4c36
commit
171633ff5d
@ -2552,6 +2552,7 @@ neqjoinsel(PG_FUNCTION_ARGS)
|
|||||||
List *args = (List *) PG_GETARG_POINTER(2);
|
List *args = (List *) PG_GETARG_POINTER(2);
|
||||||
JoinType jointype = (JoinType) PG_GETARG_INT16(3);
|
JoinType jointype = (JoinType) PG_GETARG_INT16(3);
|
||||||
SpecialJoinInfo *sjinfo = (SpecialJoinInfo *) PG_GETARG_POINTER(4);
|
SpecialJoinInfo *sjinfo = (SpecialJoinInfo *) PG_GETARG_POINTER(4);
|
||||||
|
Oid collation = PG_GET_COLLATION();
|
||||||
float8 result;
|
float8 result;
|
||||||
|
|
||||||
if (jointype == JOIN_SEMI || jointype == JOIN_ANTI)
|
if (jointype == JOIN_SEMI || jointype == JOIN_ANTI)
|
||||||
@ -2598,7 +2599,9 @@ neqjoinsel(PG_FUNCTION_ARGS)
|
|||||||
|
|
||||||
if (eqop)
|
if (eqop)
|
||||||
{
|
{
|
||||||
result = DatumGetFloat8(DirectFunctionCall5(eqjoinsel,
|
result =
|
||||||
|
DatumGetFloat8(DirectFunctionCall5Coll(eqjoinsel,
|
||||||
|
collation,
|
||||||
PointerGetDatum(root),
|
PointerGetDatum(root),
|
||||||
ObjectIdGetDatum(eqop),
|
ObjectIdGetDatum(eqop),
|
||||||
PointerGetDatum(args),
|
PointerGetDatum(args),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user