1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-22 23:50:49 +00:00

Merge pull request #1384 from pjoe/update_err_fix

Fix dbBase.Update not returning error on failure
This commit is contained in:
astaxie 2015-10-12 20:43:22 +08:00
commit 332fa44231

View File

@ -488,7 +488,8 @@ func (d *dbBase) Update(q dbQuerier, mi *modelInfo, ind reflect.Value, tz *time.
d.ins.ReplaceMarks(&query)
if res, err := q.Exec(query, setValues...); err == nil {
res, err := q.Exec(query, setValues...)
if err == nil {
return res.RowsAffected()
}
return 0, err