]> git.sur5r.net Git - openldap/commitdiff
ITS#7718 invalidate cursor when DB gets emptied
authorHoward Chu <hyc@symas.com>
Tue, 8 Oct 2013 11:43:58 +0000 (04:43 -0700)
committerHoward Chu <hyc@symas.com>
Tue, 8 Oct 2013 11:43:58 +0000 (04:43 -0700)
libraries/liblmdb/mdb.c

index ddde69d0b01745020ea5b610cc51510c31e7352c..e935dc633aa8d0917855ef94935c7c9d1f78e8db 100644 (file)
@@ -7119,6 +7119,7 @@ mdb_rebalance(MDB_cursor *mc)
                        /* Adjust cursors pointing to mp */
                        mc->mc_snum = 0;
                        mc->mc_top = 0;
+                       mc->mc_flags &= ~C_INITIALIZED;
                        {
                                MDB_cursor *m2, *m3;
                                MDB_dbi dbi = mc->mc_dbi;
@@ -7132,6 +7133,7 @@ mdb_rebalance(MDB_cursor *mc)
                                        if (m3->mc_pg[0] == mp) {
                                                m3->mc_snum = 0;
                                                m3->mc_top = 0;
+                                               m3->mc_flags &= ~C_INITIALIZED;
                                        }
                                }
                        }