Files
pad/internal
xarmian d86a499f56 fix(store): the SQLSTATE extractor indexed one string and sliced another (BUG-2810)
Codex round 7. sqlStateOf searched strings.ToUpper(msg) for the marker and then
sliced the ORIGINAL message at that offset. Correct only while every byte
before the marker is ASCII: Unicode case mapping changes byte LENGTH for some
runes, and PostgreSQL renders messages in lc_messages, so a non-English server
is not a hypothetical.

One string now serves both the search and the slice, which also makes the
returned code uppercase without a second conversion.

Mutation-verified rather than argued: against a message carrying U+0131 (two
bytes, uppercasing to a one-byte "I") the old code returns "TE 22" where the
code is "22P05". That garbage happens to classify as unavailable — the safe
direction — but only by luck; a different offset lands on a spurious "22"
prefix and turns a check that never completed into a verdict about the value.

The regression leg uses a localised message shape for that reason, and the
failure it produces is the one above.
2026-09-02 17:35:58 +00:00
..
2026-03-26 01:52:36 +00:00