Allow length=-1 for NUL-terminated input to pg_strncoll(), etc.
Jeff Davis <jdavis@postgresql.org>
Allow length=-1 for NUL-terminated input to pg_strncoll(), etc. Like ICU, allow a length of -1 to be specified for NUL-terminated arguments to pg_strncoll(), pg_strnxfrm(), and pg_strnxfrm_prefix(). Simplifies the code and comments. Discussion: https://postgr.es/m/2d758e07dff26bcc7cbe2aec57431329bfe3679a.camel@j-davis.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/adt/pg_locale.c | modified | +110 −159 |
| src/include/utils/pg_locale.h | modified | +4 −4 |
Discussion
- Refactor: allow pg_strncoll(), etc., to accept -1 length for NUL-terminated cstrings. 6 messages · 2024-08-22 → 2026-05-14