]> git.sur5r.net Git - openldap/commitdiff
ITS#7589 another mdb_page_split fix
authorHoward Chu <hyc@openldap.org>
Fri, 1 Nov 2013 00:31:15 +0000 (17:31 -0700)
committerHoward Chu <hyc@openldap.org>
Fri, 1 Nov 2013 00:31:15 +0000 (17:31 -0700)
Tweak split_indx check, go one slot further.

libraries/liblmdb/mdb.c

index 9ade333ed951e459ce623b1c1ca0b29169494cf9..b419fd6cdaec7f75b699aea5497217a2c1eca557 100644 (file)
@@ -7542,7 +7542,7 @@ mdb_page_split(MDB_cursor *mc, MDB_val *newkey, MDB_val *newdata, pgno_t newpgno
                                psize = 0;
                                if (newindx <= split_indx || newindx >= nkeys) {
                                        i = 0; j = 1;
-                                       k = newindx >= nkeys ? nkeys : split_indx+1;
+                                       k = newindx >= nkeys ? nkeys : split_indx+2;
                                } else {
                                        i = nkeys; j = -1;
                                        k = split_indx-1;