Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ai-demo分支中MySQL规则遗留问题 #2748

Open
9 tasks
waterdrink opened this issue Nov 12, 2024 · 0 comments
Open
9 tasks

ai-demo分支中MySQL规则遗留问题 #2748

waterdrink opened this issue Nov 12, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@waterdrink
Copy link
Collaborator

http://10.186.18.11/confluence/pages/viewpage.action?pageId=175178272 迁移到本issue维护

  • 目前 with... 这种 cte语法 tidb解析器不支持,需要处理。 凡是针对所有dml的含有select的系列规则,都需要追加 with .... cte语法
  • 规则00140:还需要处理存储过程、触发器、函数、事件等解析器不支持解析的情况
  • 规则00176:存在以下:delete/update/insert /*+ index(xx,xx) */...delete/update/insert /*+ set_var(xx) */... 场景,无法辨别含有hint
  • 确认osc与规则需求是否有关联
  • 代码中的EXPLAIN结果需要缓存
  • 00039 少了union 场景
  • 00218 需要考虑多个join的情况 参考00112规则,可以使用GetAllJoinsFromNode方法
  • 00104 需要从 util.GetCreateTableStmt中Constraint里 获取索引信息(Index和对应的列以及排序方向);然后与order by 列&排序方向匹配是否一致,不一致则违规;但是由于解析器中无法获取索引中列的排序方向,导致无法比对
    image
    解析器中,Constraints 里没有存储排序方向的字段;
    尝试使用pattern方式,但 Constraints中一些node的text也都是为"",无法获取类似‘name ASC, age DESC’内容;
    实现困难,另外后续实现的话,可能需要加一段 “从元数据表中获取索引的排序方向”的逻辑。
  • 辅助函数:GetFuncExpr 无法获取聚合函数的expr表达,影响到使用该方法的规则
    image
@waterdrink waterdrink added the bug Something isn't working label Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants