diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2020-07-21 19:40:44 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2020-07-21 19:40:44 -0400 |
commit | 171633ff5d8e21ceda5d824f3c9f13aa18a78505 (patch) | |
tree | adb8c1835e77d2e631c6566c1e9fd1e052286979 | |
parent | 43ef3c4c360a10226732b62ab3b2097cdf089dce (diff) | |
download | postgresql-171633ff5d8e21ceda5d824f3c9f13aa18a78505.tar.gz postgresql-171633ff5d8e21ceda5d824f3c9f13aa18a78505.zip |
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
-rw-r--r-- | src/backend/utils/adt/selfuncs.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index f9a2c96b0e4..a8f984037f9 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -2552,6 +2552,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) @@ -2598,12 +2599,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 { |