1
0
mirror of https://github.com/postgres/postgres.git synced 2026-10-23 13:29:09 +03:00
Files
postgres/src
Jeff Davis c00a97b646 Fix ILIKE patterns with non-ASCII bytes in single-byte encodings.
Commit 1e493158d3 changed the MATCH_LOWER implementation of GETCHAR()
from SB_lower_char() to use pg_ascii_tolower().  The latter returns an
unsigned char; but the local variable in C_IMatchText was a char.

For single-byte encodings and the C locale, that could lead to a
broken signed/unsigned comparison.  For example, the pattern
U&'%\00C6' would never match.

Fix by casting the result of pg_ascii_tolower() explicitly to char.

Reported-by: Greg Burd <greg@burd.me>
Reviewed-by: Greg Burd <greg@burd.me>
Discussion: https://postgr.es/m/_GW2V-rd0QW4BTguAJriA9XVmjOn2mR3-YeAZr9ZU6EtlLvYPEm_r_fV5wGKzSNMzboj_nqn3fk72AYAvOKzEnPlCCHteaYrgESrIhPg6l8=@burd.me
Backpatch-through: 19
2026-10-21 05:52:47 -07:00
..
2026-10-07 08:41:48 +02:00
2026-10-07 14:33:14 +02:00
2026-04-06 21:55:08 +02:00
2026-02-23 13:34:22 -05:00
2026-01-01 13:24:10 -05:00