Update session.go
fix stmt query of 'Get function' bug when an error occurred
This commit is contained in:
parent
6e37d48701
commit
d22a247759
|
@ -983,6 +983,9 @@ func (session *Session) Get(bean interface{}) (bool, error) {
|
|||
}
|
||||
// defer stmt.Close() // !nashtsai! don't close due to stmt is cached and bounded to this session
|
||||
rawRows, err = stmt.Query(args...)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
} else {
|
||||
rawRows, err = session.Tx.Query(sqlStr, args...)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue