Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 171633f

Browse files
committed
neqjoinsel must now pass through collation to eqjoinsel.
Since commit 044c99b, 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/[email protected]
1 parent 43ef3c4 commit 171633f

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/backend/utils/adt/selfuncs.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2552,6 +2552,7 @@ neqjoinsel(PG_FUNCTION_ARGS)
25522552
List *args = (List *) PG_GETARG_POINTER(2);
25532553
JoinType jointype = (JoinType) PG_GETARG_INT16(3);
25542554
SpecialJoinInfo *sjinfo = (SpecialJoinInfo *) PG_GETARG_POINTER(4);
2555+
Oid collation = PG_GET_COLLATION();
25552556
float8 result;
25562557

25572558
if (jointype == JOIN_SEMI || jointype == JOIN_ANTI)
@@ -2598,12 +2599,14 @@ neqjoinsel(PG_FUNCTION_ARGS)
25982599

25992600
if (eqop)
26002601
{
2601-
result = DatumGetFloat8(DirectFunctionCall5(eqjoinsel,
2602-
PointerGetDatum(root),
2603-
ObjectIdGetDatum(eqop),
2604-
PointerGetDatum(args),
2605-
Int16GetDatum(jointype),
2606-
PointerGetDatum(sjinfo)));
2602+
result =
2603+
DatumGetFloat8(DirectFunctionCall5Coll(eqjoinsel,
2604+
collation,
2605+
PointerGetDatum(root),
2606+
ObjectIdGetDatum(eqop),
2607+
PointerGetDatum(args),
2608+
Int16GetDatum(jointype),
2609+
PointerGetDatum(sjinfo)));
26072610
}
26082611
else
26092612
{

0 commit comments

Comments
 (0)