DB 1.86 Patches 1. Problem: DB 1.86 compiles on IRIX, but fails to pass the tests. A UNIX mailbox with the patches to make DB version 1.86 run on current IRIX systems. [INLINE] 2. Problem: DB 1.86 compiles on Linux but fails to load, displaying an error message that there's no lorder command. Apply the following patch to the Linux Makefile. [INLINE] *** Makefile.orig Wed Jul 13 21:43:16 1994 --- Makefile Wed Dec 31 19:00:00 1969 *************** *** 15,22 **** ${LIBDB}: ${OBJ1} ${OBJ2} ${OBJ3} ${OBJ4} ${OBJ5} ${MISC} rm -f $@ ! ar cq $@ \ ! `lorder ${OBJ1} ${OBJ2} ${OBJ3} ${OBJ4} ${OBJ5} ${MISC} | tsort` ranlib $@ clean: --- 15,21 ---- ${LIBDB}: ${OBJ1} ${OBJ2} ${OBJ3} ${OBJ4} ${OBJ5} ${MISC} rm -f $@ ! ar cq $@ ${OBJ1} ${OBJ2} ${OBJ3} ${OBJ4} ${OBJ5} ${MISC} ranlib $@ clean: 3. Problem: DB 1.86 core dumps on certain data sets when using the B+tree access method. Apply the following patch to the db-1.86/btree/bt_split.c file. [INLINE] *** btree/bt_split.c.orig Sat Feb 8 10:14:10 1997 --- btree/bt_split.c Sat Feb 8 10:14:51 1997 *************** *** 673,679 **** * where we decide to try and copy too much onto the left page. * Make sure that doesn't happen. */ ! if (skip <= off && used + nbytes >= full || nxt == top - 1) { --off; break; } --- 673,680 ---- * where we decide to try and copy too much onto the left page. * Make sure that doesn't happen. */ ! if (skip <= off && ! used + nbytes + sizeof(indx_t) >= full || nxt == top - 1) { --off; break; } *************** *** 686,692 **** memmove((char *)l + l->upper, src, nbytes); } ! used += nbytes; if (used >= half) { if (!isbigkey || bigkeycnt == 3) break; --- 687,693 ---- memmove((char *)l + l->upper, src, nbytes); } ! used += nbytes + sizeof(indx_t); if (used >= half) { if (!isbigkey || bigkeycnt == 3) break; 4. Problem: The metadata page for DB 1.86 B+tree databases is not correctly maintained in some circumstances. Apply the following patch to the db-1.86/btree/bt_page.c file. [INLINE] *** btree/bt_page.c.orig Wed Jul 13 21:29:02 1994 --- btree/bt_page.c Wed Jun 11 20:14:43 1997 *************** *** 65,70 **** --- 65,71 ---- h->prevpg = P_INVALID; h->nextpg = t->bt_free; t->bt_free = h->pgno; + F_SET(t, B_METADIRTY); /* Make sure the page gets written back. */ return (mpool_put(t->bt_mp, h, MPOOL_DIRTY)); *************** *** 92,97 **** --- 93,99 ---- (h = mpool_get(t->bt_mp, t->bt_free, 0)) != NULL) { *npg = t->bt_free; t->bt_free = h->nextpg; + F_SET(t, B_METADIRTY); return (h); } return (mpool_new(t->bt_mp, npg));