fix: support MySQL CTE audit via conservative splitter fallback - #3355
Open
LordofAvernus wants to merge 2 commits into
Open
fix: support MySQL CTE audit via conservative splitter fallback#3355LordofAvernus wants to merge 2 commits into
LordofAvernus wants to merge 2 commits into
Conversation
Parse outer statement after WITH … AS (…) when pingcap fails, so CTE is auditable and sql_type is dql/dml instead of Unparsed→ddl. Co-authored-by: Cursor <cursoragent@cursor.com>
PR Reviewer Guide 🔍(Review updated until commit e515af9)
|
PR Code Suggestions ✨No code suggestions found for the PR. |
Cover splitter CTE outer extraction/parse and assertSQLType dql/dml classification for CTE cases.
|
Persistent review updated to latest commit e515af9 |
6 tasks
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
关联的 issue
https://github.com/actiontech/sqle-ee/issues/3050
描述你的变更
WITH [RECURSIVE] name AS (...)形态保守剥离 CTE 前缀并解析外层语句,保留原文 Textsql_type按外层语义为 dql/dml,不再因 Unparsed 默认 ddl确认项(pr提交后操作)
Tip
请在指定复审人之前,确认并完成以下事项,完成后✅
not_compatibleneed_update_docMade with Cursor
Description
增加 MySQL CTE 保守解析处理
添加多种 CTE 测试用例验证解析结果
修改 splitter 调用逻辑支持 CTE 解析
Diagram Walkthrough
File Walkthrough
mysql_test.go
增加 CTE 测试验证sqle/driver/mysql/mysql_test.go
cte_test.go
增加 CTE 解析单元测试sqle/driver/mysql/splitter/cte_test.go
cte.go
新增 CTE 解析模块sqle/driver/mysql/splitter/cte.go
splitter.go
集成 CTE 保守解析逻辑sqle/driver/mysql/splitter/splitter.go