-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
badarg in eleveldb:iterator_move(Ref, prev) after 1.2.2p5 #52
Comments
The following test works with 1.2.2p5, but not with HEAD: -module(ltest).
-export([t/0]).
t() ->
os:cmd("rm -rf ltest"), % NOTE
{ok, Ref} = eleveldb:open("ltest", [{create_if_missing, true}]),
try
eleveldb:put(Ref, <<"a">>, <<"x">>, []),
eleveldb:put(Ref, <<"b">>, <<"y">>, []),
{ok, I} = eleveldb:iterator(Ref, []),
{ok, <<"a">>, <<"x">>} = eleveldb:iterator_move(I, <<>>),
{ok, <<"b">>, <<"y">>} = eleveldb:iterator_move(I, next),
{ok, <<"a">>, <<"x">>} = eleveldb:iterator_move(I, prev)
after
eleveldb:close(Ref)
end. With current HEAD:
Using
As reference, this is how it looks with 1.2.2p5:
I'm running on a Mac, OSX 10.7.5, with OTP R15B02. |
Prev() was intentionally left broken. The theory was that no one was using it and it would be one less thing to test. Do you actually use Prev(), or just have a test for it? |
Prev is crucial for us, so we must stay with 1.2.2p5 until it's fixed. |
Ok. Once you have a position via Seek or SeekLast, do you typically call Prev() once or many times? Your answer will influence the nature of the Prev support. |
Calling it once is the more common scenario, but there are use cases where prev is called repeatedly. |
What is the status of this ticket? I just tried a recent version of eleveldb, and the badarg remains. The use case I'm looking at currently iterates a user-specified number of times using prev. |
Our unannounced decision was to address this after the 1.4 release. That release is not yet complete. So much code, so little time. |
But it can wait until after 1.4 On May 10, 2013, at 6:29 AM, Matthew Von-Maszewski notifications@github.com wrote:
|
8 months later ... try branch mv-iterator-prev ... unit testing passes, will start bulk testing next. |
bulk testing seems fine too. submitting a PR for the branch. |
@uwiger do you mind if I include your code from above as an eunit test? |
Not at all - thanks for asking. :) |
I have yet to run this to ground, but using versions after 1.2.2p5, our test suites fail with a badarg when calling eleveldb:iterator_move(Ref, prev). Reverting back to 1.2.2p5 fixes the problem.
The text was updated successfully, but these errors were encountered: