From f413941f41d370a7893caa3e6ed384b89a0577fd Mon Sep 17 00:00:00 2001 From: Jeff Davis Date: Fri, 17 Mar 2023 11:47:35 -0700 Subject: Fix t_isspace(), etc., when datlocprovider=i and datctype=C. Check whether the datctype is C to determine whether t_isspace() and related functions use isspace() or iswspace(). Previously, t_isspace() checked whether the database default collation was C; which is incorrect when the default collation uses the ICU provider. Discussion: https://postgr.es/m/79e4354d9eccfdb00483146a6b9f6295202e7890.camel@j-davis.com Reviewed-by: Peter Eisentraut Backpatch-through: 15 --- contrib/unaccent/expected/unaccent.out | 9 --------- contrib/unaccent/expected/unaccent_1.out | 8 -------- contrib/unaccent/sql/unaccent.sql | 11 ----------- 3 files changed, 28 deletions(-) delete mode 100644 contrib/unaccent/expected/unaccent_1.out (limited to 'contrib') diff --git a/contrib/unaccent/expected/unaccent.out b/contrib/unaccent/expected/unaccent.out index cef98ee60c..ee0ac71a1c 100644 --- a/contrib/unaccent/expected/unaccent.out +++ b/contrib/unaccent/expected/unaccent.out @@ -1,12 +1,3 @@ --- unaccent is broken if the default collation is provided by ICU and --- LC_CTYPE=C -SELECT current_setting('lc_ctype') = 'C' AND - (SELECT datlocprovider='i' FROM pg_database - WHERE datname=current_database()) - AS skip_test \gset -\if :skip_test -\quit -\endif CREATE EXTENSION unaccent; -- must have a UTF8 database SELECT getdatabaseencoding(); diff --git a/contrib/unaccent/expected/unaccent_1.out b/contrib/unaccent/expected/unaccent_1.out deleted file mode 100644 index 0a4a3838ab..0000000000 --- a/contrib/unaccent/expected/unaccent_1.out +++ /dev/null @@ -1,8 +0,0 @@ --- unaccent is broken if the default collation is provided by ICU and --- LC_CTYPE=C -SELECT current_setting('lc_ctype') = 'C' AND - (SELECT datlocprovider='i' FROM pg_database - WHERE datname=current_database()) - AS skip_test \gset -\if :skip_test -\quit diff --git a/contrib/unaccent/sql/unaccent.sql b/contrib/unaccent/sql/unaccent.sql index 027dfb964a..3fc0c706be 100644 --- a/contrib/unaccent/sql/unaccent.sql +++ b/contrib/unaccent/sql/unaccent.sql @@ -1,14 +1,3 @@ - --- unaccent is broken if the default collation is provided by ICU and --- LC_CTYPE=C -SELECT current_setting('lc_ctype') = 'C' AND - (SELECT datlocprovider='i' FROM pg_database - WHERE datname=current_database()) - AS skip_test \gset -\if :skip_test -\quit -\endif - CREATE EXTENSION unaccent; -- must have a UTF8 database -- cgit v1.2.1