]> git.sur5r.net Git - openldap/commitdiff
bugfix for mdb_cursor_put with MDB_MULTIPLE
authorClaude Brisson <claude.brisson@gmail.com>
Fri, 22 Mar 2013 15:00:21 +0000 (16:00 +0100)
committerHoward Chu <hyc@symas.com>
Sat, 23 Mar 2013 21:03:12 +0000 (14:03 -0700)
If the variable dkey.mv_size is non-zero, then it means dkey
contains some original data which has to be put back in the
child db, typically when the child db has just been created.

But when using MDB_MULTIPLE, if this variable has not been
reset to zero, we may come back to this section and wrongly
think that there is some original data to be taken care of.

libraries/liblmdb/mdb.c

index cf306fcb77ae724884205d2fdc0b77a4ff25b920..3329565893e011d09730920621fe69b3da8dc064 100644 (file)
@@ -5218,6 +5218,8 @@ put_sub:
                                                }
                                        }
                                }
+                                /* we've done our job */
+                                dkey.mv_size = 0;
                        }
                        if (flags & MDB_APPENDDUP)
                                xflags |= MDB_APPEND;