RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: db/ README db/btree/ bt_compact.c bt_rec.c bt_split.c db/bu...

From: Jeff Johnson <jbj@rpm5.org>
Date: Sat 21 Aug 2010 - 22:50:32 CEST
Message-Id: <20100821205032.77EE8D2534@rpm5.org>
  RPM Package Manager, CVS Repository
  /cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Jeff Johnson
  Root:   /v/rpm/cvs                       Email:  jbj@rpm5.org
  Module: db                               Date:   21-Aug-2010 22:50:32
  Branch: HEAD                             Handle: 2010082120502210

  Modified files:
    db                      README
    db/btree                bt_compact.c bt_rec.c bt_split.c
    db/build_vxworks        db.h db_config.h db_config_small.h
    db/build_wince          db.h db_config.h
    db/build_windows        db.h db_config.h libdb.rc
    db/csharp/Properties    AssemblyInfo.cs
    db/db                   db_pr.c db_rec.c
    db/dbinc                mp.h
    db/dbinc_auto           ext_def.in ext_prot.in
    db/dbm                  dbm.c
    db/dbreg                dbreg_rec.c dbreg_util.c
    db/dist                 RELEASE configure configure.ac s_crypto s_winmsi
    db/dist/winmsi          s_winmsi.fcn
    db/env                  env_open.c env_recover.c
    db/hash                 hash_dup.c
    db/java/src/com/sleepycat/db
                            DatabaseConfig.java
    db/java/src/com/sleepycat/db/internal
                            DbConstants.java
    db/java/src/com/sleepycat/persist/raw
                            RawType.java
    db/libdb_java           db_java_wrap.c java_callbacks.i
    db/log                  log_put.c
    db/mp                   mp_alloc.c mp_bh.c mp_fget.c mp_fmethod.c
                            mp_fopen.c mp_fput.c mp_fset.c mp_method.c
                            mp_mvcc.c mp_region.c mp_stat.c mp_trickle.c
    db/qam                  qam_verify.c
    db/repmgr               repmgr_net.c repmgr_sel.c
    db/tcl                  tcl_env.c
    db/test                 TESTS
    db/txn                  txn.c

  Log:
    merge conflicts on HEAD after import of Berkeley-DB 5.0.26

  Summary:
    Revision    Changes     Path
    1.20        +1  -1      db/README
    1.9         +28 -20     db/btree/bt_compact.c
    1.11        +17 -16     db/btree/bt_rec.c
    1.11        +18 -7      db/btree/bt_split.c
    1.20        +4  -4      db/build_vxworks/db.h
    1.20        +3  -3      db/build_vxworks/db_config.h
    1.16        +3  -3      db/build_vxworks/db_config_small.h
    1.4         +4  -4      db/build_wince/db.h
    1.4         +3  -3      db/build_wince/db_config.h
    1.9         +4  -4      db/build_windows/db.h
    1.9         +3  -3      db/build_windows/db_config.h
    1.9         +4  -4      db/build_windows/libdb.rc
    1.4         +1  -1      db/csharp/Properties/AssemblyInfo.cs
    1.13        +1  -1      db/db/db_pr.c
    1.15        +6  -4      db/db/db_rec.c
    1.14        +15 -7      db/dbinc/mp.h
    1.7         +1  -1      db/dbinc_auto/ext_def.in
    1.6         +1  -1      db/dbinc_auto/ext_prot.in
    1.12        +1  -1      db/dbm/dbm.c
    1.12        +4  -0      db/dbreg/dbreg_rec.c
    1.12        +18 -17     db/dbreg/dbreg_util.c
    1.18        +1  -1      db/dist/RELEASE
    1.24        +46 -51     db/dist/configure
    1.18        +1  -1      db/dist/configure.ac
    1.9         +14 -0      db/dist/s_crypto
    1.8         +0  -5      db/dist/s_winmsi
    1.7         +30 -22     db/dist/winmsi/s_winmsi.fcn
    1.13        +11 -2      db/env/env_open.c
    1.13        +69 -67     db/env/env_recover.c
    1.13        +1  -0      db/hash/hash_dup.c
    1.12        +2  -1      db/java/src/com/sleepycat/db/DatabaseConfig.java
    1.17        +1  -1      db/java/src/com/sleepycat/db/internal/DbConstants.java
    1.5         +3  -3      db/java/src/com/sleepycat/persist/raw/RawType.java
    1.15        +3  -0      db/libdb_java/db_java_wrap.c
    1.12        +3  -0      db/libdb_java/java_callbacks.i
    1.16        +65 -13     db/log/log_put.c
    1.13        +10 -11     db/mp/mp_alloc.c
    1.16        +9  -11     db/mp/mp_bh.c
    1.13        +13 -13     db/mp/mp_fget.c
    1.10        +5  -6      db/mp/mp_fmethod.c
    1.23        +5  -5      db/mp/mp_fopen.c
    1.13        +4  -4      db/mp/mp_fput.c
    1.13        +1  -1      db/mp/mp_fset.c
    1.12        +19 -9      db/mp/mp_method.c
    1.7         +2  -2      db/mp/mp_mvcc.c
    1.12        +6  -6      db/mp/mp_region.c
    1.13        +14 -26     db/mp/mp_stat.c
    1.12        +1  -1      db/mp/mp_trickle.c
    1.11        +1  -1      db/qam/qam_verify.c
    1.7         +13 -0      db/repmgr/repmgr_net.c
    1.6         +3  -0      db/repmgr/repmgr_sel.c
    1.12        +19 -1      db/tcl/tcl_env.c
    1.13        +4  -4      db/test/TESTS
    1.15        +8  -4      db/txn/txn.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: db/README
  ============================================================================
  $ cvs diff -u -r1.19 -r1.20 README
  --- db/README	1 Apr 2010 16:03:14 -0000	1.19
  +++ db/README	21 Aug 2010 20:50:22 -0000	1.20
  @@ -1,4 +1,4 @@
  -Berkeley DB 11g Release 2, library version 11.2.5.0.21: (March 30, 2010)
  +Berkeley DB 11g Release 2, library version 11.2.5.0.26: (June 25, 2010)
   
   This is Berkeley DB 11g Release 2 from Oracle.  To view release and
   installation documentation, load the distribution file docs/index.html
  @@ .
  patch -p0 <<'@@ .'
  Index: db/btree/bt_compact.c
  ============================================================================
  $ cvs diff -u -r1.8 -r1.9 bt_compact.c
  --- db/btree/bt_compact.c	1 Apr 2010 16:03:15 -0000	1.8
  +++ db/btree/bt_compact.c	21 Aug 2010 20:50:22 -0000	1.9
  @@ -544,12 +544,14 @@
   			}
   			pgs_done++;
   			/* Get a fresh low numbered page. */
  -			if ((ret = __db_exchange_page(dbc, &pg, ncp->csp->page,
  +			if ((ret = __db_exchange_page(dbc,
  +			    &cp->csp->page, ncp->csp->page,
   			    PGNO_INVALID, DB_EXCH_DEFAULT)) != 0)
   				goto err1;
   			if ((ret = __TLPUT(dbc, prev_lock)) != 0)
  -				goto err;
  +				goto err1;
   			LOCK_INIT(prev_lock);
  +			pg = cp->csp->page;
   		}
   		*spanp = 0;
   		PTRACE(dbc, "SDups", PGNO(ncp->csp->page), start, 0);
  @@ -709,7 +711,8 @@
   				}
   				/* Get a fresh low numbered page. */
   				pgno = PGNO(pg);
  -				if ((ret = __db_exchange_page(dbc, &pg, NULL,
  +				if ((ret = __db_exchange_page(dbc,
  +				    &cp->csp->page, NULL,
   				    PGNO_INVALID, DB_EXCH_DEFAULT)) != 0)
   					goto err1;
   				if ((ret = __TLPUT(dbc, prev_lock)) != 0)
  @@ -718,6 +721,7 @@
   				if ((ret = __TLPUT(dbc, next_lock)) != 0)
   					goto err1;
   				LOCK_INIT(next_lock);
  +				pg = cp->csp->page;
   				if (pgno != PGNO(pg)) {
   					pgs_done++;
   					pgno = PGNO(pg);
  @@ -817,12 +821,13 @@
   			}
   			pgno = PGNO(pg);
   			/* Get a fresh low numbered page. */
  -			if ((ret = __db_exchange_page(dbc, &pg,
  +			if ((ret = __db_exchange_page(dbc, &cp->csp->page,
   			    npg, PGNO_INVALID, DB_EXCH_DEFAULT)) != 0)
   				goto err1;
   			if ((ret = __TLPUT(dbc, prev_lock)) != 0)
   				goto err1;
   			LOCK_INIT(prev_lock);
  +			pg = cp->csp->page;
   			if (pgno != PGNO(pg)) {
   				pgs_done++;
   				pgno = PGNO(pg);
  @@ -1087,25 +1092,26 @@
   	cp = (BTREE_CURSOR *)dbc->internal;
   	ncp = (BTREE_CURSOR *)ndbc->internal;
   	pg = cp->csp->page;
  -	npg = ncp->csp->page;
   	memset(&hdr, 0, sizeof(hdr));
   	pind = NUM_ENT(pg);
   	n_ok = 0;
   	adjust = 0;
   	ret = 0;
  -	nent = NUM_ENT(npg);
  -
  -	DB_ASSERT(env, nent != 0);
   
   	/* See if we want to swap out this page. */
   	if (c_data->compact_truncate != PGNO_INVALID &&
  -	     PGNO(npg) > c_data->compact_truncate) {
  +	     PGNO(ncp->csp->page) > c_data->compact_truncate) {
   		/* Get a fresh low numbered page. */
   		if ((ret = __db_exchange_page(ndbc,
  -		    &npg, pg, PGNO_INVALID, DB_EXCH_DEFAULT)) != 0)
  +		   &ncp->csp->page, pg, PGNO_INVALID, DB_EXCH_DEFAULT)) != 0)
   			goto err;
   	}
   
  +	npg = ncp->csp->page;
  +	nent = NUM_ENT(npg);
  +
  +	DB_ASSERT(env, nent != 0);
  +
   	ninp = P_INP(dbp, npg);
   
   	/*
  @@ -1814,14 +1820,15 @@
   		    c_data->compact_truncate != PGNO_INVALID &&
   		    PGNO(npg) > c_data->compact_truncate &&
   		    ncp->csp != ncp->sp) {
  -			if ((ret = __db_exchange_page(ndbc,
  -			    &npg, pg, PGNO_INVALID, DB_EXCH_DEFAULT)) != 0)
  +			if ((ret = __db_exchange_page(ndbc, &ncp->csp->page,
  +			    pg, PGNO_INVALID, DB_EXCH_DEFAULT)) != 0)
   				goto err;
   		}
   		if (c_data->compact_truncate != PGNO_INVALID &&
   		     PGNO(pg) > c_data->compact_truncate && cp->csp != cp->sp) {
  -			if ((ret = __db_exchange_page(dbc,
  -			    &pg, npg, PGNO_INVALID, DB_EXCH_DEFAULT)) != 0)
  +			if ((ret = __db_exchange_page(dbc, &cp->csp->page,
  +			    ncp->csp->page,
  +			    PGNO_INVALID, DB_EXCH_DEFAULT)) != 0)
   				goto err;
   		}
   	}
  @@ -2426,22 +2433,23 @@
   			}
   			goto err;
   		}
  -		pg = cp->csp->page;
  -		pgno = PGNO(pg);
  +		pgno = PGNO(cp->csp->page);
   
   		if (pgno > c_data->compact_truncate) {
  -			if ((ret = __db_exchange_page(dbc,
  -			    &pg, NULL, PGNO_INVALID, DB_EXCH_DEFAULT)) != 0)
  +			if ((ret = __db_exchange_page(dbc, &cp->csp->page,
  +			    NULL, PGNO_INVALID, DB_EXCH_DEFAULT)) != 0)
   				goto err;
   		}
   
  +		pg = cp->csp->page;
   		if ((ret = __bam_stkrel(dbc,
  -		     pgno > c_data->compact_truncate ? 0 : STK_NOLOCK)) != 0)
  +		     pgno != PGNO(pg) ? 0 : STK_NOLOCK)) != 0)
   			goto err;
   
   		/* We are locking subtrees, so drop the write locks asap. */
  -		if (local_txn && pgno > c_data->compact_truncate)
  +		if (local_txn && pgno != PGNO(pg))
   			break;
  +		/* We really break from the loop above on this condition. */
   	} while (pgno != BAM_ROOT_PGNO(dbc));
   
   	if ((ret = __LPUT(dbc, root_lock)) != 0)
  @@ .
  patch -p0 <<'@@ .'
  Index: db/btree/bt_rec.c
  ============================================================================
  $ cvs diff -u -r1.10 -r1.11 bt_rec.c
  --- db/btree/bt_rec.c	1 Apr 2010 16:03:15 -0000	1.10
  +++ db/btree/bt_rec.c	21 Aug 2010 20:50:22 -0000	1.11
  @@ -41,7 +41,7 @@
   	DB_MPOOLFILE *mpf;
   	PAGE *_lp, *lp, *np, *pp, *_rp, *rp, *sp;
   	db_pgno_t pgno, parent_pgno;
  -	u_int32_t opflags, ptype, size;
  +	u_int32_t opflags, size;
   	int cmp, l_update, p_update, r_update, ret, rootsplit, t_ret;
   
   	ip = ((DB_TXNHEAD *)info)->thread_info;
  @@ -179,20 +179,20 @@
   		rp = NULL;
   		/*
   		 * If the parent page is wrong, update it.
  -		 * Initialize the page.  If it is a root page update
  -		 * the record counts if needed and put the first record in.
  +		 * For recno the insert into an existing parent
  +		 * was logged separately.
  +		 * If it is a root page update initialize the page and
  +		 * update the record counts if needed.  
   		 * Then insert the record for the right hand child page.
   		 */
   		if (p_update) {
   			REC_DIRTY(mpf, ip, file_dbp->priority, &pp);
  -			if (opflags & SPL_RECNO)
  -				ptype = P_IRECNO;
  -			else
  -				ptype = P_IBTREE;
   
   			if (rootsplit) {
   				P_INIT(pp, file_dbp->pgsize, pgno, PGNO_INVALID,
  -				    PGNO_INVALID, _lp->level + 1, ptype);
  +				    PGNO_INVALID, _lp->level + 1,
  +				    (opflags & SPL_RECNO) ?
  +				    P_IRECNO : P_IBTREE);
   				if (opflags & SPL_NRECS) {
   					RE_NREC_SET(pp,
   					    __bam_total(file_dbp, _lp) +
  @@ -203,11 +203,12 @@
   				    &argp->pentry, NULL)) != 0)
   					goto out;
   
  -			}
  +			} else if (opflags & SPL_NRECS)
  +				goto recno;
   			if ((ret = __db_pitem_nolog(dbc, pp, argp->pindx + 1,
   			    argp->rentry.size, &argp->rentry, NULL)) != 0)
   				goto out;
  -			pp->lsn = *lsnp;
  +recno:			pp->lsn = *lsnp;
   		}
   
   check_next:	/*
  @@ -281,6 +282,7 @@
   
   		/*
   		 * Next we can update the parent removing the new index.
  +		 * If this has record numbers, then we log this separately.
   		 */
   		if (pp != NULL) {
   			DB_ASSERT(env, !rootsplit);
  @@ -288,16 +290,15 @@
   			CHECK_ABORT(env, op, cmp, &LSN(pp), lsnp);
   			if (cmp == 0) {
   				REC_DIRTY(mpf, ip, file_dbp->priority, &pp);
  -				if (opflags & SPL_RECNO)
  -					size = RINTERNAL_SIZE;
  -				else
  +				if ((opflags & SPL_NRECS) == 0) {
   					size  = BINTERNAL_SIZE(
   					    GET_BINTERNAL(file_dbp,
   					    pp, argp->pindx + 1)->len);
   
  -				if ((ret = __db_ditem(dbc, pp,
  -				    argp->pindx + 1, size)) != 0)
  -					goto out;
  +					if ((ret = __db_ditem(dbc, pp,
  +					    argp->pindx + 1, size)) != 0)
  +						goto out;
  +				}
   				pp->lsn = argp->plsn;
   			}
   		}
  @@ .
  patch -p0 <<'@@ .'
  Index: db/btree/bt_split.c
  ============================================================================
  $ cvs diff -u -r1.10 -r1.11 bt_split.c
  --- db/btree/bt_split.c	1 Apr 2010 16:03:15 -0000	1.10
  +++ db/btree/bt_split.c	21 Aug 2010 20:50:22 -0000	1.11
  @@ -284,6 +284,10 @@
   		    PGNO(rp), &LSN(rp), (u_int32_t)NUM_ENT(lp),
   		    PGNO_INVALID, &log_lsn, PGNO(cp->page),
   		    &LSN(cp->page), 0, &log_dbt, &rootent[0], &rootent[1]);
  +
  +		/* On failure, restore the page. */
  +		if (ret != 0)
  +			memcpy(cp->page, log_dbt.data, dbp->pgsize);
   		__os_free(dbp->env, log_dbt.data);
   
   		if (ret != 0)
  @@ -431,11 +435,13 @@
   	DB_ASSERT(dbp->env, IS_DIRTY(cp->page));
   	DB_ASSERT(dbp->env, IS_DIRTY(pp->page));
   
  +	bc = (BTREE_CURSOR *)dbc->internal;
  +
   	/* Actually update the parent page. */
  -	if ((ret = __bam_pinsert(dbc, pp, split, lp, rp, BPI_NOLOGGING)) != 0)
  +	if ((ret = __bam_pinsert(dbc,
  +	    pp, split, lp, rp, F_ISSET(bc, C_RECNUM) ? 0 : BPI_NOLOGGING)) != 0)
   		goto err;
   
  -	bc = (BTREE_CURSOR *)dbc->internal;
   	/* Log the change. */
   	if (DBC_LOGGING(dbc)) {
   		memset(&log_dbt, 0, sizeof(log_dbt));
  @@ -459,12 +465,17 @@
   		    tp == NULL ? &log_lsn : &LSN(tp), PGNO(pp->page),
   		    &LSN(pp->page), pp->indx, &log_dbt, NULL, &rentry)) != 0) {
   			/*
  -			 * Undo the update to the parent page, which has not
  -			 * been logged yet. This must succeed.
  +			 * If this is not RECNO then undo the update
  +			 * to the parent page, which has not been
  +			 * logged yet. This must succeed.  Renco
  +			 * database trees are locked and therefore
  +			 * the parent can be logged independently.
   			 */
  -			t_ret = __db_ditem_nolog(dbc, pp->page,
  -			    pp->indx + 1, rentry.size);
  -			DB_ASSERT(dbp->env, t_ret == 0);
  +			if (F_ISSET(bc, C_RECNUM) == 0) {
  +				t_ret = __db_ditem_nolog(dbc, pp->page,
  +				    pp->indx + 1, rentry.size);
  +				DB_ASSERT(dbp->env, t_ret == 0);
  +			}
   
   			goto err;
   		}
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db.h
  ============================================================================
  $ cvs diff -u -r1.19 -r1.20 db.h
  --- db/build_vxworks/db.h	1 Apr 2010 16:03:19 -0000	1.19
  +++ db/build_vxworks/db.h	21 Aug 2010 20:50:22 -0000	1.20
  @@ -47,9 +47,9 @@
   #define	DB_VERSION_RELEASE	2
   #define	DB_VERSION_MAJOR	5
   #define	DB_VERSION_MINOR	0
  -#define	DB_VERSION_PATCH	21
  -#define	DB_VERSION_STRING	"Berkeley DB 5.0.21: (March 30, 2010)"
  -#define	DB_VERSION_FULL_STRING	"Berkeley DB 11g Release 2, library version 11.2.5.0.21: (March 30, 2010)"
  +#define	DB_VERSION_PATCH	26
  +#define	DB_VERSION_STRING	"Berkeley DB 5.0.26: (June 25, 2010)"
  +#define	DB_VERSION_FULL_STRING	"Berkeley DB 11g Release 2, library version 11.2.5.0.26: (June 25, 2010)"
   
   /*
    * !!!
  @@ -2773,7 +2773,7 @@
   char *db_full_version __P((int *, int *, int *, int *, int *));
   int log_compare __P((const DB_LSN *, const DB_LSN *));
   int db_sequence_create __P((DB_SEQUENCE **, DB *, u_int32_t));
  -#ifdef HAVE_DBM
  +#if DB_DBM_HSEARCH != 0
   int	 __db_ndbm_clearerr __P((DBM *));
   void	 __db_ndbm_close __P((DBM *));
   int	 __db_ndbm_delete __P((DBM *, datum));
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_config.h
  ============================================================================
  $ cvs diff -u -r1.19 -r1.20 db_config.h
  --- db/build_vxworks/db_config.h	1 Apr 2010 16:03:19 -0000	1.19
  +++ db/build_vxworks/db_config.h	21 Aug 2010 20:50:23 -0000	1.20
  @@ -555,16 +555,16 @@
   #define PACKAGE_NAME "Berkeley DB"
   
   /* Define to the full name and version of this package. */
  -#define PACKAGE_STRING "Berkeley DB 5.0.21"
  +#define PACKAGE_STRING "Berkeley DB 5.0.26"
   
   /* Define to the one symbol short name of this package. */
  -#define PACKAGE_TARNAME "db-5.0.21"
  +#define PACKAGE_TARNAME "db-5.0.26"
   
   /* Define to the home page for this package. */
   #define PACKAGE_URL "http://www.oracle.com/technology/software/products/berkeley-db/index.html"
   
   /* Define to the version of this package. */
  -#define PACKAGE_VERSION "5.0.21"
  +#define PACKAGE_VERSION "5.0.26"
   
   /* The size of a `char', as computed by sizeof. */
   /* #undef SIZEOF_CHAR */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_config_small.h
  ============================================================================
  $ cvs diff -u -r1.15 -r1.16 db_config_small.h
  --- db/build_vxworks/db_config_small.h	1 Apr 2010 16:03:19 -0000	1.15
  +++ db/build_vxworks/db_config_small.h	21 Aug 2010 20:50:23 -0000	1.16
  @@ -555,16 +555,16 @@
   #define PACKAGE_NAME "Berkeley DB"
   
   /* Define to the full name and version of this package. */
  -#define PACKAGE_STRING "Berkeley DB 5.0.21"
  +#define PACKAGE_STRING "Berkeley DB 5.0.26"
   
   /* Define to the one symbol short name of this package. */
  -#define PACKAGE_TARNAME "db-5.0.21"
  +#define PACKAGE_TARNAME "db-5.0.26"
   
   /* Define to the home page for this package. */
   #define PACKAGE_URL "http://www.oracle.com/technology/software/products/berkeley-db/index.html"
   
   /* Define to the version of this package. */
  -#define PACKAGE_VERSION "5.0.21"
  +#define PACKAGE_VERSION "5.0.26"
   
   /* The size of a `char', as computed by sizeof. */
   /* #undef SIZEOF_CHAR */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_wince/db.h
  ============================================================================
  $ cvs diff -u -r1.3 -r1.4 db.h
  --- db/build_wince/db.h	1 Apr 2010 16:03:26 -0000	1.3
  +++ db/build_wince/db.h	21 Aug 2010 20:50:23 -0000	1.4
  @@ -61,9 +61,9 @@
   #define	DB_VERSION_RELEASE	2
   #define	DB_VERSION_MAJOR	5
   #define	DB_VERSION_MINOR	0
  -#define	DB_VERSION_PATCH	21
  -#define	DB_VERSION_STRING	"Berkeley DB 5.0.21: (March 30, 2010)"
  -#define	DB_VERSION_FULL_STRING	"Berkeley DB 11g Release 2, library version 11.2.5.0.21: (March 30, 2010)"
  +#define	DB_VERSION_PATCH	26
  +#define	DB_VERSION_STRING	"Berkeley DB 5.0.26: (June 25, 2010)"
  +#define	DB_VERSION_FULL_STRING	"Berkeley DB 11g Release 2, library version 11.2.5.0.26: (June 25, 2010)"
   
   /*
    * !!!
  @@ -2819,7 +2819,7 @@
   char *db_full_version __P((int *, int *, int *, int *, int *));
   int log_compare __P((const DB_LSN *, const DB_LSN *));
   int db_sequence_create __P((DB_SEQUENCE **, DB *, u_int32_t));
  -#ifdef HAVE_DBM
  +#if DB_DBM_HSEARCH != 0
   int	 __db_ndbm_clearerr __P((DBM *));
   void	 __db_ndbm_close __P((DBM *));
   int	 __db_ndbm_delete __P((DBM *, datum));
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_wince/db_config.h
  ============================================================================
  $ cvs diff -u -r1.3 -r1.4 db_config.h
  --- db/build_wince/db_config.h	1 Apr 2010 16:03:26 -0000	1.3
  +++ db/build_wince/db_config.h	21 Aug 2010 20:50:23 -0000	1.4
  @@ -559,16 +559,16 @@
   #define PACKAGE_NAME "Berkeley DB"
   
   /* Define to the full name and version of this package. */
  -#define PACKAGE_STRING "Berkeley DB 5.0.21"
  +#define PACKAGE_STRING "Berkeley DB 5.0.26"
   
   /* Define to the one symbol short name of this package. */
  -#define PACKAGE_TARNAME "db-5.0.21"
  +#define PACKAGE_TARNAME "db-5.0.26"
   
   /* Define to the home page for this package. */
   #define PACKAGE_URL "http://www.oracle.com/technology/software/products/berkeley-db/index.html"
   
   /* Define to the version of this package. */
  -#define PACKAGE_VERSION "5.0.21"
  +#define PACKAGE_VERSION "5.0.26"
   
   /* The size of a `char', as computed by sizeof. */
   /* #undef SIZEOF_CHAR */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_windows/db.h
  ============================================================================
  $ cvs diff -u -r1.8 -r1.9 db.h
  --- db/build_windows/db.h	1 Apr 2010 16:03:28 -0000	1.8
  +++ db/build_windows/db.h	21 Aug 2010 20:50:23 -0000	1.9
  @@ -61,9 +61,9 @@
   #define	DB_VERSION_RELEASE	2
   #define	DB_VERSION_MAJOR	5
   #define	DB_VERSION_MINOR	0
  -#define	DB_VERSION_PATCH	21
  -#define	DB_VERSION_STRING	"Berkeley DB 5.0.21: (March 30, 2010)"
  -#define	DB_VERSION_FULL_STRING	"Berkeley DB 11g Release 2, library version 11.2.5.0.21: (March 30, 2010)"
  +#define	DB_VERSION_PATCH	26
  +#define	DB_VERSION_STRING	"Berkeley DB 5.0.26: (June 25, 2010)"
  +#define	DB_VERSION_FULL_STRING	"Berkeley DB 11g Release 2, library version 11.2.5.0.26: (June 25, 2010)"
   
   /*
    * !!!
  @@ -2819,7 +2819,7 @@
   char *db_full_version __P((int *, int *, int *, int *, int *));
   int log_compare __P((const DB_LSN *, const DB_LSN *));
   int db_sequence_create __P((DB_SEQUENCE **, DB *, u_int32_t));
  -#ifdef HAVE_DBM
  +#if DB_DBM_HSEARCH != 0
   int	 __db_ndbm_clearerr __P((DBM *));
   void	 __db_ndbm_close __P((DBM *));
   int	 __db_ndbm_delete __P((DBM *, datum));
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_windows/db_config.h
  ============================================================================
  $ cvs diff -u -r1.8 -r1.9 db_config.h
  --- db/build_windows/db_config.h	1 Apr 2010 16:03:28 -0000	1.8
  +++ db/build_windows/db_config.h	21 Aug 2010 20:50:23 -0000	1.9
  @@ -566,16 +566,16 @@
   #define PACKAGE_NAME "Berkeley DB"
   
   /* Define to the full name and version of this package. */
  -#define PACKAGE_STRING "Berkeley DB 5.0.21"
  +#define PACKAGE_STRING "Berkeley DB 5.0.26"
   
   /* Define to the one symbol short name of this package. */
  -#define PACKAGE_TARNAME "db-5.0.21"
  +#define PACKAGE_TARNAME "db-5.0.26"
   
   /* Define to the home page for this package. */
   #define PACKAGE_URL "http://www.oracle.com/technology/software/products/berkeley-db/index.html"
   
   /* Define to the version of this package. */
  -#define PACKAGE_VERSION "5.0.21"
  +#define PACKAGE_VERSION "5.0.26"
   
   /* The size of a `char', as computed by sizeof. */
   /* #undef SIZEOF_CHAR */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_windows/libdb.rc
  ============================================================================
  $ cvs diff -u -r1.8 -r1.9 libdb.rc
  --- db/build_windows/libdb.rc	1 Apr 2010 16:03:30 -0000	1.8
  +++ db/build_windows/libdb.rc	21 Aug 2010 20:50:23 -0000	1.9
  @@ -1,6 +1,6 @@
   1 VERSIONINFO
  - FILEVERSION 5,0,0,21
  - PRODUCTVERSION 5,0,0,21
  + FILEVERSION 5,0,0,26
  + PRODUCTVERSION 5,0,0,26
    FILEFLAGSMASK 0x3fL
   #ifdef _DEBUG
    FILEFLAGS 0x1L
  @@ -18,12 +18,12 @@
           BEGIN
               VALUE "CompanyName", "Oracle\0"
               VALUE "FileDescription", "Berkeley DB 5.0 DLL\0"
  -            VALUE "FileVersion", "5.0.21\0"
  +            VALUE "FileVersion", "5.0.26\0"
               VALUE "InternalName", "libdb50.dll\0"
               VALUE "LegalCopyright", "Copyright © Oracle 1997-2009\0"
               VALUE "OriginalFilename", "libdb50.dll\0"
               VALUE "ProductName", "Oracle libdb\0"
  -            VALUE "ProductVersion", "5.0.21\0"
  +            VALUE "ProductVersion", "5.0.26\0"
           END
       END
       BLOCK "VarFileInfo"
  @@ .
  patch -p0 <<'@@ .'
  Index: db/csharp/Properties/AssemblyInfo.cs
  ============================================================================
  $ cvs diff -u -r1.3 -r1.4 AssemblyInfo.cs
  --- db/csharp/Properties/AssemblyInfo.cs	1 Apr 2010 16:03:36 -0000	1.3
  +++ db/csharp/Properties/AssemblyInfo.cs	21 Aug 2010 20:50:24 -0000	1.4
  @@ -29,4 +29,4 @@
   //      Build Number
   //      Revision
   //
  -[assembly: AssemblyVersion("5.0.21")]
  +[assembly: AssemblyVersion("5.0.26")]
  @@ .
  patch -p0 <<'@@ .'
  Index: db/db/db_pr.c
  ============================================================================
  $ cvs diff -u -r1.12 -r1.13 db_pr.c
  --- db/db/db_pr.c	1 Apr 2010 16:03:37 -0000	1.12
  +++ db/db/db_pr.c	21 Aug 2010 20:50:24 -0000	1.13
  @@ -309,7 +309,7 @@
   	 * by reading the value from the meta-data page, that's going to be
   	 * slow.  Reach down into the mpool region.
   	 */
  -	pagesize = (u_int32_t)dbp->mpf->mfp->stat.st_pagesize;
  +	pagesize = (u_int32_t)dbp->mpf->mfp->pagesize;
   	return (__db_prpage_int(dbp->env, dbp, "", h, pagesize, NULL, flags));
   }
   
  @@ .
  patch -p0 <<'@@ .'
  Index: db/db/db_rec.c
  ============================================================================
  $ cvs diff -u -r1.14 -r1.15 db_rec.c
  --- db/db/db_rec.c	1 Apr 2010 16:03:37 -0000	1.14
  +++ db/db/db_rec.c	21 Aug 2010 20:50:24 -0000	1.15
  @@ -1069,8 +1069,9 @@
   	REC_PRINT(__db_pg_free_print);
   	REC_INTRO(__db_pg_free_read, ip, 0);
   
  -	ret = __db_pg_free_recover_int(env, ip,
  -	     (__db_pg_freedata_args *)argp, file_dbp, lsnp, mpf, op, 0);
  +	if ((ret = __db_pg_free_recover_int(env, ip,
  +	     (__db_pg_freedata_args *)argp, file_dbp, lsnp, mpf, op, 0)) != 0)
  +	     	goto out;
   
   done:	*lsnp = argp->prev_lsn;
   out:
  @@ -1103,8 +1104,9 @@
   	REC_PRINT(__db_pg_freedata_print);
   	REC_INTRO(__db_pg_freedata_read, ip, 0);
   
  -	ret = __db_pg_free_recover_int(env,
  -	    ip, argp, file_dbp, lsnp, mpf, op, 1);
  +	if ((ret = __db_pg_free_recover_int(env,
  +	    ip, argp, file_dbp, lsnp, mpf, op, 1)) != 0)
  +	    	goto out;
   
   done:	*lsnp = argp->prev_lsn;
   out:
  @@ .
  patch -p0 <<'@@ .'
  Index: db/dbinc/mp.h
  ============================================================================
  $ cvs diff -u -r1.13 -r1.14 mp.h
  --- db/dbinc/mp.h	1 Apr 2010 16:03:45 -0000	1.13
  +++ db/dbinc/mp.h	21 Aug 2010 20:50:24 -0000	1.14
  @@ -144,6 +144,9 @@
   
   	/* Configuration information: protected by the region lock. */
   	u_int32_t max_nreg;		/* Maximum number of regions. */
  +	u_int32_t gbytes;		/* Number of gigabytes in cache. */
  +	u_int32_t bytes;		/* Number of bytes in cache. */
  +	u_int32_t pagesize;		/* Default page size. */
   	size_t    mp_mmapsize;		/* Maximum file size for mmap. */
   	int       mp_maxopenfd;		/* Maximum open file descriptors. */
   	int       mp_maxwrite;		/* Maximum buffers to write. */
  @@ -183,11 +186,15 @@
   	u_int32_t lru_count;		/* Counter for buffer LRU. */
   	int32_t   lru_reset;		/* Hash bucket lru reset point. */
   
  +	 /*
  +	  * The pages field keeps track of the number of pages in the cache
  +	  * and is protected by the region lock.  It is accessed for reading
  +	  * without the lock to return statistics.
  +	  */
  +	u_int32_t pages;		/* Number of pages in the cache. */
  +
   	/*
  -	 * The stat fields are generally not thread protected, and cannot be
  -	 * trusted.  Note that st_pages is an exception, and is always updated
  -	 * inside a region lock (although it is sometimes read outside of the
  -	 * region lock).
  +	 * The stat fields are not thread protected, and cannot be trusted.
   	 */
   	DB_MPOOL_STAT stat;		/* Per-cache mpool statistics. */
   
  @@ -452,6 +459,7 @@
   
   	roff_t	  fileid_off;		/* File ID string location. */
   
  +	u_int32_t pagesize;		/* Underlying pagesize. */
   	roff_t	  pgcookie_len;		/* Pgin/pgout cookie length. */
   	roff_t	  pgcookie_off;		/* Pgin/pgout cookie location. */
   
  @@ -587,8 +595,8 @@
   #define	VM_PAGESIZE 4096
   #define	MVCC_BHSIZE(mfp, sz) do {					\
   	sz += VM_PAGESIZE + sizeof(BH);					\
  -	if (mfp->stat.st_pagesize < VM_PAGESIZE)			\
  -		sz += VM_PAGESIZE - mfp->stat.st_pagesize;		\
  +	if (mfp->pagesize < VM_PAGESIZE)				\
  +		sz += VM_PAGESIZE - mfp->pagesize;			\
   } while (0)
   
   #define	MVCC_BHALIGN(p) do {						\
  @@ -602,7 +610,7 @@
   	    ((uintptr_t)__bhp->buf & (VM_PAGESIZE - 1)) == 0);		\
   	DB_ASSERT(env,							\
   	    (u_int8_t *)__bhp >= (u_int8_t *)__orig);			\
  -	DB_ASSERT(env, (u_int8_t *)p + mfp->stat.st_pagesize <		\
  +	DB_ASSERT(env, (u_int8_t *)p + mfp->pagesize <			\
   	    (u_int8_t *)__orig + len);					\
   	__bhp->align_off =						\
   	    (u_int16_t)((u_int8_t *)__bhp - (u_int8_t *)__orig);	\
  @@ .
  patch -p0 <<'@@ .'
  Index: db/dbinc_auto/ext_def.in
  ============================================================================
  $ cvs diff -u -r1.6 -r1.7 ext_def.in
  --- db/dbinc_auto/ext_def.in	1 Apr 2010 16:03:48 -0000	1.6
  +++ db/dbinc_auto/ext_def.in	21 Aug 2010 20:50:25 -0000	1.7
  @@ -31,7 +31,7 @@
   #define	db_full_version db_full_version@DB_VERSION_UNIQUE_NAME@
   #define	log_compare log_compare@DB_VERSION_UNIQUE_NAME@
   #define	db_sequence_create db_sequence_create@DB_VERSION_UNIQUE_NAME@
  -#ifdef HAVE_DBM
  +#if DB_DBM_HSEARCH != 0
   #define	__db_ndbm_clearerr __db_ndbm_clearerr@DB_VERSION_UNIQUE_NAME@
   #define	__db_ndbm_close __db_ndbm_close@DB_VERSION_UNIQUE_NAME@
   #define	__db_ndbm_delete __db_ndbm_delete@DB_VERSION_UNIQUE_NAME@
  @@ .
  patch -p0 <<'@@ .'
  Index: db/dbinc_auto/ext_prot.in
  ============================================================================
  $ cvs diff -u -r1.5 -r1.6 ext_prot.in
  --- db/dbinc_auto/ext_prot.in	1 Apr 2010 16:03:48 -0000	1.5
  +++ db/dbinc_auto/ext_prot.in	21 Aug 2010 20:50:25 -0000	1.6
  @@ -35,7 +35,7 @@
   char *db_full_version __P((int *, int *, int *, int *, int *));
   int log_compare __P((const DB_LSN *, const DB_LSN *));
   int db_sequence_create __P((DB_SEQUENCE **, DB *, u_int32_t));
  -#ifdef HAVE_DBM
  +#if DB_DBM_HSEARCH != 0
   int	 __db_ndbm_clearerr __P((DBM *));
   void	 __db_ndbm_close __P((DBM *));
   int	 __db_ndbm_delete __P((DBM *, datum));
  @@ .
  patch -p0 <<'@@ .'
  Index: db/dbm/dbm.c
  ============================================================================
  $ cvs diff -u -r1.11 -r1.12 dbm.c
  --- db/dbm/dbm.c	1 Apr 2010 16:03:50 -0000	1.11
  +++ db/dbm/dbm.c	21 Aug 2010 20:50:25 -0000	1.12
  @@ -49,7 +49,7 @@
    *
    * This package provides dbm and ndbm compatible interfaces to DB.
    *
  - * EXTERN: #ifdef HAVE_DBM
  + * EXTERN: #if DB_DBM_HSEARCH != 0
    * EXTERN: int	 __db_ndbm_clearerr __P((DBM *));
    * EXTERN: void	 __db_ndbm_close __P((DBM *));
    * EXTERN: int	 __db_ndbm_delete __P((DBM *, datum));
  @@ .
  patch -p0 <<'@@ .'
  Index: db/dbreg/dbreg_rec.c
  ============================================================================
  $ cvs diff -u -r1.11 -r1.12 dbreg_rec.c
  --- db/dbreg/dbreg_rec.c	1 Apr 2010 16:03:50 -0000	1.11
  +++ db/dbreg/dbreg_rec.c	21 Aug 2010 20:50:25 -0000	1.12
  @@ -325,9 +325,13 @@
   		 * file uid of the current file does not match that of the
   		 * previously opened file, 3) the current file is unnamed, in
   		 * which case it should never be opened during recovery.
  +		 * It is also possible that the db open previously failed
  +		 * because the file was missing.  Check the DB_AM_OPEN_CALLED
  +		 * bit and try to open it again.
   		 */
   		if ((dbp = dbe->dbp) != NULL) {
   			if (opcode == DBREG_REOPEN ||
  +			    !F_ISSET(dbp, DB_AM_OPEN_CALLED) ||
   			    dbp->meta_pgno != argp->meta_pgno ||
   			    argp->name.size == 0 ||
   			    memcmp(dbp->fileid, argp->uid.data,
  @@ .
  patch -p0 <<'@@ .'
  Index: db/dbreg/dbreg_util.c
  ============================================================================
  $ cvs diff -u -r1.11 -r1.12 dbreg_util.c
  --- db/dbreg/dbreg_util.c	1 Apr 2010 16:03:50 -0000	1.11
  +++ db/dbreg/dbreg_util.c	21 Aug 2010 20:50:25 -0000	1.12
  @@ -673,24 +673,25 @@
   			CLR_INMEM(dbp);
   
   		/*
  -		 * Record that the open failed in the txnlist.
  -		 * If this is a failed open inside a transaction
  -		 * then we may have crashed without writing the
  -		 * corresponding close, record the open so recovery
  -		 * will write a close record with its checkpoint.
  +		 * If it exists neither on disk nor in memory
  +		 * record that the open failed in the txnlist.
   		 */
  -		if (id != TXN_INVALID) {
  -			if ((ret = __db_txnlist_update(env, info,
  -			    id, TXN_UNEXPECTED, NULL, &ret_stat, 1)) != 0)
  -				goto not_right;
  -			if (opcode == DBREG_OPEN) {
  -				if (dbp->log_filename == NULL && (ret =
  -				    __dbreg_setup(dbp, name, NULL, id)) != 0)
  -					return (ret);
  -				ret = __dbreg_assign_id(dbp, ndx, 1);
  -				return (ret);
  -			}
  -		}
  +		if (id != TXN_INVALID && (ret = __db_txnlist_update(env,
  +		    info, id, TXN_UNEXPECTED, NULL, &ret_stat, 1)) != 0)
  +			goto not_right;
  +		
  +		/*
  +		 * If this is file is missing then we may have crashed
  +		 * without writing the corresponding close, record
  +		 * the open so recovery will write a close record
  +		 * with its checkpoint.
  +		 */
  +		if ((opcode == DBREG_CHKPNT || opcode == DBREG_OPEN) &&
  +		    dbp->log_filename == NULL &&
  +		    (ret = __dbreg_setup(dbp, name, NULL, id)) != 0)
  +			return (ret);
  +		ret = __dbreg_assign_id(dbp, ndx, 1);
  +		return (ret);
   	}
   not_right:
   	if ((t_ret = __db_close(dbp, NULL, DB_NOSYNC)) != 0)
  @@ .
  patch -p0 <<'@@ .'
  Index: db/dist/RELEASE
  ============================================================================
  $ cvs diff -u -r1.17 -r1.18 RELEASE
  --- db/dist/RELEASE	1 Apr 2010 16:03:50 -0000	1.17
  +++ db/dist/RELEASE	21 Aug 2010 20:50:26 -0000	1.18
  @@ -5,7 +5,7 @@
   DB_VERSION_RELEASE=2
   DB_VERSION_MAJOR=5
   DB_VERSION_MINOR=0
  -DB_VERSION_PATCH=21
  +DB_VERSION_PATCH=26
   DB_VERSION="$DB_VERSION_MAJOR.$DB_VERSION_MINOR.$DB_VERSION_PATCH"
   DB_VERSION_FULL="$DB_VERSION_FAMILY.$DB_VERSION_RELEASE.$DB_VERSION_MAJOR.$DB_VERSION_MINOR.$DB_VERSION_PATCH"
   
  @@ .
  patch -p0 <<'@@ .'
  Index: db/dist/configure
  ============================================================================
  $ cvs diff -u -r1.23 -r1.24 configure
  --- db/dist/configure	1 Apr 2010 16:03:50 -0000	1.23
  +++ db/dist/configure	21 Aug 2010 20:50:26 -0000	1.24
  @@ -1,6 +1,6 @@
   #! /bin/sh
   # Guess values for system-dependent variables and create Makefiles.
  -# Generated by GNU Autoconf 2.65 for Berkeley DB 5.0.21.
  +# Generated by GNU Autoconf 2.65 for Berkeley DB 5.0.26.
   #
   # Report bugs to <Oracle Technology Network Berkeley DB forum>.
   #
  @@ -700,9 +700,9 @@
   
   # Identity of this package.
   PACKAGE_NAME='Berkeley DB'
  -PACKAGE_TARNAME='db-5.0.21'
  -PACKAGE_VERSION='5.0.21'
  -PACKAGE_STRING='Berkeley DB 5.0.21'
  +PACKAGE_TARNAME='db-5.0.26'
  +PACKAGE_VERSION='5.0.26'
  +PACKAGE_STRING='Berkeley DB 5.0.26'
   PACKAGE_BUGREPORT='Oracle Technology Network Berkeley DB forum'
   PACKAGE_URL=''
   
  @@ -980,7 +980,7 @@
   enable_stl
   enable_tcl
   enable_test
  -enable_build_dbm
  +enable_dbm
   enable_dtrace
   enable_systemtap
   enable_uimutexes
  @@ -1555,7 +1555,7 @@
     # Omit some internal or obsolete options to make the list less imposing.
     # This message is too long to be a string in the A/UX 3.1 sh.
     cat <<_ACEOF
  -\`configure' configures Berkeley DB 5.0.21 to adapt to many kinds of systems.
  +\`configure' configures Berkeley DB 5.0.26 to adapt to many kinds of systems.
   
   Usage: $0 [OPTION]... [VAR=VALUE]...
   
  @@ -1604,7 +1604,7 @@
     --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
     --mandir=DIR            man documentation [DATAROOTDIR/man]
     --docdir=DIR            documentation root
  -                          [DATAROOTDIR/doc/db-5.0.21]
  +                          [DATAROOTDIR/doc/db-5.0.26]
     --htmldir=DIR           html documentation [DOCDIR]
     --dvidir=DIR            dvi documentation [DOCDIR]
     --pdfdir=DIR            pdf documentation [DOCDIR]
  @@ -1626,7 +1626,7 @@
   
   if test -n "$ac_init_help"; then
     case $ac_init_help in
  -     short | recursive ) echo "Configuration of Berkeley DB 5.0.21:";;
  +     short | recursive ) echo "Configuration of Berkeley DB 5.0.26:";;
      esac
     cat <<\_ACEOF
   
  @@ -1772,7 +1772,7 @@
   test -n "$ac_init_help" && exit $ac_status
   if $ac_init_version; then
     cat <<\_ACEOF
  -Berkeley DB configure 5.0.21
  +Berkeley DB configure 5.0.26
   generated by GNU Autoconf 2.65
   
   Copyright (C) 2009 Free Software Foundation, Inc.
  @@ -2553,7 +2553,7 @@
   This file contains any messages produced by compilers while
   running configure, to aid debugging if configure makes a mistake.
   
  -It was created by Berkeley DB $as_me 5.0.21, which was
  +It was created by Berkeley DB $as_me 5.0.26, which was
   generated by GNU Autoconf 2.65.  Invocation command line was
   
     $ $0 $@
  @@ -3109,11 +3109,11 @@
   
   DB_VERSION_MINOR="0"
   
  -DB_VERSION_PATCH="21"
  +DB_VERSION_PATCH="26"
   
  -DB_VERSION_STRING='"Berkeley DB 5.0.21: (March 30, 2010)"'
  +DB_VERSION_STRING='"Berkeley DB 5.0.26: (June 25, 2010)"'
   
  -DB_VERSION_FULL_STRING='"Berkeley DB 11g Release 2, library version 11.2.5.0.21: (March 30, 2010)"'
  +DB_VERSION_FULL_STRING='"Berkeley DB 11g Release 2, library version 11.2.5.0.26: (June 25, 2010)"'
   
   
   # Process all options before using them.
  @@ -3563,20 +3563,15 @@
   
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if --enable-dbm option specified" >&5
   $as_echo_n "checking if --enable-dbm option specified... " >&6; }
  -# Check whether --enable-build_dbm was given.
  -if test "${enable_build_dbm+set}" = set; then :
  -  enableval=$enable_build_dbm; db_cv_build_dbm="$enable_dbm"
  +# Check whether --enable-dbm was given.
  +if test "${enable_dbm+set}" = set; then :
  +  enableval=$enable_dbm; db_cv_dbm="$enable_dbm"
   else
  -  enableval="$db_cv_test"
  +  db_cv_dbm="$db_cv_test"
   fi
   
  -db_cv_build_dbm="$enableval"
  -case "$enableval" in
  - no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
  -$as_echo "yes" >&6; };;
  -yes) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
  -$as_echo "no" >&6; };;
  -esac
  +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $db_cv_dbm" >&5
  +$as_echo "$db_cv_dbm" >&6; }
   
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if --enable-dtrace option specified" >&5
   $as_echo_n "checking if --enable-dtrace option specified... " >&6; }
  @@ -7558,13 +7553,13 @@
   else
     lt_cv_nm_interface="BSD nm"
     echo "int some_variable = 0;" > conftest.$ac_ext
  -  (eval echo "\"\$as_me:7561: $ac_compile\"" >&5)
  +  (eval echo "\"\$as_me:7556: $ac_compile\"" >&5)
     (eval "$ac_compile" 2>conftest.err)
     cat conftest.err >&5
  -  (eval echo "\"\$as_me:7564: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
  +  (eval echo "\"\$as_me:7559: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
     (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
     cat conftest.err >&5
  -  (eval echo "\"\$as_me:7567: output\"" >&5)
  +  (eval echo "\"\$as_me:7562: output\"" >&5)
     cat conftest.out >&5
     if $GREP 'External.*some_variable' conftest.out > /dev/null; then
       lt_cv_nm_interface="MS dumpbin"
  @@ -8769,7 +8764,7 @@
     ;;
   *-*-irix6*)
     # Find out which ABI we are using.
  -  echo '#line 8772 "configure"' > conftest.$ac_ext
  +  echo '#line 8767 "configure"' > conftest.$ac_ext
     if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
     (eval $ac_compile) 2>&5
     ac_status=$?
  @@ -10698,11 +10693,11 @@
      -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
      -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
      -e 's:$: $lt_compiler_flag:'`
  -   (eval echo "\"\$as_me:10701: $lt_compile\"" >&5)
  +   (eval echo "\"\$as_me:10696: $lt_compile\"" >&5)
      (eval "$lt_compile" 2>conftest.err)
      ac_status=$?
      cat conftest.err >&5
  -   echo "$as_me:10705: \$? = $ac_status" >&5
  +   echo "$as_me:10700: \$? = $ac_status" >&5
      if (exit $ac_status) && test -s "$ac_outfile"; then
        # The compiler can only warn and ignore the option if not recognized
        # So say no if there are warnings other than the usual output.
  @@ -11037,11 +11032,11 @@
      -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
      -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
      -e 's:$: $lt_compiler_flag:'`
  -   (eval echo "\"\$as_me:11040: $lt_compile\"" >&5)
  +   (eval echo "\"\$as_me:11035: $lt_compile\"" >&5)
      (eval "$lt_compile" 2>conftest.err)
      ac_status=$?
      cat conftest.err >&5
  -   echo "$as_me:11044: \$? = $ac_status" >&5
  +   echo "$as_me:11039: \$? = $ac_status" >&5
      if (exit $ac_status) && test -s "$ac_outfile"; then
        # The compiler can only warn and ignore the option if not recognized
        # So say no if there are warnings other than the usual output.
  @@ -11142,11 +11137,11 @@
      -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
      -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
      -e 's:$: $lt_compiler_flag:'`
  -   (eval echo "\"\$as_me:11145: $lt_compile\"" >&5)
  +   (eval echo "\"\$as_me:11140: $lt_compile\"" >&5)
      (eval "$lt_compile" 2>out/conftest.err)
      ac_status=$?
      cat out/conftest.err >&5
  -   echo "$as_me:11149: \$? = $ac_status" >&5
  +   echo "$as_me:11144: \$? = $ac_status" >&5
      if (exit $ac_status) && test -s out/conftest2.$ac_objext
      then
        # The compiler can only warn and ignore the option if not recognized
  @@ -11197,11 +11192,11 @@
      -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
      -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
      -e 's:$: $lt_compiler_flag:'`
  -   (eval echo "\"\$as_me:11200: $lt_compile\"" >&5)
  +   (eval echo "\"\$as_me:11195: $lt_compile\"" >&5)
      (eval "$lt_compile" 2>out/conftest.err)
      ac_status=$?
      cat out/conftest.err >&5
  -   echo "$as_me:11204: \$? = $ac_status" >&5
  +   echo "$as_me:11199: \$? = $ac_status" >&5
      if (exit $ac_status) && test -s out/conftest2.$ac_objext
      then
        # The compiler can only warn and ignore the option if not recognized
  @@ -13564,7 +13559,7 @@
     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
     lt_status=$lt_dlunknown
     cat > conftest.$ac_ext <<_LT_EOF
  -#line 13567 "configure"
  +#line 13562 "configure"
   #include "confdefs.h"
   
   #if HAVE_DLFCN_H
  @@ -13660,7 +13655,7 @@
     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
     lt_status=$lt_dlunknown
     cat > conftest.$ac_ext <<_LT_EOF
  -#line 13663 "configure"
  +#line 13658 "configure"
   #include "confdefs.h"
   
   #if HAVE_DLFCN_H
  @@ -15616,11 +15611,11 @@
      -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
      -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
      -e 's:$: $lt_compiler_flag:'`
  -   (eval echo "\"\$as_me:15619: $lt_compile\"" >&5)
  +   (eval echo "\"\$as_me:15614: $lt_compile\"" >&5)
      (eval "$lt_compile" 2>conftest.err)
      ac_status=$?
      cat conftest.err >&5
  -   echo "$as_me:15623: \$? = $ac_status" >&5
  +   echo "$as_me:15618: \$? = $ac_status" >&5
      if (exit $ac_status) && test -s "$ac_outfile"; then
        # The compiler can only warn and ignore the option if not recognized
        # So say no if there are warnings other than the usual output.
  @@ -15715,11 +15710,11 @@
      -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
      -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
      -e 's:$: $lt_compiler_flag:'`
  -   (eval echo "\"\$as_me:15718: $lt_compile\"" >&5)
  +   (eval echo "\"\$as_me:15713: $lt_compile\"" >&5)
      (eval "$lt_compile" 2>out/conftest.err)
      ac_status=$?
      cat out/conftest.err >&5
  -   echo "$as_me:15722: \$? = $ac_status" >&5
  +   echo "$as_me:15717: \$? = $ac_status" >&5
      if (exit $ac_status) && test -s out/conftest2.$ac_objext
      then
        # The compiler can only warn and ignore the option if not recognized
  @@ -15767,11 +15762,11 @@
      -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
      -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
      -e 's:$: $lt_compiler_flag:'`
  -   (eval echo "\"\$as_me:15770: $lt_compile\"" >&5)
  +   (eval echo "\"\$as_me:15765: $lt_compile\"" >&5)
      (eval "$lt_compile" 2>out/conftest.err)
      ac_status=$?
      cat out/conftest.err >&5
  -   echo "$as_me:15774: \$? = $ac_status" >&5
  +   echo "$as_me:15769: \$? = $ac_status" >&5
      if (exit $ac_status) && test -s out/conftest2.$ac_objext
      then
        # The compiler can only warn and ignore the option if not recognized
  @@ -16983,7 +16978,7 @@
   JAVA_TEST=Test.java
   CLASS_TEST=Test.class
   cat << \EOF > $JAVA_TEST
  -/* #line 16986 "configure" */
  +/* #line 16981 "configure" */
   public class Test {
   }
   EOF
  @@ -17246,7 +17241,7 @@
   if uudecode$EXEEXT Test.uue; then
           ac_cv_prog_uudecode_base64=yes
   else
  -        echo "configure: 17249: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
  +        echo "configure: 17244: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
           echo "configure: failed file was:" >&5
           cat Test.uue >&5
           ac_cv_prog_uudecode_base64=no
  @@ -17364,7 +17359,7 @@
   JAVA_TEST=Test.java
   CLASS_TEST=Test.class
   cat << \EOF > $JAVA_TEST
  -/* #line 17367 "configure" */
  +/* #line 17362 "configure" */
   public class Test {
   }
   EOF
  @@ -17399,7 +17394,7 @@
   CLASS_TEST=Test.class
   TEST=Test
   cat << \EOF > $JAVA_TEST
  -/* [#]line 17402 "configure" */
  +/* [#]line 17397 "configure" */
   public class Test {
   public static void main (String args[]) {
           System.exit (0);
  @@ -22904,7 +22899,7 @@
   fi
   
   # The DBM API can be disabled.
  -if test "$db_cv_build_dbm" = "yes"; then
  +if test "$db_cv_dbm" = "yes"; then
   	$as_echo "#define HAVE_DBM 1" >>confdefs.h
   
   
  @@ -23486,7 +23481,7 @@
   # report actual input values of CONFIG_FILES etc. instead of their
   # values after options handling.
   ac_log="
  -This file was extended by Berkeley DB $as_me 5.0.21, which was
  +This file was extended by Berkeley DB $as_me 5.0.26, which was
   generated by GNU Autoconf 2.65.  Invocation command line was
   
     CONFIG_FILES    = $CONFIG_FILES
  @@ -23552,7 +23547,7 @@
   cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
   ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
   ac_cs_version="\\
  -Berkeley DB config.status 5.0.21
  +Berkeley DB config.status 5.0.26
   configured by $0, generated by GNU Autoconf 2.65,
     with options \\"\$ac_cs_config\\"
   
  @@ .
  patch -p0 <<'@@ .'
  Index: db/dist/configure.ac
  ============================================================================
  $ cvs diff -u -r1.17 -r1.18 configure.ac
  --- db/dist/configure.ac	1 Apr 2010 16:03:51 -0000	1.17
  +++ db/dist/configure.ac	21 Aug 2010 20:50:26 -0000	1.18
  @@ -972,7 +972,7 @@
   fi
   
   # The DBM API can be disabled.
  -if test "$db_cv_build_dbm" = "yes"; then
  +if test "$db_cv_dbm" = "yes"; then
   	AC_DEFINE(HAVE_DBM)
   	AH_TEMPLATE(HAVE_DBM, [Define to 1 if building the DBM API.])
   	ADDITIONAL_OBJS="$ADDITIONAL_OBJS dbm${o} hsearch${o}"
  @@ .
  patch -p0 <<'@@ .'
  Index: db/dist/s_crypto
  ============================================================================
  $ cvs diff -u -r1.8 -r1.9 s_crypto
  --- db/dist/s_crypto	1 Apr 2010 16:03:51 -0000	1.8
  +++ db/dist/s_crypto	21 Aug 2010 20:50:26 -0000	1.9
  @@ -45,6 +45,20 @@
    echo 'w' &&
    echo 'q') | ed $f
   
  +# Change out crypto/crypto.c for common/crypto_stub.c, remove all other
  +# references to crypto files.
  +f=win_projects/projects.template.xml
  +chmod 664 $f
  +(echo '/crypto\/crypto\.c/' &&
  + echo 'c' &&
  + echo '      <file name="common/crypto_stub.c"/>' &&
  + echo '.' &&
  + echo 'g/"crypto\//d' &&
  + echo "s/\$/ $r/" &&
  + echo ',' &&
  + echo 'w' &&
  + echo 'q') | ed $f
  +
    sh ./s_windows
    sh ./s_windows_dsp
   
  @@ .
  patch -p0 <<'@@ .'
  Index: db/dist/s_winmsi
  ============================================================================
  $ cvs diff -u -r1.7 -r1.8 s_winmsi
  --- db/dist/s_winmsi	1 Apr 2010 16:03:51 -0000	1.7
  +++ db/dist/s_winmsi	21 Aug 2010 20:50:26 -0000	1.8
  @@ -75,11 +75,6 @@
   StageRuntimeComponents
   
   #
  -# Copy dependent system libraries to build for packaging
  -#
  -CreateWindowsSystem
  -
  -#
   # Build the license file as rtf
   #
   CreateLicenseRtf ../LICENSE License.rtf
  @@ .
  patch -p0 <<'@@ .'
  Index: db/dist/winmsi/s_winmsi.fcn
  ============================================================================
  $ cvs diff -u -r1.6 -r1.7 s_winmsi.fcn
  --- db/dist/winmsi/s_winmsi.fcn	1 Apr 2010 16:03:57 -0000	1.6
  +++ db/dist/winmsi/s_winmsi.fcn	21 Aug 2010 20:50:27 -0000	1.7
  @@ -174,27 +174,32 @@
       RequireFileInPath PATH "$PATH" php.exe
   }
   
  -CreateWindowsSystem() {
  -    local here=`pwd`
  -    Progress "Copy Window system files..."
  -    cd "${PRODUCT_BLDDIR}"
  -
  -    if [ -f "$VS80COMNTOOLS/vsvars32.bat" ]; then
  -	VSTOOLS="$VS80COMNTOOLS"
  -    elif [ -f  "$VS90COMNTOOLS/vsvars32.bat" ]; then
  -	VSTOOLS="$VS90COMNTOOLS"
  -    else
  -	echo "Cannot find Visual Stdio, exiting"
  -	exit
  -    fi
  -    echo found VS at "$VSTOOLS"
  -    find "$VSTOOLS\\..\\.." -name "msvc*0.dll" -exec cp {} stage/bin \;
  -    # add to group files
  -    cd stage
  -    find bin -name "msvc*" >> $group_runtime
  -    cd ..
  -
  -    cd $here
  +#
  +# Locate the Merge Modules for Visual Studio.  This MUST
  +# change if/when the default compiler is changed to a
  +# newer version.  What will change is the registry key
  +# being used as well as the file name (*.msm) to match
  +# the new version.
  +#
  +FindMergeModules() {
  +    Progress "Adding redistributable Visual Studio files..."
  +    tscript=cmd$$a.cmd
  +    tsed=sed$$a.sed
  +    rm -f $tscript $tscript.out $tsed
  +
  +    # this short script removes leading/trailing spaces and turns
  +    # '\' into '\\' in the path so *nix scripting and sed work
  +    echo "s/\\\\/\\\\\\\\/g;s/^[ \\t]*//;s/[ \\t]*$//" > $tsed
  +
  +    # Query for location of VS Merge Module for CRT
  +    # and return it to replace @MERGE_MODULES_LOCATION@ in db.wxs
  +    echo "@echo off"                               > $tscript
  +    echo "set DBROOTDIR="                         >> $tscript
  +    echo "for /F \"tokens=2* skip=2\" %%a in ('reg query \"HKLM\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VS\" /v MSMDir') do echo  %%b >> $tscript.out" >> $tscript
  +    cmd /c $tscript
  +    TLOC=`sed -f $tsed < $tscript.out`
  +    MERGE_MODULES_LOCATION=${TLOC}Microsoft_VC80_CRT_x86.msm
  +    rm -f $tscript $tscript.out $tsed
   }
   
   BuildProduct() {
  @@ -525,10 +530,13 @@
       mkdir wix 2>/dev/null
       cd wix
   
  +    FindMergeModules
  +    echo "MERGE: $MERGE_MODULES_LOCATION"
  +
       # copy/edit .wxs files to here
       # use pattern that is *NOT* in lib_paths.sed to keep it intact
       for i in db.wxs links_frag.wxs required_frag.wxs; do
  -    	sed -e"s:@PRODUCT_NAME@:$PRODUCT_NAME:g" -e"s:@PROD_WIX_VERSION@:$PRODUCT_VERSION:g" -e"s:@PROD_DB_VERSION@:$DB_VERSION:g" -e"s:@REG_KEY_VERSION@:$REG_KEY_VERSION:g" -e"s:@REG_KEY_NAME@:$REG_KEY_NAME:g" -e"s:@PROD_WIX_VERSION_MIN@:$PRODUCT_VERSION_MAJOR.$PRODUCT_VERSION_MINOR.0:g " -e"s:@PRODUCT_MAJOR@:$PRODUCT_VERSION_MAJOR:g" -e"s:@PRODUCT_MINOR@:$PRODUCT_VERSION_MINOR:g" ${DIST_DIR}/winmsi/$i > ./$i
  +    	sed -e"s:@PRODUCT_NAME@:$PRODUCT_NAME:g" -e"s:@PROD_WIX_VERSION@:$PRODUCT_VERSION:g" -e"s:@PROD_DB_VERSION@:$DB_VERSION:g" -e"s:@REG_KEY_VERSION@:$REG_KEY_VERSION:g" -e"s:@REG_KEY_NAME@:$REG_KEY_NAME:g" -e"s:@PROD_WIX_VERSION_MIN@:$PRODUCT_VERSION_MAJOR.$PRODUCT_VERSION_MINOR.0:g " -e"s:@PRODUCT_MAJOR@:$PRODUCT_VERSION_MAJOR:g" -e"s:@PRODUCT_MINOR@:$PRODUCT_VERSION_MINOR:g" -e"s/@MERGE_MODULES_LOCATION@/$MERGE_MODULES_LOCATION/g" ${DIST_DIR}/winmsi/$i > ./$i
       done
       for i in db_components.wxs; do
       	sed -e"s:@PRODUCT_NAME@:$PRODUCT_NAME:g" -e"s:@PROD_WIX_VERSION@:$PRODUCT_VERSION:g" -e"s:@PROD_WIX_VERSION_SHORT@:$PRODUCT_VERSION_MAJOR.$PRODUCT_VERSION_MINOR.$PRODUCT_VERSION_PATCH:g" -e"s:@PROD_WIX_VERSION_MIN@:$PRODUCT_VERSION_MAJOR.$PRODUCT_VERSION_MINOR.0:g" -e"s:@PRODUCT_MAJOR@:$PRODUCT_VERSION_MAJOR:g" -e"s:@PRODUCT_MINOR@:$PRODUCT_VERSION_MINOR:g" ../scripts/$i > ./$i
  @@ .
  patch -p0 <<'@@ .'
  Index: db/env/env_open.c
  ============================================================================
  $ cvs diff -u -r1.12 -r1.13 env_open.c
  --- db/env/env_open.c	1 Apr 2010 16:04:00 -0000	1.12
  +++ db/env/env_open.c	21 Aug 2010 20:50:27 -0000	1.13
  @@ -426,11 +426,11 @@
   	DB_THREAD_INFO *ip;
   	ENV *env;
   	int rep_check, ret, t_ret;
  -	u_int32_t close_flags;
  +	u_int32_t close_flags, flags_orig;
   
   	env = dbenv->env;
   	ret = 0;
  -	close_flags = 0;
  +	close_flags = flags_orig = 0;
   
   	/*
   	 * Validate arguments, but as a DB_ENV handle destructor, we can't
  @@ -452,8 +452,17 @@
   	if (PANIC_ISSET(env)) {
   		/* clean up from registry file */
   		if (dbenv->registry != NULL) {
  +			/*
  +			 * Temporarily set no panic so we do not trigger the
  +			 * LAST_PANIC_CHECK_BEFORE_IO check in __os_physwrite
  +			 * thus allowing the unregister to happen correctly.
  +			 */
  +			flags_orig = F_ISSET(dbenv, DB_ENV_NOPANIC);
  +			F_SET(dbenv, DB_ENV_NOPANIC);
   			(void)__envreg_unregister(env, 0);
   			dbenv->registry = NULL;
  +			if (!flags_orig)
  +				F_CLR(dbenv, DB_ENV_NOPANIC);
   		}
   
   		/* Close all underlying file handles. */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/env/env_recover.c
  ============================================================================
  $ cvs diff -u -r1.12 -r1.13 env_recover.c
  --- db/env/env_recover.c	1 Apr 2010 16:04:00 -0000	1.12
  +++ db/env/env_recover.c	21 Aug 2010 20:50:27 -0000	1.13
  @@ -56,6 +56,7 @@
   	DB_ENV *dbenv;
   	DB_LOGC *logc;
   	DB_LSN ckp_lsn, first_lsn, last_lsn, lowlsn, lsn, stop_lsn, tlsn;
  +	DB_LSN *vtrunc_ckp, *vtrunc_lsn;
   	DB_TXNHEAD *txninfo;
   	DB_TXNREGION *region;
   	REGENV *renv;
  @@ -65,7 +66,7 @@
   	double nfiles;
   	u_int32_t hi_txn, log_size, txnid;
   	int32_t low;
  -	int have_rec, progress, ret, t_ret;
  +	int all_recovered, have_rec, progress, ret, t_ret;
   	char *p, *pass;
   	char t1[CTIME_BUFLEN], t2[CTIME_BUFLEN], time_buf[CTIME_BUFLEN];
   
  @@ -372,8 +373,10 @@
   		goto err;
   
   	/* If there were no transactions, then we can bail out early. */
  -	if (hi_txn == 0 && max_lsn == NULL)
  +	if (hi_txn == 0 && max_lsn == NULL) {
  +		lsn = last_lsn;
   		goto done;
  +	}
   
   	/*
   	 * Pass #2.
  @@ -467,45 +470,76 @@
   	if (max_lsn == NULL)
   		region->last_txnid = ((DB_TXNHEAD *)txninfo)->maxid;
   
  -	if (dbenv->tx_timestamp != 0) {
  -		/* We are going to truncate, so we'd best close the cursor. */
  -		if (logc != NULL) {
  -			if ((ret = __logc_close(logc)) != 0)
  -				goto err;
  -			logc = NULL;
  -		}
  -
  -		/*
  -		 * Flush everything to disk, we are losing the log.  It's
  -		 * recovery, ignore any application max-write configuration.
  -		 */
  -		if ((ret = __memp_sync_int(env, NULL, 0,
  -		    DB_SYNC_CACHE | DB_SYNC_SUPPRESS_WRITE, NULL, NULL)) != 0)
  +done:
  +	/* We are going to truncate, so we'd best close the cursor. */
  +	if (logc != NULL) {
  +		if ((ret = __logc_close(logc)) != 0)
   			goto err;
  +		logc = NULL;
  +	}
  +	/*
  +	 * Also flush the cache before truncating the log. It's recovery,
  +	 * ignore any application max-write configuration.
  +	 */
  +	if ((ret = __memp_sync_int(env,
  +	    NULL, 0, DB_SYNC_CACHE | DB_SYNC_SUPPRESS_WRITE, NULL, NULL)) != 0)
  +		goto err;
  +	if (dbenv->tx_timestamp != 0) {
  +		/* Run recovery up to this timestamp. */
   		region->last_ckp = ((DB_TXNHEAD *)txninfo)->ckplsn;
  -		if ((ret = __log_vtruncate(env,
  -		    &((DB_TXNHEAD *)txninfo)->maxlsn,
  -		    &((DB_TXNHEAD *)txninfo)->ckplsn, trunclsn)) != 0)
  +		vtrunc_lsn = &((DB_TXNHEAD *)txninfo)->maxlsn;
  +		vtrunc_ckp = &((DB_TXNHEAD *)txninfo)->ckplsn;
  +	} else if (max_lsn != NULL) {
  +		/* This is a HA client syncing to the master. */
  +		if (!IS_ZERO_LSN(((DB_TXNHEAD *)txninfo)->ckplsn))
  +			region->last_ckp = ((DB_TXNHEAD *)txninfo)->ckplsn;
  +		else if ((ret =
  +		    __txn_findlastckp(env, &region->last_ckp, max_lsn)) != 0)
   			goto err;
  +		vtrunc_lsn = max_lsn;
  +		vtrunc_ckp = &((DB_TXNHEAD *)txninfo)->ckplsn;
  +	} else {
  +		/*
  +		 * The usual case: we recovered the whole (valid) log; clear
  +		 * out any partial record after the recovery point.
  +		 */
  +		vtrunc_lsn = &lsn;
  +		vtrunc_ckp = &region->last_ckp;
   	}
  +	if ((ret = __log_vtruncate(env, vtrunc_lsn, vtrunc_ckp, trunclsn)) != 0)
  +		goto err;
   
  -done:
  -	/* Take a checkpoint here to force any dirty data pages to disk. */
  -	if ((ret = __txn_checkpoint(env, 0, 0,
  -	    DB_CKP_INTERNAL | DB_FORCE)) != 0) {
  +	/*
  +	 * Usually we close all files at the end of recovery, unless there are
  +	 * prepared transactions or errors in the checkpoint.
  +	 */
  +	all_recovered = region->stat.st_nrestores == 0;
  +	/*
  +	 * Log a checkpoint here so subsequent recoveries can skip what's been
  +	 * done; this is unnecessary for HA rep clients, as they do not write
  +	 * log records.
  +	 */
  +	if (max_lsn == NULL && (ret = __txn_checkpoint(env,
  +	    0, 0, DB_CKP_INTERNAL | DB_FORCE)) != 0) {
   		/*
  -		 * If there was no space for the checkpoint we can
  -		 * still bring the environment up.  No updates will
  -		 * be able to commit either, but the environment can
  -		 * be used read only.
  +		 * If there was no space for the checkpoint or flushng db
  +		 * pages we can still bring the environment up, if only for
  +		 * read-only access. We must not close the open files because a
  +		 * subsequent recovery might still need to redo this portion
  +		 * of the log [#18590].
   		 */
  -		if (max_lsn == NULL && ret == ENOSPC)
  -			ret = 0;
  +		if (max_lsn == NULL && ret == ENOSPC) {
  +			if (FLD_ISSET(dbenv->verbose, DB_VERB_RECOVERY))
  +				__db_msg(env,
  +		    "Recovery continuing after non-fatal checkpoint error: %s",
  +				    db_strerror(ret));
  +			all_recovered = 0;
  +		}
   		else
   			goto err;
   	}
   
  -	if (region->stat.st_nrestores == 0) {
  +	if (all_recovered ) {
   		/* Close all the db files that are open. */
   		if ((ret = __dbreg_close_files(env, 0)) != 0)
   			goto err;
  @@ -516,20 +550,6 @@
   	}
   
   	if (max_lsn != NULL) {
  -		if (!IS_ZERO_LSN(((DB_TXNHEAD *)txninfo)->ckplsn))
  -			region->last_ckp = ((DB_TXNHEAD *)txninfo)->ckplsn;
  -		else if ((ret =
  -		    __txn_findlastckp(env, &region->last_ckp, max_lsn)) != 0)
  -			goto err;
  -
  -		/* We are going to truncate, so we'd best close the cursor. */
  -		if (logc != NULL && (ret = __logc_close(logc)) != 0)
  -			goto err;
  -		logc = NULL;
  -		if ((ret = __log_vtruncate(env,
  -		    max_lsn, &((DB_TXNHEAD *)txninfo)->ckplsn, trunclsn)) != 0)
  -			goto err;
  -
   		/*
   		 * Now we need to open files that should be open in order for
   		 * client processing to continue.  However, since we've
  @@ -565,10 +585,12 @@
   		if ((ret = __env_openfiles(env, logc,
   		    txninfo, &data, &first_lsn, max_lsn, nfiles, 1)) != 0)
   			goto err;
  -	} else if (region->stat.st_nrestores == 0) {
  +	} else if (all_recovered) {
   		/*
  -		 * If there are no prepared transactions that need resolution,
  -		 * we need to reset the transaction ID space and log this fact.
  +		 * If there are no transactions that need resolution, whether
  +		 * because they are prepared or because recovery will need to
  +		 * process them, we need to reset the transaction ID space and
  +		 * log this fact.
   		 */
   		if ((ret = __txn_reset(env)) != 0)
   			goto err;
  @@ -577,26 +599,6 @@
   			goto err;
   	}
   
  -	/*
  -	 * We must be sure to zero the tail of the log.  Otherwise a partial
  -	 * record may be at the end of the log and it may never be fully
  -	 * overwritten.
  -	 */
  -	if (max_lsn == NULL && dbenv->tx_timestamp == 0) {
  -		/* We are going to truncate, so we'd best close the cursor. */
  -		if (logc != NULL && (ret = __logc_close(logc)) != 0)
  -			goto err;
  -		logc = NULL;
  -
  -		/* Truncate from beyond the last record in the log. */
  -		if ((ret =
  -		    __log_current_lsn(env, &last_lsn, NULL, NULL)) != 0)
  -			goto err;
  -		if ((ret = __log_vtruncate(env,
  -		    &last_lsn, &region->last_ckp, NULL)) != 0)
  -			goto err;
  -	}
  -
   	if (FLD_ISSET(dbenv->verbose, DB_VERB_RECOVERY)) {
   		(void)time(&now);
   		__db_msg(env,
  @@ .
  patch -p0 <<'@@ .'
  Index: db/hash/hash_dup.c
  ============================================================================
  $ cvs diff -u -r1.12 -r1.13 hash_dup.c
  --- db/hash/hash_dup.c	1 Apr 2010 16:04:15 -0000	1.12
  +++ db/hash/hash_dup.c	21 Aug 2010 20:50:27 -0000	1.13
  @@ -225,6 +225,7 @@
   		case DB_KEYFIRST:
   		case DB_KEYLAST:
   		case DB_NODUPDATA:
  +		case DB_OVERWRITE_DUP:
   			hcp->dup_tlen += (db_indx_t)DUP_SIZE(nval->size);
   			hcp->dup_len = nval->size;
   			break;
  @@ .
  patch -p0 <<'@@ .'
  Index: db/java/src/com/sleepycat/db/DatabaseConfig.java
  ============================================================================
  $ cvs diff -u -r1.11 -r1.12 DatabaseConfig.java
  --- db/java/src/com/sleepycat/db/DatabaseConfig.java	1 Apr 2010 16:04:22 -0000	1.11
  +++ db/java/src/com/sleepycat/db/DatabaseConfig.java	21 Aug 2010 20:50:28 -0000	1.12
  @@ -2245,7 +2245,7 @@
           reverseSplitOff = (dbFlags & DbConstants.DB_REVSPLITOFF) != 0;
           sortedDuplicates = (dbFlags & DbConstants.DB_DUPSORT) != 0;
           snapshot = (dbFlags & DbConstants.DB_SNAPSHOT) != 0;
  -        unsortedDuplicates = (dbFlags & DbConstants.DB_DUP) != 0;
  +        unsortedDuplicates = !sortedDuplicates && ((dbFlags & DbConstants.DB_DUP) != 0);
           transactionNotDurable = (dbFlags & DbConstants.DB_TXN_NOT_DURABLE) != 0;
   
           if (type == DatabaseType.BTREE) {
  @@ -2263,6 +2263,7 @@
               hashNumElements = db.get_h_nelem();
           }
           messageStream = db.get_message_stream();
  +        pageSize = db.get_pagesize();
           // Not available by design
           password = ((dbFlags & DbConstants.DB_ENCRYPT) != 0) ? "" : null;
           priority = CacheFilePriority.fromFlag(db.get_priority());
  @@ .
  patch -p0 <<'@@ .'
  Index: db/java/src/com/sleepycat/db/internal/DbConstants.java
  ============================================================================
  $ cvs diff -u -r1.16 -r1.17 DbConstants.java
  --- db/java/src/com/sleepycat/db/internal/DbConstants.java	1 Apr 2010 16:04:27 -0000	1.16
  +++ db/java/src/com/sleepycat/db/internal/DbConstants.java	21 Aug 2010 20:50:28 -0000	1.17
  @@ -230,7 +230,7 @@
       int DB_VERIFY = 0x00000002;
       int DB_VERSION_MAJOR = 5;
       int DB_VERSION_MINOR = 0;
  -    int DB_VERSION_PATCH = 21;
  +    int DB_VERSION_PATCH = 26;
       int DB_WRITECURSOR = 0x00000008;
       int DB_YIELDCPU = 0x00010000;
   }
  @@ .
  patch -p0 <<'@@ .'
  Index: db/java/src/com/sleepycat/persist/raw/RawType.java
  ============================================================================
  $ cvs diff -u -r1.4 -r1.5 RawType.java
  --- db/java/src/com/sleepycat/persist/raw/RawType.java	1 Apr 2010 16:04:33 -0000	1.4
  +++ db/java/src/com/sleepycat/persist/raw/RawType.java	21 Aug 2010 20:50:28 -0000	1.5
  @@ -54,9 +54,9 @@
       int getId();
   
       /**
  -     * Returns whether this is a {@link <a
  -     * href="../model/Entity.html#simpleTypes">simple type</a>}: primitive,
  -     * primitive wrapper, BigInteger, String or Date.
  +     * Returns whether this is a 
  +     * {@link simple type}: 
  +     * primitive, primitive wrapper, BigInteger, String or Date.
        * <!--
        * primitive wrapper, BigInteger, BigDecimal, String or Date.
        * -->
  @@ .
  patch -p0 <<'@@ .'
  Index: db/libdb_java/db_java_wrap.c
  ============================================================================
  $ cvs diff -u -r1.14 -r1.15 db_java_wrap.c
  --- db/libdb_java/db_java_wrap.c	1 Apr 2010 16:04:34 -0000	1.14
  +++ db/libdb_java/db_java_wrap.c	21 Aug 2010 20:50:29 -0000	1.15
  @@ -2374,6 +2374,9 @@
   		(*jenv)->DeleteLocalRef(jenv, jdataarr);
   		(*jenv)->DeleteLocalRef(jenv, jdata);
   	}
  +	if (jskeys != NULL) {
  +		(*jenv)->DeleteLocalRef(jenv, jskeys);
  +	}
   
   	if (detach)
   		__dbj_detach();
  @@ .
  patch -p0 <<'@@ .'
  Index: db/libdb_java/java_callbacks.i
  ============================================================================
  $ cvs diff -u -r1.11 -r1.12 java_callbacks.i
  --- db/libdb_java/java_callbacks.i	1 Apr 2010 16:04:35 -0000	1.11
  +++ db/libdb_java/java_callbacks.i	21 Aug 2010 20:50:29 -0000	1.12
  @@ -446,6 +446,9 @@
   		(*jenv)->DeleteLocalRef(jenv, jdataarr);
   		(*jenv)->DeleteLocalRef(jenv, jdata);
   	}
  +	if (jskeys != NULL) {
  +		(*jenv)->DeleteLocalRef(jenv, jskeys);
  +	}
   
   	if (detach)
   		__dbj_detach();
  @@ .
  patch -p0 <<'@@ .'
  Index: db/log/log_put.c
  ============================================================================
  $ cvs diff -u -r1.15 -r1.16 log_put.c
  --- db/log/log_put.c	1 Apr 2010 16:04:36 -0000	1.15
  +++ db/log/log_put.c	21 Aug 2010 20:50:29 -0000	1.16
  @@ -480,8 +480,11 @@
   {
   	DB_LOG *dblp;
   	DB_LSN flush_lsn;
  +	HDR hdr;
   	LOG *lp;
  -	int ret;
  +	int ret, t_ret;
  +	size_t nr, nw;
  +	u_int8_t *buffer;
   
   	dblp = env->lg_handle;
   	lp = dblp->reginfo.primary;
  @@ -512,7 +515,10 @@
   	if (ret == 0 || !LF_ISSET(DB_LOG_COMMIT))
   		return (ret);
   
  -	if (flush_lsn.file != lp->lsn.file || flush_lsn.offset < lp->w_off)
  +	if (LF_ISSET(DB_FLUSH) ? 
  +	    flush_lsn.file != lp->s_lsn.file ||
  +	    flush_lsn.offset < lp->s_lsn.offset :
  +	    flush_lsn.file != lp->lsn.file || flush_lsn.offset < lp->w_off)
   		return (0);
   
   	/*
  @@ -525,9 +531,45 @@
   	 * interesting part of the buffer may have actually made it out to
   	 * disk before there was a failure, we can't know for sure.
   	 */
  -	if (__txn_force_abort(env,
  -	    dblp->bufp + flush_lsn.offset - lp->w_off) == 0)
  -		(void)__log_flush_int(dblp, &flush_lsn, 0);
  +	if (flush_lsn.offset > lp->w_off) {
  +		if ((t_ret = __txn_force_abort(env,
  +		     dblp->bufp + flush_lsn.offset - lp->w_off)) != 0)
  +		     	return (__env_panic(env, t_ret));
  +	} else {
  +		/*
  +		 * The buffer was written, but its not on disk, we
  +		 * must read it back and force things from a commit
  +		 * state to an abort state.  Lots of things could fail
  +		 * here and we will be left with a commit record but
  +		 * a panic return.
  +		 */
  +		 if (
  +		    (t_ret = __os_seek(env,
  +		    dblp->lfhp, 0, 0, flush_lsn.offset)) != 0 ||
  +		    (t_ret = __os_read(env, dblp->lfhp, &hdr,
  +		    HDR_NORMAL_SZ, &nr)) != 0 || nr != HDR_NORMAL_SZ)
  +			return (__env_panic(env, t_ret == 0 ? EIO : t_ret));
  +		if (LOG_SWAPPED(env))
  +			__log_hdrswap(&hdr, CRYPTO_ON(env));
  +		if ((t_ret = __os_malloc(env, hdr.len, &buffer)) != 0 ||
  +		    (t_ret = __os_seek(env,
  +		    dblp->lfhp, 0, 0, flush_lsn.offset)) != 0 ||
  +		    (t_ret = __os_read(env, dblp->lfhp, buffer,
  +		    hdr.len, &nr)) != 0 || nr != hdr.len ||
  +		    (t_ret = __txn_force_abort(env, buffer)) != 0 ||
  +		    (t_ret = __os_seek(env,
  +		    dblp->lfhp, 0, 0, flush_lsn.offset)) != 0 ||
  +		    (t_ret = __os_write(env, dblp->lfhp, buffer,
  +		    nr, &nw)) != 0 || nw != nr)
  +			return (__env_panic(env, t_ret == 0 ? EIO : t_ret));
  +		__os_free(env, buffer);
  +	}
  + 	/*
  + 	 * Try to flush the log again, if the disk just bounced then we
  + 	 * want to be sure it does not go away again before we write the
  + 	 * abort record.
  + 	 */
  + 	(void)__log_flush_int(dblp, &flush_lsn, 0);
   
   	return (ret);
   }
  @@ -1041,8 +1083,8 @@
   		MUTEX_UNLOCK(env, lp->mtx_flush);
   		if (release)
   			LOG_SYSTEM_LOCK(env);
  -		ret = __env_panic(env, ret);
  -		return (ret);
  +		lp->in_flush--;
  +		goto done;
   	}
   
   	/*
  @@ -1687,7 +1729,7 @@
   {
   	DBT *data, *dbt, *header, logrec;
   	DB_LOG_RECSPEC *sp;
  -	DB_LSN *lsnp, null_lsn, *pagelsn, *rlsnp;
  +	DB_LSN *lsnp, lsn, null_lsn, *pagelsn, *rlsnp;
   	DB_TXNLOGREC *lr;
   	LOG *lp;
   	PAGE *pghdrstart;
  @@ -1704,7 +1746,17 @@
   	COMPQUIET(pghdrstart, NULL);
   	COMPQUIET(header, NULL);
   
  -	rlsnp = ret_lsnp;
  +	/*
  +	 * rlsnp will be stored into while holding the log system lock.
  +	 * If this is a commit record then ret_lsnp will be the address of
  +	 * the transaction detail visible_lsn field.  If not then this
  +	 * may be the lsn of a page and we do not want to set it if
  +	 * the log_put fails after writing the record (due to an I/O error).
  +	 */
  +	if (LF_ISSET(DB_LOG_COMMIT))
  +		rlsnp = ret_lsnp;
  +	else
  +		rlsnp = &lsn;
   	npad = 0;
   	ret = 0;
   	data = NULL;
  @@ -1908,10 +1960,10 @@
   
   	if (is_durable || txnp == NULL) {
   		if ((ret = __log_put(env, rlsnp,(DBT *)&logrec,
  -		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
  -			*lsnp = *rlsnp;
  -			if (rlsnp != ret_lsnp)
  -				 *ret_lsnp = *rlsnp;
  +		    flags | DB_LOG_NOCOPY)) == 0) {
  +			if (txnp != NULL)
  +				*lsnp = *rlsnp;
  +			*ret_lsnp = *rlsnp;
   		}
   	} else {
   		ret = 0;
  @@ .
  patch -p0 <<'@@ .'
  Index: db/mp/mp_alloc.c
  ============================================================================
  $ cvs diff -u -r1.12 -r1.13 mp_alloc.c
  --- db/mp/mp_alloc.c	1 Apr 2010 16:04:38 -0000	1.12
  +++ db/mp/mp_alloc.c	21 Aug 2010 20:50:29 -0000	1.13
  @@ -63,7 +63,7 @@
   	 * before free-ing and re-allocating buffers.
   	 */
   	if (mfp != NULL) {
  -		len = SSZA(BH, buf) + mfp->stat.st_pagesize;
  +		len = SSZA(BH, buf) + mfp->pagesize;
   		/* Add space for alignment padding for MVCC diagnostics. */
   		MVCC_BHSIZE(mfp, len);
   	}
  @@ -74,7 +74,7 @@
   	 * Anything newer than 1/10th of the buffer pool is ignored during
   	 * allocation (unless allocation starts failing).
   	 */
  -	high_priority = c_mp->lru_count - c_mp->stat.st_pages / 10;
  +	high_priority = c_mp->lru_count - c_mp->pages / 10;
   
   	/*
   	 * First we try to allocate from free memory.  If that fails, scan the
  @@ -100,7 +100,7 @@
   				__env_alloc_free(infop, bhp);
   				goto search;
   			}
  -			c_mp->stat.st_pages++;
  +			c_mp->pages++;
   		}
   		MPOOL_REGION_UNLOCK(env, infop);
   found:		if (offsetp != NULL)
  @@ -127,7 +127,7 @@
   		}
   #endif
   		return (0);
  -	} else if (giveup || c_mp->stat.st_pages == 0) {
  +	} else if (giveup || c_mp->pages == 0) {
   		MPOOL_REGION_UNLOCK(env, infop);
   
   		__db_errx(env,
  @@ -151,7 +151,7 @@
   	 */
   	for (;;) {
   		/* All pages have been freed, make one last try */
  -		if (c_mp->stat.st_pages == 0)
  +		if (c_mp->pages == 0)
   			goto alloc;
   
   		/* Check for wrap around. */
  @@ -448,8 +448,7 @@
   				if (aggressive ||
   				    bhp->priority < c_mp->lru_count)
   					bhp->priority = c_mp->lru_count +
  -					     c_mp->stat.st_pages /
  -					     MPOOL_PRI_DIRTY;
  +					     c_mp->pages / MPOOL_PRI_DIRTY;
   
   				goto next_hb;
   			}
  @@ -552,7 +551,7 @@
   			b_lock = 0;
   			h_locked = 0;
   
  -			MVCC_MPROTECT(bhp->buf, bh_mfp->stat.st_pagesize,
  +			MVCC_MPROTECT(bhp->buf, bh_mfp->pagesize,
   			    PROT_READ | PROT_WRITE | PROT_EXEC);
   
   			MPOOL_REGION_LOCK(env, infop);
  @@ -560,7 +559,7 @@
   			    (BH_FROZEN_ALLOC *)bhp, links);
   			frozen_bhp = (BH_FROZEN_PAGE *)
   			    ((BH_FROZEN_ALLOC *)bhp + 1);
  -			endp = (u_int8_t *)bhp->buf + bh_mfp->stat.st_pagesize;
  +			endp = (u_int8_t *)bhp->buf + bh_mfp->pagesize;
   			while ((u_int8_t *)(frozen_bhp + 1) < endp) {
   				frozen_bhp->header.mtx_buf = MUTEX_INVALID;
   				SH_TAILQ_INSERT_TAIL(&c_mp->free_frozen,
  @@ -581,7 +580,7 @@
   		 * and its space and keep looking.
   		 */
   		if (mfp != NULL &&
  -		    mfp->stat.st_pagesize == bh_mfp->stat.st_pagesize) {
  +		    mfp->pagesize == bh_mfp->pagesize) {
   			if ((ret = __memp_bhfree(dbmp,
   			     infop, bh_mfp, hp, bhp, 0)) != 0)
   				return (ret);
  @@ -589,7 +588,7 @@
   			goto found;
   		}
   
  -		freed_space += sizeof(*bhp) + bh_mfp->stat.st_pagesize;
  +		freed_space += sizeof(*bhp) + bh_mfp->pagesize;
   		if ((ret =
   		    __memp_bhfree(dbmp, infop,
   			 bh_mfp, hp, bhp, BH_FREE_FREEMEM)) != 0)
  @@ .
  patch -p0 <<'@@ .'
  Index: db/mp/mp_bh.c
  ============================================================================
  $ cvs diff -u -r1.15 -r1.16 mp_bh.c
  --- db/mp/mp_bh.c	1 Apr 2010 16:04:38 -0000	1.15
  +++ db/mp/mp_bh.c	21 Aug 2010 20:50:29 -0000	1.16
  @@ -149,7 +149,7 @@
   	if ((ret = __memp_fcreate(env, &dbmfp)) != 0)
   		return (ret);
   	if ((ret = __memp_fopen(dbmfp, mfp,
  -	    NULL, NULL, DB_DURABLE_UNKNOWN, 0, mfp->stat.st_pagesize)) != 0) {
  +	    NULL, NULL, DB_DURABLE_UNKNOWN, 0, mfp->pagesize)) != 0) {
   		(void)__memp_fclose(dbmfp, 0);
   
   		/*
  @@ -163,7 +163,7 @@
   	}
   
   pgwrite:
  -	MVCC_MPROTECT(bhp->buf, mfp->stat.st_pagesize,
  +	MVCC_MPROTECT(bhp->buf, mfp->pagesize,
   	    PROT_READ | PROT_WRITE | PROT_EXEC);
   	ret = __memp_pgwrite(env, dbmfp, hp, bhp);
   	if (dbmfp == NULL)
  @@ -203,7 +203,7 @@
   
   	env = dbmfp->env;
   	mfp = dbmfp->mfp;
  -	pagesize = mfp->stat.st_pagesize;
  +	pagesize = mfp->pagesize;
   
   	/* We should never be called with a dirty or unlocked buffer. */
   	DB_ASSERT(env, !F_ISSET(bhp, BH_DIRTY_CREATE | BH_FROZEN));
  @@ -378,19 +378,17 @@
   		if (F_ISSET(bhp, BH_EXCLUSIVE))
   			F_SET(bhp, BH_TRASH);
   		else {
  -			if ((ret =
  -			    __os_malloc(env, mfp->stat.st_pagesize, &buf)) != 0)
  +			if ((ret = __os_malloc(env, mfp->pagesize, &buf)) != 0)
   				goto err;
  -			memcpy(buf, bhp->buf, mfp->stat.st_pagesize);
  +			memcpy(buf, bhp->buf, mfp->pagesize);
   		}
   		if ((ret = __memp_pg(dbmfp, bhp->pgno, buf, 0)) != 0)
   			goto err;
   	}
   
   	/* Write the page. */
  -	if ((ret = __os_io(
  -	    env, DB_IO_WRITE, dbmfp->fhp, bhp->pgno, mfp->stat.st_pagesize,
  -	    0, mfp->stat.st_pagesize, buf, &nw)) != 0) {
  +	if ((ret = __os_io( env, DB_IO_WRITE, dbmfp->fhp, bhp->pgno,
  +	    mfp->pagesize, 0, mfp->pagesize, buf, &nw)) != 0) {
   		__db_errx(env, "%s: write failed for page %lu",
   		    __memp_fn(dbmfp), (u_long)bhp->pgno);
   		goto err;
  @@ -538,7 +536,7 @@
   	env = dbmp->env;
   #ifdef DIAG_MVCC
   	if (mfp != NULL)
  -		pagesize = mfp->stat.st_pagesize;
  +		pagesize = mfp->pagesize;
   #endif
   
   	DB_ASSERT(env, LF_ISSET(BH_FREE_UNLOCKED) ||
  @@ -613,7 +611,7 @@
   		MVCC_BHUNALIGN(bhp);
   		__memp_free(infop, bhp);
   		c_mp = infop->primary;
  -		c_mp->stat.st_pages--;
  +		c_mp->pages--;
   
   		MPOOL_REGION_UNLOCK(env, infop);
   	}
  @@ .
  patch -p0 <<'@@ .'
  Index: db/mp/mp_fget.c
  ============================================================================
  $ cvs diff -u -r1.12 -r1.13 mp_fget.c
  --- db/mp/mp_fget.c	1 Apr 2010 16:04:38 -0000	1.12
  +++ db/mp/mp_fget.c	21 Aug 2010 20:50:30 -0000	1.13
  @@ -223,7 +223,7 @@
   	if (dbmfp->addr != NULL &&
   	    F_ISSET(mfp, MP_CAN_MMAP) && *pgnoaddr <= mfp->orig_last_pgno) {
   		*(void **)addrp = (u_int8_t *)dbmfp->addr +
  -		    (*pgnoaddr * mfp->stat.st_pagesize);
  +		    (*pgnoaddr * mfp->pagesize);
   		STAT_INC(env, mpool, map, mfp->stat.st_map);
   		return (0);
   	}
  @@ -804,15 +804,15 @@
   		 * if DB_MPOOL_CREATE is set.
   		 */
   		if (extending) {
  -			MVCC_MPROTECT(bhp->buf, mfp->stat.st_pagesize,
  +			MVCC_MPROTECT(bhp->buf, mfp->pagesize,
   			    PROT_READ | PROT_WRITE);
   			memset(bhp->buf, 0,
   			    (mfp->clear_len == DB_CLEARLEN_NOTSET) ?
  -			    mfp->stat.st_pagesize : mfp->clear_len);
  +			    mfp->pagesize : mfp->clear_len);
   #if defined(DIAGNOSTIC) || defined(UMRW)
   			if (mfp->clear_len != DB_CLEARLEN_NOTSET)
   				memset(bhp->buf + mfp->clear_len, CLEAR_BYTE,
  -				    mfp->stat.st_pagesize - mfp->clear_len);
  +				    mfp->pagesize - mfp->clear_len);
   #endif
   
   			if (flags == DB_MPOOL_CREATE && mfp->ftype != 0 &&
  @@ -911,7 +911,7 @@
   		MUTEX_REQUIRED(env, bhp->mtx_buf);
   
   		if (BH_REFCOUNT(bhp) == 1)
  -			MVCC_MPROTECT(bhp->buf, mfp->stat.st_pagesize,
  +			MVCC_MPROTECT(bhp->buf, mfp->pagesize,
   			    PROT_READ);
   
   		atomic_init(&alloc_bhp->ref, 1);
  @@ -932,22 +932,22 @@
   		} else if ((ret =
   		    __memp_bh_settxn(dbmp, mfp, alloc_bhp, td)) != 0)
   			goto err;
  -		MVCC_MPROTECT(alloc_bhp->buf, mfp->stat.st_pagesize,
  +		MVCC_MPROTECT(alloc_bhp->buf, mfp->pagesize,
   		    PROT_READ | PROT_WRITE);
   		if (extending ||
   		    F_ISSET(bhp, BH_FREED) || flags == DB_MPOOL_FREE) {
   			memset(alloc_bhp->buf, 0,
   			    (mfp->clear_len == DB_CLEARLEN_NOTSET) ?
  -			    mfp->stat.st_pagesize : mfp->clear_len);
  +			    mfp->pagesize : mfp->clear_len);
   #if defined(DIAGNOSTIC) || defined(UMRW)
   			if (mfp->clear_len != DB_CLEARLEN_NOTSET)
   				memset(alloc_bhp->buf + mfp->clear_len,
   				    CLEAR_BYTE,
  -				    mfp->stat.st_pagesize - mfp->clear_len);
  +				    mfp->pagesize - mfp->clear_len);
   #endif
   		} else
  -			memcpy(alloc_bhp->buf, bhp->buf, mfp->stat.st_pagesize);
  -		MVCC_MPROTECT(alloc_bhp->buf, mfp->stat.st_pagesize, 0);
  +			memcpy(alloc_bhp->buf, bhp->buf, mfp->pagesize);
  +		MVCC_MPROTECT(alloc_bhp->buf, mfp->pagesize, 0);
   
   		if (h_locked == 0)
   			MUTEX_LOCK(env, hp->mtx_hash);
  @@ -970,7 +970,7 @@
   		DB_ASSERT(env, b_incr && BH_REFCOUNT(bhp) > 0);
   		if (atomic_dec(env, &bhp->ref) == 0) {
   			bhp->priority = c_mp->lru_count;
  -			MVCC_MPROTECT(bhp->buf, mfp->stat.st_pagesize, 0);
  +			MVCC_MPROTECT(bhp->buf, mfp->pagesize, 0);
   		}
   		F_CLR(bhp, BH_EXCLUSIVE);
   		MUTEX_UNLOCK(env, bhp->mtx_buf);
  @@ -1017,7 +1017,7 @@
   		if (F_ISSET(bhp, BH_FREED)) {
   			memset(bhp->buf, 0,
   			    (mfp->clear_len == DB_CLEARLEN_NOTSET) ?
  -			    mfp->stat.st_pagesize : mfp->clear_len);
  +			    mfp->pagesize : mfp->clear_len);
   			F_CLR(bhp, BH_FREED);
   		}
   		if (!F_ISSET(bhp, BH_DIRTY)) {
  @@ -1051,7 +1051,7 @@
   #endif
   	}
   
  -	MVCC_MPROTECT(bhp->buf, mfp->stat.st_pagesize, PROT_READ |
  +	MVCC_MPROTECT(bhp->buf, mfp->pagesize, PROT_READ |
   	    (dirty || extending || F_ISSET(bhp, BH_DIRTY) ?
   	    PROT_WRITE : 0));
   
  @@ .
  patch -p0 <<'@@ .'
  Index: db/mp/mp_fmethod.c
  ============================================================================
  $ cvs diff -u -r1.9 -r1.10 mp_fmethod.c
  --- db/mp/mp_fmethod.c	1 Apr 2010 16:04:38 -0000	1.9
  +++ db/mp/mp_fmethod.c	21 Aug 2010 20:50:30 -0000	1.10
  @@ -330,10 +330,10 @@
   
   		MUTEX_LOCK(env, mfp->mutex);
   		*gbytesp = (u_int32_t)
  -		    (mfp->maxpgno / (GIGABYTE / mfp->stat.st_pagesize));
  +		    (mfp->maxpgno / (GIGABYTE / mfp->pagesize));
   		*bytesp = (u_int32_t)
  -		    ((mfp->maxpgno % (GIGABYTE / mfp->stat.st_pagesize)) *
  -		    mfp->stat.st_pagesize);
  +		    ((mfp->maxpgno % (GIGABYTE / mfp->pagesize)) *
  +		    mfp->pagesize);
   		MUTEX_UNLOCK(env, mfp->mutex);
   	}
   
  @@ -360,10 +360,9 @@
   
   		MUTEX_LOCK(env, mfp->mutex);
   		mfp->maxpgno = (db_pgno_t)
  -		    (gbytes * (GIGABYTE / mfp->stat.st_pagesize));
  +		    (gbytes * (GIGABYTE / mfp->pagesize));
   		mfp->maxpgno += (db_pgno_t)
  -		    ((bytes + mfp->stat.st_pagesize - 1) /
  -		    mfp->stat.st_pagesize);
  +		    ((bytes + mfp->pagesize - 1) / mfp->pagesize);
   		MUTEX_UNLOCK(env, mfp->mutex);
   	}
   
  @@ .
  patch -p0 <<'@@ .'
  Index: db/mp/mp_fopen.c
  ============================================================================
  $ cvs diff -u -r1.22 -r1.23 mp_fopen.c
  --- db/mp/mp_fopen.c	1 Apr 2010 16:04:38 -0000	1.22
  +++ db/mp/mp_fopen.c	21 Aug 2010 20:50:30 -0000	1.23
  @@ -351,7 +351,7 @@
   		if ((dbmfp->clear_len != DB_CLEARLEN_NOTSET &&
   		    mfp->clear_len != DB_CLEARLEN_NOTSET &&
   		    dbmfp->clear_len != mfp->clear_len) ||
  -		    (pagesize != 0 && pagesize != mfp->stat.st_pagesize) ||
  +		    (pagesize != 0 && pagesize != mfp->pagesize) ||
   		    (dbmfp->lsn_offset != DB_LSN_OFF_NOTSET &&
   		    mfp->lsn_off != DB_LSN_OFF_NOTSET &&
   		    dbmfp->lsn_offset != mfp->lsn_off)) {
  @@ -676,16 +676,16 @@
   	memset(mfp, 0, sizeof(MPOOLFILE));
   	mfp->mpf_cnt = 1;
   	mfp->ftype = dbmfp->ftype;
  -	mfp->stat.st_pagesize = pagesize;
  +	mfp->pagesize = pagesize;
   	mfp->lsn_off = dbmfp->lsn_offset;
   	mfp->clear_len = dbmfp->clear_len;
   	mfp->priority = dbmfp->priority;
   	if (dbmfp->gbytes != 0 || dbmfp->bytes != 0) {
   		mfp->maxpgno = (db_pgno_t)
  -		    (dbmfp->gbytes * (GIGABYTE / mfp->stat.st_pagesize));
  +		    (dbmfp->gbytes * (GIGABYTE / mfp->pagesize));
   		mfp->maxpgno += (db_pgno_t)
  -		    ((dbmfp->bytes + mfp->stat.st_pagesize - 1) /
  -		    mfp->stat.st_pagesize);
  +		    ((dbmfp->bytes + mfp->pagesize - 1) /
  +		    mfp->pagesize);
   	}
   	if (FLD_ISSET(dbmfp->config_flags, DB_MPOOL_NOFILE))
   		mfp->no_backing_file = 1;
  @@ .
  patch -p0 <<'@@ .'
  Index: db/mp/mp_fput.c
  ============================================================================
  $ cvs diff -u -r1.12 -r1.13 mp_fput.c
  --- db/mp/mp_fput.c	1 Apr 2010 16:04:38 -0000	1.12
  +++ db/mp/mp_fput.c	21 Aug 2010 20:50:30 -0000	1.13
  @@ -192,7 +192,7 @@
   
   	/* The buffer should not be accessed again. */
   	if (BH_REFCOUNT(bhp) == 0)
  -		MVCC_MPROTECT(bhp->buf, mfp->stat.st_pagesize, 0);
  +		MVCC_MPROTECT(bhp->buf, mfp->pagesize, 0);
   
   	/* Update priority values. */
   	if (priority == DB_PRIORITY_VERY_LOW ||
  @@ -200,7 +200,7 @@
   		bhp->priority = 0;
   	else {
   		/*
  -		 * We don't lock the LRU counter or the stat.st_pages field, if
  +		 * We don't lock the LRU counter or the pages field, if
   		 * we get garbage (which won't happen on a 32-bit machine), it
   		 * only means a buffer has the wrong priority.
   		 */
  @@ -230,10 +230,10 @@
   
   		adjust = 0;
   		if (pfactor != 0)
  -			adjust = (int)c_mp->stat.st_pages / pfactor;
  +			adjust = (int)c_mp->pages / pfactor;
   
   		if (F_ISSET(bhp, BH_DIRTY))
  -			adjust += (int)c_mp->stat.st_pages / MPOOL_PRI_DIRTY;
  +			adjust += (int)c_mp->pages / MPOOL_PRI_DIRTY;
   
   		if (adjust > 0) {
   			if (UINT32_MAX - bhp->priority >= (u_int32_t)adjust)
  @@ .
  patch -p0 <<'@@ .'
  Index: db/mp/mp_fset.c
  ============================================================================
  $ cvs diff -u -r1.12 -r1.13 mp_fset.c
  --- db/mp/mp_fset.c	1 Apr 2010 16:04:38 -0000	1.12
  +++ db/mp/mp_fset.c	21 Aug 2010 20:50:30 -0000	1.13
  @@ -129,7 +129,7 @@
   
   #ifdef DIAG_MVCC
   	mfp = R_ADDR(env->mp_handle->reginfo, bhp->mf_offset);
  -	MVCC_MPROTECT(bhp->buf, mfp->stat.st_pagesize, PROT_READ | PROT_WRITE);
  +	MVCC_MPROTECT(bhp->buf, mfp->pagesize, PROT_READ | PROT_WRITE);
   #endif
   	DB_ASSERT(env, !F_ISSET(bhp, BH_DIRTY) ||
   	    atomic_read(&hp->hash_page_dirty) != 0);
  @@ .
  patch -p0 <<'@@ .'
  Index: db/mp/mp_method.c
  ============================================================================
  $ cvs diff -u -r1.11 -r1.12 mp_method.c
  --- db/mp/mp_method.c	1 Apr 2010 16:04:38 -0000	1.11
  +++ db/mp/mp_method.c	21 Aug 2010 20:50:30 -0000	1.12
  @@ -69,6 +69,7 @@
   	u_int32_t *gbytesp, *bytesp;
   	int *ncachep;
   {
  +	DB_MPOOL *dbmp;
   	ENV *env;
   	MPOOL *mp;
   
  @@ -78,22 +79,23 @@
   	    env->mp_handle, "DB_ENV->get_cachesize", DB_INIT_MPOOL);
   
   	if (MPOOL_ON(env)) {
  -		/* Cannot be set after open, no lock required to read. */
  -		mp = env->mp_handle->reginfo[0].primary;
  +		dbmp = env->mp_handle;
  +		mp = dbmp->reginfo[0].primary;
   		if (gbytesp != NULL)
  -			*gbytesp = mp->stat.st_gbytes;
  +			*gbytesp = mp->gbytes;
   		if (bytesp != NULL)
  -			*bytesp = mp->stat.st_bytes;
  +			*bytesp = mp->bytes;
   		if (ncachep != NULL)
  -			*ncachep = (int)mp->nreg;
  +			*ncachep = mp->nreg;
   	} else {
   		if (gbytesp != NULL)
   			*gbytesp = dbenv->mp_gbytes;
   		if (bytesp != NULL)
   			*bytesp = dbenv->mp_bytes;
   		if (ncachep != NULL)
  -			*ncachep = (int)dbenv->mp_ncache;
  +			*ncachep = dbenv->mp_ncache;
   	}
  +
   	return (0);
   }
   
  @@ -465,14 +467,22 @@
   	DB_ENV *dbenv;
   	u_int32_t *mp_pagesizep;
   {
  +	DB_MPOOL *dbmp;
   	ENV *env;
  +	MPOOL *mp;
   
   	env = dbenv->env;
   
   	ENV_NOT_CONFIGURED(env,
   	    env->mp_handle, "DB_ENV->get_mp_max_pagesize", DB_INIT_MPOOL);
   
  -	*mp_pagesizep = dbenv->mp_pagesize;
  +	if (MPOOL_ON(env)) {
  +		dbmp = env->mp_handle;
  +		mp = dbmp->reginfo[0].primary;
  +		*mp_pagesizep = mp->pagesize;
  +	} else {
  +		*mp_pagesizep = dbenv->mp_pagesize;
  +	}
   	return (0);
   }
   
  @@ -792,10 +802,10 @@
   	    !mfp->no_backing_file && pgno <= mfp->last_flushed_pgno)
   #ifdef HAVE_FTRUNCATE
   		ret = __os_truncate(env,
  -		    dbmfp->fhp, pgno, mfp->stat.st_pagesize);
  +		    dbmfp->fhp, pgno, mfp->pagesize);
   #else
   		ret = __db_zero_extend(env,
  -		    dbmfp->fhp, pgno, mfp->last_pgno, mfp->stat.st_pagesize);
  +		    dbmfp->fhp, pgno, mfp->last_pgno, mfp->pagesize);
   #endif
   
   	/*
  @@ .
  patch -p0 <<'@@ .'
  Index: db/mp/mp_mvcc.c
  ============================================================================
  $ cvs diff -u -r1.6 -r1.7 mp_mvcc.c
  --- db/mp/mp_mvcc.c	1 Apr 2010 16:04:38 -0000	1.6
  +++ db/mp/mp_mvcc.c	21 Aug 2010 20:50:30 -0000	1.7
  @@ -147,7 +147,7 @@
   	created = h_locked = ret = 0;
   	/* Find the associated MPOOLFILE. */
   	mfp = R_ADDR(dbmp->reginfo, bhp->mf_offset);
  -	pagesize = mfp->stat.st_pagesize;
  +	pagesize = mfp->pagesize;
   	real_name = NULL;
   	fhp = NULL;
   
  @@ -401,7 +401,7 @@
   	c_mp = infop->primary;
   	mfp = R_ADDR(dbmp->reginfo, frozen_bhp->mf_offset);
   	freelist = NULL;
  -	pagesize = mfp->stat.st_pagesize;
  +	pagesize = mfp->pagesize;
   	ret = 0;
   	real_name = NULL;
   
  @@ .
  patch -p0 <<'@@ .'
  Index: db/mp/mp_region.c
  ============================================================================
  $ cvs diff -u -r1.11 -r1.12 mp_region.c
  --- db/mp/mp_region.c	1 Apr 2010 16:04:38 -0000	1.11
  +++ db/mp/mp_region.c	21 Aug 2010 20:50:30 -0000	1.12
  @@ -280,9 +280,9 @@
   	mp->htab_buckets = htab_buckets;
   #ifdef HAVE_STATISTICS
   	mp->stat.st_hash_buckets = htab_buckets;
  -	mp->stat.st_pagesize = dbenv->mp_pagesize == 0 ?
  -	    MPOOL_DEFAULT_PAGESIZE : dbenv->mp_pagesize;
   #endif
  +	mp->pagesize = dbenv->mp_pagesize == 0 ?
  +		MPOOL_DEFAULT_PAGESIZE : dbenv->mp_pagesize;
   
   	SH_TAILQ_INIT(&mp->free_frozen);
   	SH_TAILQ_INIT(&mp->alloc_frozen);
  @@ -301,11 +301,11 @@
   	SH_TAILQ_INSERT_TAIL(&mp->free_frozen, frozen_bhp, hq);
   
   	/*
  -	 * Only the environment creator knows the total cache size, fill in
  -	 * those statistics now.
  +	 * Only the environment creator knows the total cache size,
  +	 * fill in those fields now.
   	 */
  -	mp->stat.st_gbytes = dbenv->mp_gbytes;
  -	mp->stat.st_bytes = dbenv->mp_bytes;
  +	mp->gbytes = dbenv->mp_gbytes;
  +	mp->bytes = dbenv->mp_bytes;
   	infop->mtx_alloc = mp->mtx_region;
   	return (0);
   
  @@ .
  patch -p0 <<'@@ .'
  Index: db/mp/mp_stat.c
  ============================================================================
  $ cvs diff -u -r1.12 -r1.13 mp_stat.c
  --- db/mp/mp_stat.c	1 Apr 2010 16:04:38 -0000	1.12
  +++ db/mp/mp_stat.c	21 Aug 2010 20:50:30 -0000	1.13
  @@ -84,7 +84,7 @@
   	MPOOL *c_mp, *mp;
   	size_t len;
   	int ret;
  -	u_int32_t i, st_bytes, st_gbytes, st_hash_buckets, st_pages;
  +	u_int32_t i;
   	uintmax_t tmp_wait, tmp_nowait;
   
   	dbmp = env->mp_handle;
  @@ -104,9 +104,9 @@
   		 * a per-cache basis.  Note that configuration information
   		 * may be modified at any time, and so we have to lock.
   		 */
  -		sp->st_gbytes = mp->stat.st_gbytes;
  -		sp->st_bytes = mp->stat.st_bytes;
  -		sp->st_pagesize = mp->stat.st_pagesize;
  +		sp->st_gbytes = mp->gbytes;
  +		sp->st_bytes = mp->bytes;
  +		sp->st_pagesize = mp->pagesize;
   		sp->st_ncache = mp->nreg;
   		sp->st_max_ncache = mp->max_nreg;
   		sp->st_regsize = dbmp->reginfo[0].rp->size;
  @@ -132,7 +132,7 @@
   			sp->st_ro_evict += c_mp->stat.st_ro_evict;
   			sp->st_rw_evict += c_mp->stat.st_rw_evict;
   			sp->st_page_trickle += c_mp->stat.st_page_trickle;
  -			sp->st_pages += c_mp->stat.st_pages;
  +			sp->st_pages += c_mp->pages;
   			/*
   			 * st_page_dirty	calculated by __memp_stat_hash
   			 * st_page_clean	calculated here
  @@ -140,7 +140,7 @@
   			__memp_stat_hash(
   			    &dbmp->reginfo[i], c_mp, &sp->st_page_dirty);
   			sp->st_page_clean = sp->st_pages - sp->st_page_dirty;
  -			sp->st_hash_buckets += c_mp->stat.st_hash_buckets;
  +			sp->st_hash_buckets += c_mp->htab_buckets;
   			sp->st_hash_searches += c_mp->stat.st_hash_searches;
   			sp->st_hash_longest += c_mp->stat.st_hash_longest;
   			sp->st_hash_examined += c_mp->stat.st_hash_examined;
  @@ -170,17 +170,7 @@
   				if (!LF_ISSET(DB_STAT_SUBSYSTEM))
   					__mutex_clear(env, c_mp->mtx_region);
   
  -				MPOOL_SYSTEM_LOCK(env);
  -				st_bytes = c_mp->stat.st_bytes;
  -				st_gbytes = c_mp->stat.st_gbytes;
  -				st_hash_buckets = c_mp->stat.st_hash_buckets;
  -				st_pages = c_mp->stat.st_pages;
   				memset(&c_mp->stat, 0, sizeof(c_mp->stat));
  -				c_mp->stat.st_bytes = st_bytes;
  -				c_mp->stat.st_gbytes = st_gbytes;
  -				c_mp->stat.st_hash_buckets = st_hash_buckets;
  -				c_mp->stat.st_pages = st_pages;
  -				MPOOL_SYSTEM_UNLOCK(env);
   			}
   		}
   
  @@ -242,7 +232,6 @@
   	u_int32_t flags;
   {
   	DB_MPOOL_STAT *sp;
  -	u_int32_t pagesize;
   
   	COMPQUIET(env, NULL);
   	COMPQUIET(countp, NULL);
  @@ -255,11 +244,10 @@
   	sp->st_page_create += mfp->stat.st_page_create;
   	sp->st_page_in += mfp->stat.st_page_in;
   	sp->st_page_out += mfp->stat.st_page_out;
  -	if (LF_ISSET(DB_STAT_CLEAR)) {
  -		pagesize = mfp->stat.st_pagesize;
  +	sp->st_pagesize = mfp->pagesize;
  +	if (LF_ISSET(DB_STAT_CLEAR))
   		memset(&mfp->stat, 0, sizeof(mfp->stat));
  -		mfp->stat.st_pagesize = pagesize;
  -	}
  +
   	return (0);
   }
   
  @@ -308,7 +296,6 @@
   	DB_MPOOL_FSTAT **tfsp, *tstruct;
   	char *name, *tname;
   	size_t nlen;
  -	u_int32_t pagesize;
   
   	if (*countp == 0)
   		return (0);
  @@ -333,14 +320,15 @@
   	*tstruct = mfp->stat;
   	tstruct->file_name = tname;
   
  +	/* Grab the pagesize from the mfp. */
  +	tstruct->st_pagesize = mfp->pagesize;
  +
   	*(DB_MPOOL_FSTAT ***)argp = tfsp;
   	(*countp)--;
   
  -	if (LF_ISSET(DB_STAT_CLEAR)) {
  -		pagesize = mfp->stat.st_pagesize;
  +	if (LF_ISSET(DB_STAT_CLEAR))
   		memset(&mfp->stat, 0, sizeof(mfp->stat));
  -		mfp->stat.st_pagesize = pagesize;
  -	}
  +
   	return (0);
   }
   
  @@ .
  patch -p0 <<'@@ .'
  Index: db/mp/mp_trickle.c
  ============================================================================
  $ cvs diff -u -r1.11 -r1.12 mp_trickle.c
  --- db/mp/mp_trickle.c	1 Apr 2010 16:04:38 -0000	1.11
  +++ db/mp/mp_trickle.c	21 Aug 2010 20:50:30 -0000	1.12
  @@ -78,7 +78,7 @@
   	 */
   	for (ret = 0, i = dirty = total = 0; i < mp->nreg; ++i) {
   		c_mp = dbmp->reginfo[i].primary;
  -		total += c_mp->stat.st_pages;
  +		total += c_mp->pages;
   		__memp_stat_hash(&dbmp->reginfo[i], c_mp, &dtmp);
   		dirty += dtmp;
   	}
  @@ .
  patch -p0 <<'@@ .'
  Index: db/qam/qam_verify.c
  ============================================================================
  $ cvs diff -u -r1.10 -r1.11 qam_verify.c
  --- db/qam/qam_verify.c	1 Apr 2010 16:04:46 -0000	1.10
  +++ db/qam/qam_verify.c	21 Aug 2010 20:50:30 -0000	1.11
  @@ -599,7 +599,7 @@
   
   	err_ret = ret = 0;
   
  -	pagesize = (u_int32_t)dbp->mpf->mfp->stat.st_pagesize;
  +	pagesize = (u_int32_t)dbp->mpf->mfp->pagesize;
   	qlen = ((QUEUE *)dbp->q_internal)->re_len;
   	dbt.size = qlen;
   	key.data = &recno;
  @@ .
  patch -p0 <<'@@ .'
  Index: db/repmgr/repmgr_net.c
  ============================================================================
  $ cvs diff -u -r1.6 -r1.7 repmgr_net.c
  --- db/repmgr/repmgr_net.c	1 Apr 2010 16:04:48 -0000	1.6
  +++ db/repmgr/repmgr_net.c	21 Aug 2010 20:50:31 -0000	1.7
  @@ -102,6 +102,16 @@
   	LOCK_MUTEX(db_rep->mutex);
   
   	/*
  +	 * If we're already "finished", we can't send anything.  This covers the
  +	 * case where a bulk buffer is flushed at env close, or perhaps an
  +	 * unexpected __repmgr_thread_failure.
  +	 */ 
  +	if (db_rep->finished) {
  +		ret = DB_REP_UNAVAIL;
  +		goto out;
  +	}
  +	
  +	/*
   	 * Check whether we need to refresh our site address information with
   	 * more recent updates from shared memory.
   	 */
  @@ -530,6 +540,9 @@
   #endif
   		break;
   	default:
  +#ifdef EBADF
  +		DB_ASSERT(env, ret != EBADF);
  +#endif
   		__db_err(env, ret, "socket writing failure");
   		STAT(env->rep_handle->region->mstat.st_connection_drop++);
   		return (DB_REP_UNAVAIL);
  @@ .
  patch -p0 <<'@@ .'
  Index: db/repmgr/repmgr_sel.c
  ============================================================================
  $ cvs diff -u -r1.5 -r1.6 repmgr_sel.c
  --- db/repmgr/repmgr_sel.c	1 Apr 2010 16:04:48 -0000	1.5
  +++ db/repmgr/repmgr_sel.c	21 Aug 2010 20:50:31 -0000	1.6
  @@ -721,6 +721,9 @@
   			case WOULDBLOCK:
   				return (0);
   			default:
  +#ifdef EBADF
  +				DB_ASSERT(env, ret != EBADF);
  +#endif
   				(void)__repmgr_format_eid_loc(env->rep_handle,
   				    conn->eid, buffer);
   				__db_err(env, ret,
  @@ .
  patch -p0 <<'@@ .'
  Index: db/tcl/tcl_env.c
  ============================================================================
  $ cvs diff -u -r1.11 -r1.12 tcl_env.c
  --- db/tcl/tcl_env.c	1 Apr 2010 16:04:50 -0000	1.11
  +++ db/tcl/tcl_env.c	21 Aug 2010 20:50:31 -0000	1.12
  @@ -140,6 +140,7 @@
   		"get_mp_max_openfd",
   		"get_mp_max_write",
   		"get_mp_mmapsize",
  +		"get_mp_pagesize",
   		"get_open_flags",
   		"get_shm_key",
   		"get_tas_spins",
  @@ -249,6 +250,7 @@
   		ENVGETMPMAXOPENFD,
   		ENVGETMPMAXWRITE,
   		ENVGETMPMMAPSIZE,
  +		ENVGETMPPAGESIZE,
   		ENVGETOPENFLAG,
   		ENVGETSHMKEY,
   		ENVGETTASSPINS,
  @@ -936,6 +938,16 @@
   		    "env get_mp_mmapsize")) == TCL_OK)
   			res = Tcl_NewLongObj((long)size);
   		break;
  +	case ENVGETMPPAGESIZE:
  +		if (objc != 2) {
  +			Tcl_WrongNumArgs(interp, 1, objv, NULL);
  +			return (TCL_ERROR);
  +		}
  +		ret = dbenv->get_mp_pagesize(dbenv, &value);
  +		if ((result = _ReturnSetup(interp, ret, DB_RETOK_STD(ret),
  +		    "env get_mp_mmapsize")) == TCL_OK)
  +			res = Tcl_NewLongObj((long)value);
  +		break;
   	case ENVGETOPENFLAG:
   		result = env_GetOpenFlag(interp, objc, objv, dbenv);
   		break;
  @@ -996,10 +1008,16 @@
   		result = env_GetVerbose(interp, objc, objv, dbenv);
   		break;
   	case ENVRESIZECACHE:
  +		if (objc != 3) {
  +			Tcl_WrongNumArgs(interp, 2, objv,
  +			    "?-resize_cache {gbytes bytes}?");
  +			result = TCL_ERROR;
  +			break;
  +		}
   		if ((result = Tcl_ListObjGetElements(
   		    interp, objv[2], &listobjc, &listobjv)) != TCL_OK)
   			break;
  -		if (objc != 3 || listobjc != 2) {
  +		if (listobjc != 2) {
   			Tcl_WrongNumArgs(interp, 2, objv,
   			    "?-resize_cache {gbytes bytes}?");
   			result = TCL_ERROR;
  @@ .
  patch -p0 <<'@@ .'
  Index: db/test/TESTS
  ============================================================================
  $ cvs diff -u -r1.12 -r1.13 TESTS
  --- db/test/TESTS	1 Apr 2010 16:04:51 -0000	1.12
  +++ db/test/TESTS	21 Aug 2010 20:50:31 -0000	1.13
  @@ -33,10 +33,6 @@
   	with 1K pages.  Dirty page 6000000.  Sync.
   
   =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  -db_reptest
  -	Wrapper to configure and run the db_reptest program.
  -
  -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
   dbm
   	Historic DBM interface test.  Use the first 1000 entries from the
   	dictionary.  Insert each with self as key and data; retrieve each.
  @@ -45,6 +41,10 @@
   	everything.
   
   =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  +db_reptest
  +	Wrapper to configure and run the db_reptest program.
  +
  +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
   dead001
   	Use two different configurations to test deadlock detection among a
   	variable number of processes.  One configuration has the processes
  @@ .
  patch -p0 <<'@@ .'
  Index: db/txn/txn.c
  ============================================================================
  $ cvs diff -u -r1.14 -r1.15 txn.c
  --- db/txn/txn.c	1 Apr 2010 16:05:20 -0000	1.14
  +++ db/txn/txn.c	21 Aug 2010 20:50:32 -0000	1.15
  @@ -1808,7 +1808,7 @@
   	DB_CIPHER *db_cipher;
   	HDR hdr, *hdrp;
   	u_int32_t offset, opcode, sum_len;
  -	u_int8_t *bp, *key, chksum[DB_MAC_KEY];
  +	u_int8_t *bp, *key;
   	size_t hdrsize, rec_len;
   	int ret;
   
  @@ -1825,6 +1825,8 @@
   	hdrp = (HDR *)buffer;
   	memcpy(&hdr.prev, buffer + SSZ(HDR, prev), sizeof(hdr.prev));
   	memcpy(&hdr.len, buffer + SSZ(HDR, len), sizeof(hdr.len));
  +	if (LOG_SWAPPED(env))
  +		__log_hdrswap(&hdr, CRYPTO_ON(env));
   	rec_len = hdr.len - hdrsize;
   
   	offset = sizeof(u_int32_t) + sizeof(u_int32_t) + sizeof(DB_LSN);
  @@ -1840,15 +1842,17 @@
   	}
   	bp = buffer + hdrsize + offset;
   	opcode = TXN_ABORT;
  -	memcpy(bp, &opcode, sizeof(opcode));
  +	LOGCOPY_32(env, bp, &opcode);
   
   	if (CRYPTO_ON(env) &&
   	    (ret = db_cipher->encrypt(env,
   	    db_cipher->data, &hdrp->iv[0], buffer + hdrsize, rec_len)) != 0)
   		return (__env_panic(env, ret));
   
  -	__db_chksum(&hdr, buffer + hdrsize, rec_len, key, chksum);
  -	memcpy(buffer + SSZA(HDR, chksum), chksum, sum_len);
  +	__db_chksum(&hdr, buffer + hdrsize, rec_len, key, NULL);
  +	if (LOG_SWAPPED(env))
  +		__log_hdrswap(&hdr, CRYPTO_ON(env));
  +	memcpy(buffer + SSZA(HDR, chksum), hdr.chksum, sum_len);
   
   	return (0);
   }
  @@ .
Received on Sat Aug 21 22:50:32 2010
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.