tecbot / gorocksdb

gorocksdb is a Go wrapper for RocksDB
http://rocksdb.org
MIT License
940 stars 269 forks source link

GetApproximateSizes is not work #148

Closed widaT closed 5 years ago

widaT commented 6 years ago

testing code as this

`func TestDBGetApproximateSizes(t *testing.T) { db := newTestDB(t, "TestDBMultiGet", nil) defer db.Close()

var (
    givenKey1 = []byte("hello1")
    givenKey2 = []byte("hello2")
    givenKey3 = []byte("hello3")
    givenVal1 = []byte("world1")
    givenVal2 = []byte("world2")
    givenVal3 = []byte("world3")
    wo        = NewDefaultWriteOptions()
)

// create
ensure.Nil(t, db.Put(wo, givenKey1, givenVal1))
ensure.Nil(t, db.Put(wo, givenKey2, givenVal2))
ensure.Nil(t, db.Put(wo, givenKey3, givenVal3))

ret := db.GetApproximateSizes([]Range{Range{[]byte("hello"),[]byte("hello3")}})
ensure.DeepEqual(t,len(ret),1)

}`

result is

=== RUN TestDB_GetApproximateSizes --- FAIL: TestDB_GetApproximateSizes (0.24s) panic: runtime error: cgo argument has Go pointer to Go pointer [recovered] panic: runtime error: cgo argument has Go pointer to Go pointer