not the next index. Test case is inserting two identical keys
into the database at the beginning of a page (before anything else).
SCCS-vsn: lib/libc/db/btree/bt_put.c 5.6
*/
#if defined(LIBC_SCCS) && !defined(lint)
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)bt_put.c 5.5 (Berkeley) %G%";
+static char sccsid[] = "@(#)bt_put.c 5.6 (Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
goto miss;
if ((cmp = __bt_cmp(t, key, &e)) < 0)
goto miss;
goto miss;
if ((cmp = __bt_cmp(t, key, &e)) < 0)
goto miss;
- t->bt_last.index = ++e.index;
+ t->bt_last.index = cmp ? ++e.index : e.index;
} else {
if (e.page->prevpg != P_INVALID)
goto miss;
} else {
if (e.page->prevpg != P_INVALID)
goto miss;