From 553078d956aa97bd5e4c40303e93bba9a5624ffa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?maxin=5B=E9=A9=AC=E9=91=AB=5D?= Date: Mon, 11 Apr 2016 09:02:22 +0530 Subject: [PATCH] change limit 1000 to 1,reduce the amount the data --- orm/orm_queryset.go | 1 + 1 file changed, 1 insertion(+) diff --git a/orm/orm_queryset.go b/orm/orm_queryset.go index 802a1fe0..9c2e68aa 100644 --- a/orm/orm_queryset.go +++ b/orm/orm_queryset.go @@ -192,6 +192,7 @@ 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 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