Don't accept length of -1 in pg_locale.h APIs.
Jeff Davis <jdavis@postgresql.org>
Don't accept length of -1 in pg_locale.h APIs. Reverts ac30021356. Per discussion, that commit interfered with useful tooling, and was not worth the special cases. Suggested-by: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/s32n3tm2mjh247f3xkkxkdk7cf77hglbr3ia3hrsdjylajou7y@nlldpag3tjd5
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/adt/pg_locale_builtin.c | modified | +6 −7 |
| src/backend/utils/adt/pg_locale.c | modified | +18 −24 |
| src/backend/utils/adt/pg_locale_icu.c | modified | +137 −50 |
| src/backend/utils/adt/pg_locale_libc.c | modified | +77 −84 |
| src/common/unicode_case.c | modified | +11 −15 |
| src/common/unicode/case_test.c | modified | +17 −52 |
| src/include/common/unicode_case.h | modified | +4 −4 |
| src/include/utils/pg_locale.h | modified | +27 −18 |
Discussion
- Refactor: allow pg_strncoll(), etc., to accept -1 length for NUL-terminated cstrings. 6 messages · 2024-08-22 → 2026-05-14