fix(sql): cannot order by columns with purely numeric names#5435
Merged
bluestreak01 merged 8 commits intomasterfrom Mar 5, 2025
Merged
fix(sql): cannot order by columns with purely numeric names#5435bluestreak01 merged 8 commits intomasterfrom
bluestreak01 merged 8 commits intomasterfrom
Conversation
…y with positional ordering rewrite
29 tasks
Contributor
[PR Coverage check]😍 pass : 5 / 5 (100.00%) file detail
|
bluestreak01
approved these changes
Mar 5, 2025
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.
Fixes #5405
Related to #5408
rewriteOrderByPositionhandles positional order by queries i.eORDER BY 1, 2.There was a prior issue, where a column name that started with a number would throw a spurious error, despite being a valid column name.
This fixes an issue where a purely numeric named column would be interpreted as a positional index, and therefore error as out of range.
Now, the behaviour is that if the order by column is a number, and out of range, it will then be checked for a matching column name. If there is one, it will ignore it in
rewriteOrderByPositionand let it continue. If the position is ambiguous (i.e there is both a position and a matching name), it would order based on the position.