MCPcopy
hub / github.com/XiaoMi/Gaea / PatternInExprDecorator

Struct PatternInExprDecorator

proxy/plan/decorator_pattern_in_expr.go:36–46  ·  view source on GitHub ↗

PatternInExprDecorator decorate PatternInExpr 这里记录tableIndexes和indexValueMap是没有问题的, 因为如果是OR条件, 导致路由索引[]int变宽, 改写的SQL只是IN这一项没有值, 并不会影响SQL正确性和执行结果.

Source from the content-addressed store, hash-verified

34// 这里记录tableIndexes和indexValueMap是没有问题的, 因为如果是OR条件, 导致路由索引[]int变宽,
35// 改写的SQL只是IN这一项没有值, 并不会影响SQL正确性和执行结果.
36type PatternInExprDecorator struct {
37 Expr ast.ExprNode
38 List []ast.ExprNode
39 Not bool
40
41 tableIndexes []int
42 indexValueMap map[int][]ast.ExprNode // tableIndex - valueList
43
44 rule router.Rule
45 result *RouteResult
46}
47
48// NeedCreatePatternInExprDecorator check if PatternInExpr needs decoration
49func NeedCreatePatternInExprDecorator(p *TableAliasStmtInfo, n *ast.PatternInExpr) (router.Rule, bool, bool, error) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected