Fix planner's test for case-foldable characters in ILIKE with ICU.
Tom Lane <tgl@sss.pgh.pa.us>
Fix planner's test for case-foldable characters in ILIKE with ICU. As coded, the ICU-collation path in pattern_char_isalpha() failed to consider regular ASCII letters to be case-varying. This led to like_fixed_prefix treating too much of an ILIKE pattern as being a fixed prefix, so that indexscans derived from an ILIKE clause might miss entries that they should find. Per bug #15892 from James Inform. This is an oversight in the original ICU patch (commit eccfef81e), so back-patch to v10 where that came in. Discussion: https://postgr.es/m/15892-e5d2bea3e8a04a1b@postgresql.org
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/adt/selfuncs.c | modified | +6 −4 |
| src/test/regress/expected/collate.icu.utf8.out | modified | +32 −0 |
| src/test/regress/sql/collate.icu.utf8.sql | modified | +9 −0 |
Discussion
- BUG #15892: URGENT: Using an ICU collation in a primary key column breaks ILIKE query 9 messages · 2019-07-03 → 2019-08-12