diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2019-11-13 15:53:53 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2019-11-13 15:53:53 -0500 |
commit | d57d61533a2b5b27b60cc9024c54688390871bf6 (patch) | |
tree | 717b67c402d8f292c9f7b8e3b26f1174a3509953 /src/backend/utils/adt/varchar.c | |
parent | 0cafdd03a850265006c0ada1b0bf4f83e087a409 (diff) | |
download | postgresql-d57d61533a2b5b27b60cc9024c54688390871bf6.tar.gz postgresql-d57d61533a2b5b27b60cc9024c54688390871bf6.zip |
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 5e1963fb7. (Before non-deterministic
collations, this function wasn't collation sensitive.)
Discussion: https://postgr.es/m/CA+u7OA4HOjtymxAbuGNh4-X_2R0Lw5n01tzvP8E5-i-2gQXYWA@mail.gmail.com
Diffstat (limited to 'src/backend/utils/adt/varchar.c')
-rw-r--r-- | src/backend/utils/adt/varchar.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/backend/utils/adt/varchar.c b/src/backend/utils/adt/varchar.c index 2aed4119740..0469726ec04 100644 --- a/src/backend/utils/adt/varchar.c +++ b/src/backend/utils/adt/varchar.c @@ -784,6 +784,8 @@ bpcharne(PG_FUNCTION_ARGS) bool result; Oid collid = PG_GET_COLLATION(); + check_collation_set(collid); + len1 = bcTruelen(arg1); len2 = bcTruelen(arg2); |