fix(crud): 修复QueryAnalyzerImpl中SQL解析逻辑问题并优化查询语法处理#351
Draft
zhou-hao wants to merge 1 commit into
Draft
Conversation
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.
目的
QueryAnalyzerImpl在 SQL 解析链路中的兼容性问题。WITH、VALUES等场景下的回归风险。核心变动
hsweb-commons-crud:升级jsqlparser到5.3,并通过maven-shade-plugin将net.sf.jsqlparserrelocate 到org.hswebframework.web.crud.shaded.jsqlparser,降低依赖冲突风险。QueryAnalyzerImpl:适配 JSqlParser 5.x 的泛型 Visitor API,补齐ParenthesedSelect、ParenthesedFromItem、LateralSubSelect、FromQuery、Values、TableFunction等结构的处理。QueryAnalyzerImpl:增加<=>操作符占位解析与回填逻辑,避免解析阶段因 JSqlParser 不支持该操作符而直接失败。测试结果
mvn -pl hsweb-commons/hsweb-commons-crud -am -Dtest=DefaultQueryHelperTest,QueryAnalyzerImplTest -Dsurefire.failIfNoSpecifiedTests=false test jacoco:reportDefaultQueryHelperTest: 10 passedQueryAnalyzerImplTest: 54 passedhsweb-commons-crud模块):line 52.72% (2133/4046), branch 48.31% (686/1420)QueryAnalyzerImplline 77.78% (287/369), branch 68.95% (131/190)风险与说明
5.0.x仍落后 3 个提交,后续继续开发前会再同步主线。hsweb-commons-crud相关测试,尚未覆盖外部项目对 shadedjsqlparser依赖的联调场景。readOnly级别 warning,但本次用例全部通过,未阻塞本 PR。