PatternInExprDecorator decorate PatternInExpr 这里记录tableIndexes和indexValueMap是没有问题的, 因为如果是OR条件, 导致路由索引[]int变宽, 改写的SQL只是IN这一项没有值, 并不会影响SQL正确性和执行结果.
| 34 | // 这里记录tableIndexes和indexValueMap是没有问题的, 因为如果是OR条件, 导致路由索引[]int变宽, |
| 35 | // 改写的SQL只是IN这一项没有值, 并不会影响SQL正确性和执行结果. |
| 36 | type 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 |
| 49 | func NeedCreatePatternInExprDecorator(p *TableAliasStmtInfo, n *ast.PatternInExpr) (router.Rule, bool, bool, error) { |
nothing calls this directly
no outgoing calls
no test coverage detected