pg_locale.h: define case mapping limits. Clearly define case mapping upper bounds that cover all providers, locales, and encodings: PG_MAX_CASEMAP_MBCHARS, PG_MAX_CASEMAP_EXPANSION, and PG_CASEMAP_BUFSZ.
Also redefine UTF8_CASEMAP_BUFSZ to include room for a NUL for consistency with PG_CASEMAP_BUFSZ. Use PG_CASEMAP_BUFSZ for the static buffer in ltree/crc32.c. Remove macros UNICODE_CASEMAP_LEN (which was redundant with UNICODE_MAX_CASEMAP_CODEPOINTS from unicode_limits.h), and UNICODE_CASEMAP_BUFSZ which was not as descriptive or helpful. Suggested-by: Heikki Linnakangas <[email protected]> Reviewed-by: Rithvika Devisetti <[email protected]> Discussion: https://postgr.es/m/[email protected] Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/1e9b06a8e07c3bd394459e68902b79d7b55c2035 Modified Files -------------- contrib/ltree/crc32.c | 2 +- src/backend/utils/adt/pg_locale.c | 44 ++++++++++++++++++----- src/common/unicode/generate-unicode_case_table.pl | 4 +-- src/include/common/unicode_limits.h | 4 +-- src/include/utils/pg_locale.h | 35 +++++++++++++----- 5 files changed, 67 insertions(+), 22 deletions(-)
