1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-15 19:21:59 +03:00

Fix crash in ICU patch

This only happened with single-byte encodings.
This commit is contained in:
Peter Eisentraut
2017-03-23 16:31:39 -04:00
parent c23b186ae9
commit 524e0f7ac8

View File

@ -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,