diff --git a/orm/orm_queryset.go b/orm/orm_queryset.go index 9c2e68aa..87229cfb 100644 --- a/orm/orm_queryset.go +++ b/orm/orm_queryset.go @@ -192,7 +192,9 @@ func (o *querySet) All(container interface{}, cols ...string) (int64, error) { // query one row data and map to containers. // cols means the columns when querying. func (o *querySet) One(container interface{}, cols ...string) error { - o.limit = 1 + if o.limit != 1 { + o.limit = 2 + } num, err := o.orm.alias.DbBaser.ReadBatch(o.orm.db, o, o.mi, o.cond, container, o.orm.alias.TZ, cols) if err != nil { return err