fix(mysql): enable window function parsing in ParseOneSql - #3369
Merged
Merged
Conversation
Align SQL analysis entry with audit splitter by enabling EnableWindowFunc(true) in ParseOneSql, fixing parser failures for ROW_NUMBER() OVER (PARTITION BY ...) SQL. Add TestParseOneSqlWindowFunc to verify AST contains WindowFuncExpr. Fixes actiontech/sqle-ee#3110 Co-authored-by: Cursor <cursoragent@cursor.com>
PR Reviewer Guide 🔍
|
PR Code Suggestions ✨No code suggestions found for the PR. |
iwanghc
approved these changes
Aug 26, 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
Related issue
https://github.com/actiontech/sqle-ee/issues/3110
Changes
EnableWindowFunc(true)inParseOneSqlto align SQL analysis entry with audit splitterTestParseOneSqlWindowFuncto verify window function AST parsingBackground
SQL analysis page fails to parse MySQL 8 window functions (
ROW_NUMBER() OVER (PARTITION BY ...)) with parser errornear "( PARTITION BY". The audit path already enables window function parsing viasplitter.NewSplitter(), butParseOneSqldid not.Made with Cursor
Description
在 ParseOneSql 中启用窗口函数解析
新增测试验证 AST 包含 WindowFuncExpr
修复 MySQL 8 窗口函数解析错误
Diagram Walkthrough
File Walkthrough
parser_helper.go
启用窗口函数解析支持sqle/driver/mysql/util/parser_helper.go
parser_helper_test.go
添加窗口函数解析测试sqle/driver/mysql/util/parser_helper_test.go