Skip to content

Commit 45c19b6

Browse files
rzharkovhackorum
authored andcommitted
Fix citext_utf8 test's "Turkish I" with ICU collation provider
With the ICU collation provider the Turkish unicode symbol "İ" (U+0130 "LATIN CAPITAL LETTER I WITH DOT ABOVE") has two lowercase variants: - "i", i.e. "U+0069 LATIN SMALL LETTER I", in "tr" and "az" locales. - "i̇", i.e. "U+0069 LATIN SMALL LETTER I" followed by "U+0307 COMBINING DOT ABOVE" in all other locales I've tried (including "en-US", "de", "ru", etc). So, add both variants to the test.
1 parent d29d469 commit 45c19b6

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

contrib/citext/expected/citext_utf8.out

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,12 @@ SELECT 'Ä'::citext <> 'Ä'::citext AS t;
5858
t
5959
(1 row)
6060

61-
-- Test the Turkish dotted I. The lowercase is a single byte while the
61+
-- Test the Turkish dotted I. The lowercase might be a single byte while the
6262
-- uppercase is multibyte. This is why the comparison code can't be optimized
6363
-- to compare string lengths.
64-
SELECT 'i'::citext = 'İ'::citext AS t;
64+
-- Note that lower('İ') is 'i' (U+0069) in tr and az locales,
65+
-- but 'i̇' (U+0069 U+0307) in C and most (all?) other locales.
66+
SELECT 'İ'::citext in ('i'::citext, 'i̇'::citext) AS t;
6567
t
6668
---
6769
t

contrib/citext/sql/citext_utf8.sql

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ SELECT 'À'::citext <> 'B'::citext AS t;
3434
SELECT 'Ä'::text <> ''::text AS t;
3535
SELECT 'Ä'::citext <> ''::citext AS t;
3636

37-
-- Test the Turkish dotted I. The lowercase is a single byte while the
37+
-- Test the Turkish dotted I. The lowercase might be a single byte while the
3838
-- uppercase is multibyte. This is why the comparison code can't be optimized
3939
-- to compare string lengths.
40-
SELECT 'i'::citext = 'İ'::citext AS t;
40+
-- Note that lower('İ') is 'i' (U+0069) in tr and az locales,
41+
-- but 'i̇' (U+0069 U+0307) in C and most (all?) other locales.
42+
SELECT 'İ'::citext in ('i'::citext, ''::citext) AS t;
4143

4244
-- Regression.
4345
SELECT 'láska'::citext <> 'laská'::citext AS t;

0 commit comments

Comments
 (0)