Skip to content

Commit

Permalink
fix XiaoMi#252 change database with backtick
Browse files Browse the repository at this point in the history
  • Loading branch information
martianzhang committed Apr 20, 2020
1 parent d07578e commit 1f50907
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion database/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (db *Connector) Query(sql string, params ...interface{}) (QueryResult, erro
}

common.Log.Debug("Execute SQL with DSN(%s/%s) : %s", db.Addr, db.Database, fmt.Sprintf(sql, params...))
_, err = db.Conn.Exec("USE " + db.Database)
_, err = db.Conn.Exec("USE `" + db.Database + "`")
if err != nil {
common.Log.Error(err.Error())
return res, err
Expand Down

0 comments on commit 1f50907

Please sign in to comment.