Commit d57d6153 authored by Tom Lane's avatar Tom Lane

Add missing check_collation_set call to bpcharne().

We should throw an error for indeterminate collation, but bpcharne()
was missing that logic, resulting in a much less user-friendly error
(either an assertion failure or "cache lookup failed for collation 0").

Per report from Manuel Rigger.  Back-patch to v12 where the mistake
came in, evidently in commit 5e1963fb.  (Before non-deterministic
collations, this function wasn't collation sensitive.)

Discussion: https://postgr.es/m/CA+u7OA4HOjtymxAbuGNh4-X_2R0Lw5n01tzvP8E5-i-2gQXYWA@mail.gmail.com
parent 0cafdd03
...@@ -784,6 +784,8 @@ bpcharne(PG_FUNCTION_ARGS) ...@@ -784,6 +784,8 @@ bpcharne(PG_FUNCTION_ARGS)
bool result; bool result;
Oid collid = PG_GET_COLLATION(); Oid collid = PG_GET_COLLATION();
check_collation_set(collid);
len1 = bcTruelen(arg1); len1 = bcTruelen(arg1);
len2 = bcTruelen(arg2); len2 = bcTruelen(arg2);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment