Repository navigation
test: range_pruning's twin picks its collation the way the shell does (#1341) - #1532
Merged
Merged
Conversation
…#1341) The twin listed candidates from pg_collation, in catalog order and without ICU, so on some hosts it chose a different collation from the shell, and on a host where only an ICU collation discriminates it would decline while the shell ran (#1529 review). It now tries the shell's five candidates in the shell's order, each asked directly; a missing or unsupported one becomes a query_error() and the next is tried. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
87 tasks done
OffgridwithJD
approved these changes
Oct 17, 2026
OffgridwithJD
left a comment
Collaborator
There was a problem hiding this comment.
@jdatcmd Approved at 5171bb88.
- PG17: twin 34 passed, shell 33/33 on the same tree;
compare_to_bash.pycovers every bash property. - Matches the shell: the five candidates
en_US.utf8, en_GB.utf8, unicode, ucs_basic, Care the shell's, in its order (range_pruning.sh:263), with the same probe('B' < 'a' COLLATE "<c>") <> ('B' < 'a').is Truecorresponds to the shell's= "t", and both stop at the first match and skip on none. - Measured on an ICU build: en_US f, en_GB f, unicode f, ucs_basic t, C t, so both pick
ucs_basic. - A missing collation is safe:
collation "nonexistent_coll" for encoding "UTF8" does not existcomes back as aquery_error()string, neverTrue, so the next candidate is tried. The connection stays idle and the later candidates answer normally.
I agree with your note 2: with the fixture running the shell's own procedure, a "chose the shell's candidate" check would recompute the same answer.
🤖 Generated with Claude Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The follow-up I promised on #1529, for #1341: the
range_pruningtwin now picks its collation the way the shell does.Note 1: the collation choice
The twin listed candidates from
pg_collation, in catalog order and with ICU filtered out. On an en_US.UTF-8 host, the #1529 review found the twin choosingCwhere the shell choseucs_basic(their measurement, not repeated here). And on a host where onlyunicodediscriminates, it would decline while the shell ran.It now tries the shell's five candidates in the shell's order, each asked directly with
('B' < 'a' COLLATE c) <> ('B' < 'a'). A collation that doesn't exist, or an ICU one in a build without ICU, raises._qturns that intoquery_error(), which is neverTrue, so the next candidate is tried. The connection is autocommit, so a failed candidate poisons nothing.Note 2: I left it, and here's why
I said I'd make
test_a_discriminating_collation_was_foundcheck that the twin chose the shell's first discriminating candidate. With the fixture now running the shell's own procedure, that check would recompute the same answer the same way, so it couldn't fail either. The shell records this name only as its SKIP, and the twin declines it on the same hosts the shell skips it on. That is the parity the name can carry, so the test stays as it is.Checks
compare_to_bash.py: every bash property covered.This is a twin-only change: no ledger or registry change.
🤖 Generated with Claude Code