From: Tom Lane Date: Tue, 21 Jul 2020 23:40:44 +0000 (-0400) Subject: neqjoinsel must now pass through collation to eqjoinsel. X-Git-Tag: REL_14_BETA1~1939 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=bd0d893aa7aa303d7f344e267a9d3e53b0219491;p=postgresql.git 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 --- diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index be08eb48148..53d974125fd 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -2775,6 +2775,7 @@ neqjoinsel(PG_FUNCTION_ARGS) List *args = (List *) PG_GETARG_POINTER(2); JoinType jointype = (JoinType) PG_GETARG_INT16(3); SpecialJoinInfo *sjinfo = (SpecialJoinInfo *) PG_GETARG_POINTER(4); + Oid collation = PG_GET_COLLATION(); float8 result; if (jointype == JOIN_SEMI || jointype == JOIN_ANTI) @@ -2821,12 +2822,14 @@ neqjoinsel(PG_FUNCTION_ARGS) if (eqop) { - result = DatumGetFloat8(DirectFunctionCall5(eqjoinsel, - PointerGetDatum(root), - ObjectIdGetDatum(eqop), - PointerGetDatum(args), - Int16GetDatum(jointype), - PointerGetDatum(sjinfo))); + result = + DatumGetFloat8(DirectFunctionCall5Coll(eqjoinsel, + collation, + PointerGetDatum(root), + ObjectIdGetDatum(eqop), + PointerGetDatum(args), + Int16GetDatum(jointype), + PointerGetDatum(sjinfo))); } else {