From 986c22eab153e15f3d96ffc1909fbe969a24f2e8 Mon Sep 17 00:00:00 2001 From: stremovsky Date: Thu, 12 Dec 2019 19:37:56 +0200 Subject: [PATCH] fix limit in query --- src/qldb.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/qldb.go b/src/qldb.go index a647ec6..19b9f09 100644 --- a/src/qldb.go +++ b/src/qldb.go @@ -515,7 +515,10 @@ func (dbobj dbcon) getList(t Tbl, keyName string, keyValue string, start int32, } q := "select * from " + table + " WHERE " + keyName + "=\"" + keyValue + "\"" - if limit > 0 { + if start > 0 { + q = q + " LIMIT " + strconv.FormatInt(int64(start), 10) + "," + + strconv.FormatInt(int64(limit), 10) + } else if limit > 0 { q = q + " LIMIT " + strconv.FormatInt(int64(limit), 10) } fmt.Printf("q: %s\n", q)