提交 1fece192 编写于 作者: martianzhang's avatar martianzhang

fix #58

  we change mymysql to go-sql-driver and use insert unhex()
  for any dangerous data type.
上级 a583e9d8
......@@ -106,7 +106,7 @@ func main() {
mysqlSuggest := make(map[string]advisor.Rule) // MySQL 返回的 ERROR 信息
if buf == "" {
common.Log.Debug("buf: %s, sql: %s empty", buf, sql)
common.Log.Debug("Ending, buf: '%s', sql: '%s'", buf, sql)
break
}
// 查询请求切分
......
......@@ -235,7 +235,7 @@ func (db *Connector) ColumnCardinality(tb, col string) float64 {
// IsView 判断表是否是视图
func (db *Connector) IsView(tbName string) bool {
common.Log.Debug("IsView, ShowTableStatus check `%s` is view", tbName)
common.Log.Debug("IsView, ShowTableStatus check if `%s` is view", tbName)
tbStatus, err := db.ShowTableStatus(tbName)
if err != nil {
common.Log.Error("(db *Connector) IsView Error: %v:", err)
......
......@@ -154,6 +154,12 @@ func (db *Connector) startSampling(onlineConn *sql.DB, database, table string, w
valuesCount = 0
}
}
if len(valuesStr) > 0 {
err = db.doSampling(table, columnsStr, strings.Join(valuesStr, `,`))
if err != nil {
common.LogIfWarn(err, "")
}
}
res.Close()
return err
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册