提交 5b03689e 编写于 作者: martianzhang's avatar martianzhang

fix #232 & #230

上级 c5170f0e
...@@ -297,8 +297,11 @@ func FindEQColsInWhere(node sqlparser.SQLNode) []*common.Column { ...@@ -297,8 +297,11 @@ func FindEQColsInWhere(node sqlparser.SQLNode) []*common.Column {
} }
default: default:
if _, ok := eqOperators[node.Operator]; ok { switch node.Left.(type) {
newCols = FindColumn(node) case *sqlparser.ColName:
if _, ok := eqOperators[node.Operator]; ok {
newCols = FindColumn(node)
}
} }
} }
......
...@@ -85,7 +85,10 @@ func TestGetParseTableWithStmt(t *testing.T) { ...@@ -85,7 +85,10 @@ func TestGetParseTableWithStmt(t *testing.T) {
func TestFindCondition(t *testing.T) { func TestFindCondition(t *testing.T) {
common.Log.Debug("Entering function: %s", common.GetFunctionName()) common.Log.Debug("Entering function: %s", common.GetFunctionName())
for _, sql := range common.TestSQLs { sqls := []string{
`SELECT * FROM film WHERE length % 20 = 4;`,
}
for _, sql := range append(sqls, common.TestSQLs...) {
fmt.Println(sql) fmt.Println(sql)
stmt, err := sqlparser.Parse(sql) stmt, err := sqlparser.Parse(sql)
// pretty.Println(stmt) // pretty.Println(stmt)
......
...@@ -14,7 +14,7 @@ chmod a+x soar ...@@ -14,7 +14,7 @@ chmod a+x soar
一般依赖 一般依赖
* Go 1.10+ * Go 1.12+
* git * git
高级依赖(仅面向开发人员) 高级依赖(仅面向开发人员)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册