Issue 7815 - mdb cannot retrieve inserted word
Summary: mdb cannot retrieve inserted word
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-05 23:01 UTC by clayton.stangeland@gmail.com
Modified: 2014-12-11 01:07 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Howard Chu 2014-03-05 20:30:10 UTC
changed notes
changed state Open to Test
moved from Incoming to Software Bugs
Comment 1 clayton.stangeland@gmail.com 2014-03-05 23:01:23 UTC
Full_Name: Clayton Stangeland
Version: gitorious mdb 2014-02-19 e2bdd44624a525
OS: Fedora 20 64 bit
URL: http://www.strerror.com/mdb_bug_report/
Submission from: (NULL) (192.94.73.31)


DUPLICATE bug report. New URL: for data file
http://www.strerror.com/mdb_bug_report/.
You can use the 3 non tgz files or download the tgz file which includes all of
them.

I have a text file of words (words.txt). Each is 511 or less characters. When
inserting them into the database there comes a point when I can no longer
retrieve words that were successfully added with mdb_cursor_put.

It should be put in the libraries/liblmdb directory. The Makefile has an added
command at the end. So put that, words.txt, and word_test.c in liblmdb directory
and run 'make words'.

It will build and run a failing test. First it reads each line of words.txt.
Then it inserts them with their index as the value into mdb. If you change count
= 29523 on line 145 to be count = 29522 then it works. Inserting the next word
causes it to fail. 

It doesn't fail at the insert but it fails later. When iterating the cursor the
words are not in order and looking up individually not all words can be
retrieved.

Also, changing line 151 to set val.mv_data, and val.mv_size to a string version
of i (the index, using sprintf), it works.

This fails the same way on 64 bit Fedora and 64 bit Windows 7.
Comment 2 Howard Chu 2014-03-06 04:25:37 UTC
clayton.stangeland@gmail.com wrote:
> Full_Name: Clayton Stangeland
> Version: gitorious mdb 2014-02-19 e2bdd44624a525
> OS: Fedora 20 64 bit
> URL: http://www.strerror.com/mdb_bug_report/
> Submission from: (NULL) (192.94.73.31)
>
>
> DUPLICATE bug report. New URL: for data file
> http://www.strerror.com/mdb_bug_report/.
> You can use the 3 non tgz files or download the tgz file which includes all of
> them.

Thanks for the report. This is now fixed in mdb.master.

> I have a text file of words (words.txt). Each is 511 or less characters. When
> inserting them into the database there comes a point when I can no longer
> retrieve words that were successfully added with mdb_cursor_put.
>
> It should be put in the libraries/liblmdb directory. The Makefile has an added
> command at the end. So put that, words.txt, and word_test.c in liblmdb directory
> and run 'make words'.
>
> It will build and run a failing test. First it reads each line of words.txt.
> Then it inserts them with their index as the value into mdb. If you change count
> = 29523 on line 145 to be count = 29522 then it works. Inserting the next word
> causes it to fail.
>
> It doesn't fail at the insert but it fails later. When iterating the cursor the
> words are not in order and looking up individually not all words can be
> retrieved.
>
> Also, changing line 151 to set val.mv_data, and val.mv_size to a string version
> of i (the index, using sprintf), it works.
>
> This fails the same way on 64 bit Fedora and 64 bit Windows 7.
>
>


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

Comment 3 OpenLDAP project 2014-08-01 21:04:50 UTC
fixed in mdb.master
Comment 4 Quanah Gibson-Mount 2014-12-11 01:07:09 UTC
changed state Test to Closed