lmdb-js icon indicating copy to clipboard operation
lmdb-js copied to clipboard

clearAsync fails when key-encoding = 'binary' and encryption

Open leiffoged opened this issue 1 year ago • 2 comments

clearAsync seems to not work for DBs with key-encoding = 'binary'

Repro: 1/ Create a new DB. Settings: {keyEncoding: 'binary'}

2/ Call clearAsync TypeError: Cannot convert undefined or null to object at Buffer.set () at LMDBStore.writeBufferKey [as writeKey] (/Users/leif/code/node-modules/lmdb/dist/index.cjs:1258:9) at writeInstructions (/Users/leif/code/node-modules/lmdb/dist/index.cjs:284:25) at LMDBStore.clearAsync (/Users/leif/code/node-modules/lmdb/dist/index.cjs:838:11)

Does not fail with keyEncoding = 'ordered-binary'

leiffoged avatar Oct 29 '22 17:10 leiffoged

Fix should be available in v2.6.9.

kriszyp avatar Nov 01 '22 17:11 kriszyp

Woo!! Thank you!

leiffoged avatar Nov 01 '22 20:11 leiffoged