Use uint64 as limit in mysql backend connector
This commit is contained in:
parent
efa641e175
commit
a57c2733fa
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue