Skip to content

Commit

Permalink
tidb: Address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
shenli committed Oct 13, 2015
1 parent abe94aa commit 522aa0c
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions tidb.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,7 @@ func trimSQL(sql string) string {
break
}
// Trim leading '('. For `(select 1);` is also a query.
for {
s := strings.TrimPrefix(sql, "(")
if len(s) == len(sql) {
break
}
sql = s
}
return sql
return strings.TrimLeft(sql, "( ")
}

// IsQuery checks if a sql statement is a query statement.
Expand Down

1 comment on commit 522aa0c

@qiuyesuifeng
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Please sign in to comment.