Merge branch 'master' into fix/exec_for_update_on_master

This commit is contained in:
RenKanai 2021-10-29 17:16:04 +09:00
commit 3996bd66ed
1 changed files with 1 additions and 1 deletions

View File

@ -33,7 +33,7 @@ func (session *Session) queryRows(sqlStr string, args ...interface{}) (*core.Row
if session.isAutoCommit {
var db *core.DB
if session.sessionType == groupSession && strings.EqualFold(sqlStr[:6], "select") && !session.statement.IsForUpdate {
if session.sessionType == groupSession && strings.EqualFold(strings.TrimSpace(sqlStr)[:6], "select") && !session.statement.IsForUpdate {
db = session.engine.engineGroup.Slave().DB()
} else {
db = session.DB()