1
0
mirror of https://github.com/astaxie/beego.git synced 2024-06-18 11:54:13 +00:00

Revert "send ErrNoRows if the query returns zero rows ... in method orm_query…"

This commit is contained in:
Hu Risheng 2018-08-03 13:35:48 +08:00 committed by GitHub
parent 9dd7d19ce7
commit 1bd3fb7a33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -198,11 +198,7 @@ func (o *querySet) PrepareInsert() (Inserter, error) {
// query all data and map to containers.
// cols means the columns when querying.
func (o *querySet) All(container interface{}, cols ...string) (int64, error) {
num, err := o.orm.alias.DbBaser.ReadBatch(o.orm.db, o, o.mi, o.cond, container, o.orm.alias.TZ, cols)
if num == 0 {
return 0, ErrNoRows
}
return num, err
return o.orm.alias.DbBaser.ReadBatch(o.orm.db, o, o.mi, o.cond, container, o.orm.alias.TZ, cols)
}
// query one row data and map to containers.