On 23/08/13 17:08, Howard Chu wrote:
Mark Zealey wrote:I've found another weird - I have now converted the database to use duplicates. Typically when I do mdb_cursor_get(... MDB_NEXT ) it willset the key and value but I've found 1 place so far where I do it and onthe duplicate's second entry the value is set but the key is empty.I don't see how this can happen; the only time we don't return the key is if some operation actually failed. Can you send test code to reproduce this?Attached .c shows it - create 3 keys with 5 entries under each. Actually my report was incorrect - cursor_get() with MDB_NEXT or MDB_NEXT_DUP never seems to set the key unless it is the first entry read... Perhaps this is intended?!Yes and no. It was intended for NEXT_DUP because, since it's a duplicate, you already know what the key is. It is unintended for NEXT, for the opposite reason, and in this case it's a bug.
It would be nice to have it for NEXT_DUP as well to be honest - I have a function that gets called for each record and it would be good not have to save state between calls.
Mark