Skip to content

Commit bd0d893

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/20200721191606.GL5748@telsasoft.com
1 parent 4a70f82 commit bd0d893

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
@@ -2775,6 +2775,7 @@ neqjoinsel(PG_FUNCTION_ARGS)
27752775
List *args = (List *) PG_GETARG_POINTER(2);
27762776
JoinType jointype = (JoinType) PG_GETARG_INT16(3);
27772777
SpecialJoinInfo *sjinfo = (SpecialJoinInfo *) PG_GETARG_POINTER(4);
2778+
Oid collation = PG_GET_COLLATION();
27782779
float8 result;
27792780

27802781
if (jointype == JOIN_SEMI || jointype == JOIN_ANTI)
@@ -2821,12 +2822,14 @@ neqjoinsel(PG_FUNCTION_ARGS)
28212822

28222823
if (eqop)
28232824
{
2824-
result = DatumGetFloat8(DirectFunctionCall5(eqjoinsel,
2825-
PointerGetDatum(root),
2826-
ObjectIdGetDatum(eqop),
2827-
PointerGetDatum(args),
2828-
Int16GetDatum(jointype),
2829-
PointerGetDatum(sjinfo)));
2825+
result =
2826+
DatumGetFloat8(DirectFunctionCall5Coll(eqjoinsel,
2827+
collation,
2828+
PointerGetDatum(root),
2829+
ObjectIdGetDatum(eqop),
2830+
PointerGetDatum(args),
2831+
Int16GetDatum(jointype),
2832+
PointerGetDatum(sjinfo)));
28302833
}
28312834
else
28322835
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy