model-writtenrun 428 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Jeff Davis proposed explicitly reserving a terminating NUL byte in ltree's case-folding buffer and asserting that the result fits; the existing buffer was large enough in practice, so this addressed fragility rather than a demonstrated failure #1.
- Heikki Linnakangas endorsed the fix but questioned whether the bound covered every collation provider and locale, requesting documentation for pg_strfold() and related functions #2.
- Jeff retained the original fix for backpatching through PostgreSQL 18 and added a development-branch-only patch defining provider-independent case-mapping limits, making UTF8_CASEMAP_BUFSZ include NUL space, and using PG_CASEMAP_BUFSZ in ltree #3.
- Rithvika Devisetti tested both patches on macOS with assertions enabled, reporting 360 passing tests, a separate passing saslprep run, and successful expanding-case-mapping and indexed-ltree checks #4.
- Jeff committed the first patch with only an explanatory buffer comment added aea7bed4a7, then committed the second patch with additional documentation and expansion-bound assertions in four case-mapping wrappers 1e9b06a8e0; both came from #3.
- After both changes landed, Heikki questioned whether the new limits confused character counts with byte counts #5, then immediately withdrew the concern after noticing that PG_CASEMAP_BUFSZ and PG_MAX_CASEMAP_MBCHARS were distinct, leaving no outstanding issue in the thread #6.