[Date Prev][Date Next]
(ITS#7814) mdb cannot retrieve inserted word
Full_Name: Clayton Stangeland
Version: gitorious mdb 2014-02-19 e2bdd44624a525
OS: Fedora 20 64 bit
Submission from: (NULL) (188.8.131.52)
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.
I will send the code to reproduce to your ftp server. 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
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.