[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#8355) [lmdb] Issues with sorted duplicate DBs with cursor delete



hhclaw.eb@gmail.com wrote:
> Full_Name: H Law
> Version: LMDB
> OS: Linux
> URL:
> Submission from: (NULL) (42.2.241.129)
>
>
> It seems that, after using a cursor delete during a cursor traversal on a dup
> sort database, the cursor is in a strange state, when MDB_NEXT / MDB_NEXT_DUP
> ceases to work properly while MDB_PREV /  MDB_PREV_DUP still functions.

Thanks for the report. Fixed now in git.

> In particular, when MDB_NEXT or MDB_NEXT_DUP is called after cursor deletion, if
> next key/value pair exists, the cursor will not advance, and got stuck by
> returning the same record when MDB_NEXT or MDB_NEXT_DUP is called repeatly.  In
> case there is no next record, the program was hang.
>
> The following modified version of mtest3.c shows the issue.  I am testing this
> on the latest commit 20dec1f69bf4860202c764ce92b1fbbe3d11a065 of lmdb on 20 Jan,
> on x86-64 Linux.
> I got a similar behaviour when a slightly earlier version of lmdb was
> cross-compiled with a Java wrapper for use on Android, which is why I am testing
> this.   The issue should therefore not be platform specific.



-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/