From 524e0f7ac8e143e377b8acff24796d7e37b3a9b1 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Thu, 23 Mar 2017 16:31:39 -0400 Subject: [PATCH] Fix crash in ICU patch This only happened with single-byte encodings. --- src/backend/utils/adt/like.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/utils/adt/like.c b/src/backend/utils/adt/like.c index 1f683ccd0f..b9806069c2 100644 --- a/src/backend/utils/adt/like.c +++ b/src/backend/utils/adt/like.c @@ -194,7 +194,7 @@ Generic_Text_IC_like(text *str, text *pat, Oid collation) * long way. */ - if (pg_database_encoding_max_length() > 1 || locale->provider == COLLPROVIDER_ICU) + if (pg_database_encoding_max_length() > 1 || (locale && locale->provider == COLLPROVIDER_ICU)) { /* lower's result is never packed, so OK to use old macros here */ pat = DatumGetTextPP(DirectFunctionCall1Coll(lower, collation, -- 2.40.0