fix(mysql): enable window function parsing for data export sql_type#3335
Merged
Conversation
Enable pingcap parser window function syntax in SQL splitter so SELECT statements containing OVER(...) parse as SelectStmt instead of UnparsedStmt, fixing export_sql_type misclassified as ddl.
PR Reviewer Guide 🔍
|
PR Code Suggestions ✨No code suggestions found for the PR. |
Seechi-Yolo
approved these changes
Jun 18, 2026
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.
User description
Fixes actiontech/sqle-ee#2987
Summary
parser.EnableWindowFunc(true)in MySQL splitter so SELECT withOVER(...)parses asSelectStmtinstead ofUnparsedStmtexport_sql_type=ddlmisclassification blocking workflow submitRelated
Test plan
go test -mod=vendor -count=1 -vet=off -run 'TestInspect_assertSQLType|TestInspect_Parse|TestRuleSQLE00082|TestParseWindowFunctionSelect' ./sqle/driver/mysql/... ./sqle/driver/mysql/splitter/...Made with Cursor
Description
启用解析器窗口函数支持
更新 MySQL 相关测试用例
调整 parser 初始化调用 EnableWindowFunc(true)
增加窗口函数解析单元测试验证
Diagram Walkthrough
File Walkthrough
mysql_test.go
添加窗口函数解析测试sqle/driver/mysql/mysql_test.go
rule_00082_test.go
更新窗口函数规则测试sqle/driver/mysql/rule_00082_test.go
splitter.go
修改窗口函数支持的解析器配置sqle/driver/mysql/splitter/splitter.go
splitter_test.go
添加窗口函数解析单元测试sqle/driver/mysql/splitter/splitter_test.go