wbolster / plyvel

Plyvel, a fast and feature-rich Python interface to LevelDB
https://plyvel.readthedocs.io/
Other
534 stars 75 forks source link

reverse iterators with prefix are badly broken #9

Closed aglyzov closed 11 years ago

aglyzov commented 11 years ago

Here is a simple test to reproduce: https://gist.github.com/aglyzov/5643563

I tested with Python 3.3.1 and Python 3.3.2 on x86-64 and ARM. Plyvel 0.2, latest leveldb + snappy.

wbolster commented 11 years ago

Yuck, this indeed looks like a bug. Thanks for the report.

wbolster commented 11 years ago

Okay, I think I understand why this occurs. A reverse iterator starts at the end, and steps back to nudge it into position. In this test case the stepping back actually steps backwards past the start key, so it ends up in the wrong position.

wbolster commented 11 years ago

Ok, I've just pushed out Plyvel 0.3 with a fix: https://twitter.com/wbolster/status/341664060435218432