Skip to content

Commit

Permalink
Update session.go
Browse files Browse the repository at this point in the history
事务中使用 s.tx
  • Loading branch information
fizzday authored Jun 2, 2020
1 parent ad00c7a commit b0213cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion session.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func (s *Session) Query(sqlstring string, args ...interface{}) (result []Data, e
if s.tx == nil {
stmt, err = s.slave.Prepare(sqlstring)
} else {
stmt, err = s.master.Prepare(sqlstring)
stmt, err = s.tx.Prepare(sqlstring)
}

if err != nil {
Expand Down

0 comments on commit b0213cf

Please sign in to comment.