add constant kv.Unlim=-1 (#955)

This commit is contained in:
Alex Sharov 2023-03-26 10:18:07 +07:00 committed by GitHub
parent a4034d5cea
commit 0b9404adb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -61,6 +61,9 @@ import (
const ReadersLimit = 32000 // MDBX_READERS_LIMIT=32767 const ReadersLimit = 32000 // MDBX_READERS_LIMIT=32767
// const Unbounded []byte = nil
const Unlim int = -1
var ( var (
ErrAttemptToDeleteNonDeprecatedBucket = errors.New("only buckets from dbutils.ChaindataDeprecatedTables can be deleted") ErrAttemptToDeleteNonDeprecatedBucket = errors.New("only buckets from dbutils.ChaindataDeprecatedTables can be deleted")

View File

@ -126,7 +126,7 @@ func TestRange(t *testing.T) {
_, tx, _ := BaseCase(t) _, tx, _ := BaseCase(t)
//[from, to) //[from, to)
it, err := tx.RangeDescend("Table", []byte("key3"), []byte("key1"), -1) it, err := tx.RangeDescend("Table", []byte("key3"), []byte("key1"), kv.Unlim)
require.NoError(t, err) require.NoError(t, err)
require.True(t, it.HasNext()) require.True(t, it.HasNext())
k, v, err := it.Next() k, v, err := it.Next()