From a57c2733fa21dd819d1be68be6e8ed8b0d874561 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Thu, 17 Nov 2016 14:18:11 +0000 Subject: [PATCH] Use uint64 as limit in mysql backend connector --- kvs/mysql/tx.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kvs/mysql/tx.go b/kvs/mysql/tx.go index d3583add..31fffc56 100644 --- a/kvs/mysql/tx.go +++ b/kvs/mysql/tx.go @@ -144,7 +144,7 @@ func (tx *TX) RGet(beg, end []byte, max uint64) (kvs []kvs.KV, err error) { max = math.MaxUint64 } - res, err := tx.tx.Query("SELECT `key`, `val` FROM kv WHERE `key` BETWEEN ? AND ? ORDER BY `key` ASC LIMIT ?", beg, end, int(max)) + res, err := tx.tx.Query("SELECT `key`, `val` FROM kv WHERE `key` BETWEEN ? AND ? ORDER BY `key` ASC LIMIT ?", beg, end, max) if err != nil { return nil, err } @@ -301,7 +301,7 @@ func (tx *TX) RDel(beg, end []byte, max uint64) (err error) { max = math.MaxUint64 } - if _, err = tx.tx.Exec("DELETE FROM kv WHERE `key` BETWEEN ? AND ? ORDER BY `key` ASC LIMIT ?", beg, end, int(max)); err != nil { + if _, err = tx.tx.Exec("DELETE FROM kv WHERE `key` BETWEEN ? AND ? ORDER BY `key` ASC LIMIT ?", beg, end, max); err != nil { err = &kvs.DBError{err} return }