Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
martianzhang committed Oct 17, 2019
1 parent c5170f0 commit 5b03689
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions ast/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}

Expand Down
5 changes: 4 additions & 1 deletion ast/meta_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion doc/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ chmod a+x soar

一般依赖

* Go 1.10+
* Go 1.12+
* git

高级依赖(仅面向开发人员)
Expand Down

0 comments on commit 5b03689

Please sign in to comment.