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

fix #232 & #230

上级 c5170f0e
......@@ -297,8 +297,11 @@ func FindEQColsInWhere(node sqlparser.SQLNode) []*common.Column {
}
default:
if _, ok := eqOperators[node.Operator]; ok {
newCols = FindColumn(node)
switch node.Left.(type) {
case *sqlparser.ColName:
if _, ok := eqOperators[node.Operator]; ok {
newCols = FindColumn(node)
}
}
}
......
......@@ -85,7 +85,10 @@ func TestGetParseTableWithStmt(t *testing.T) {
func TestFindCondition(t *testing.T) {
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)
stmt, err := sqlparser.Parse(sql)
// pretty.Println(stmt)
......
......@@ -14,7 +14,7 @@ chmod a+x soar
一般依赖
* Go 1.10+
* Go 1.12+
* git
高级依赖(仅面向开发人员)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册