Fix SQL parser bugs: PG ANALYZE loop, FOR XML, UNION alias, COLLATE, DM IDENTITY#6625
Open
Fix SQL parser bugs: PG ANALYZE loop, FOR XML, UNION alias, COLLATE, DM IDENTITY#6625
Conversation
- Fix PostgreSQL ANALYZE VERBOSE/SKIP_LOCKED infinite loop by adding EOF guard - Fix SQL Server FOR XML PATH output: off-by-one error losing first option and duplicate FOR XML prefix - Fix PostgreSQL AS table_name(column_name) syntax for UNION subqueries being rejected as SQL injection - Fix PostgreSQL ORDER BY COLLATE clause lost after ::text cast by extracting collate from charType - Fix DM (达梦) IDENTITY(1,1) parse failure by adding IDENTITY keyword and parseColumnRest handling Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
ANALYZE VERBOSE/ANALYZE SKIP_LOCKEDcausing infinite loop by addingToken.EOFguard inparseAnalyzeTable()loopFOR XML PATH(''), TYPEoutput — off-by-one error dropping first option + duplicateFOR XMLprefixAS table_name(column_name)for UNION subqueries being falsely rejected as SQL injection by addingSQLUnionQueryTableSourcecolumn alias parsingORDER BY col::text COLLATE "zh-Hans-x-icu"losing COLLATE clause by extracting collate from charType after::castIDENTITY(1,1)parse failure by adding IDENTITY keyword to DM_KEYWORDS and handling in baseparseColumnRestTest plan
Issue6595test: 5 cases (ANALYZE bare, VERBOSE, SKIP_LOCKED, combined, with table)Issue6564test: 3 cases (FOR XML PATH+TYPE, AUTO, PATH+ELEMENTS)Issue6572test: 2 cases (single/multiple column aliases on UNION subquery)Issue6573test: 3 cases (simple COLLATE, double-quoted COLLATE,::text COLLATE)DM_IdentityTest: 2 cases (IDENTITY with PRIMARY KEY, with NOT NULL)🤖 Generated with Claude Code