summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--distribution/src/thirdparty/db/patch.4.6.21.190
-rw-r--r--distribution/src/thirdparty/db/patch.4.6.21.15663 (renamed from distribution/src/thirdparty/db/db-4.6.21.patch)0
-rw-r--r--distribution/src/thirdparty/db/patch.4.6.21.227
-rw-r--r--distribution/src/thirdparty/db/patch.4.6.21.353
4 files changed, 170 insertions, 0 deletions
diff --git a/distribution/src/thirdparty/db/patch.4.6.21.1 b/distribution/src/thirdparty/db/patch.4.6.21.1
new file mode 100644
index 00000000000..636bc51c7d2
--- /dev/null
+++ b/distribution/src/thirdparty/db/patch.4.6.21.1
@@ -0,0 +1,90 @@
+*** dbinc/mp.h 2007-09-28 01:28:25.000000000 +1000
+--- dbinc/mp.h 2008-02-14 01:22:09.000000000 +1100
+***************
+*** 639,644 ****
+--- 639,647 ----
+ */
+ #define MP_TRUNC_RECOVER 0x01
+
++ /* Private flags to DB_MPOOLFILE->close. */
++ #define DB_MPOOL_NOLOCK 0x002 /* Already have mpf locked. */
++
+ #if defined(__cplusplus)
+ }
+ #endif
+*** mp/mp_fopen.c 2007-05-18 03:18:01.000000000 +1000
+--- mp/mp_fopen.c 2008-02-12 16:09:42.000000000 +1100
+***************
+*** 888,894 ****
+ * when we try to flush them.
+ */
+ deleted = 0;
+! MUTEX_LOCK(dbenv, mfp->mutex);
+ if (F_ISSET(dbmfp, MP_MULTIVERSION))
+ --mfp->multiversion;
+ if (--mfp->mpf_cnt == 0 || LF_ISSET(DB_MPOOL_DISCARD)) {
+--- 888,895 ----
+ * when we try to flush them.
+ */
+ deleted = 0;
+! if (!LF_ISSET(DB_MPOOL_NOLOCK))
+! MUTEX_LOCK(dbenv, mfp->mutex);
+ if (F_ISSET(dbmfp, MP_MULTIVERSION))
+ --mfp->multiversion;
+ if (--mfp->mpf_cnt == 0 || LF_ISSET(DB_MPOOL_DISCARD)) {
+***************
+*** 909,921 ****
+ }
+ }
+ if (mfp->block_cnt == 0) {
+ if ((t_ret =
+ __memp_mf_discard(dbmp, mfp)) != 0 && ret == 0)
+ ret = t_ret;
+ deleted = 1;
+ }
+ }
+! if (!deleted)
+ MUTEX_UNLOCK(dbenv, mfp->mutex);
+
+ done: /* Discard the DB_MPOOLFILE structure. */
+--- 910,928 ----
+ }
+ }
+ if (mfp->block_cnt == 0) {
++ /*
++ * We should never discard this mp file if our caller
++ * is holding the lock on it. See comment in
++ * __memp_sync_file.
++ */
++ DB_ASSERT(dbenv, !LF_ISSET(DB_MPOOL_NOLOCK));
+ if ((t_ret =
+ __memp_mf_discard(dbmp, mfp)) != 0 && ret == 0)
+ ret = t_ret;
+ deleted = 1;
+ }
+ }
+! if (!deleted && !LF_ISSET(DB_MPOOL_NOLOCK))
+ MUTEX_UNLOCK(dbenv, mfp->mutex);
+
+ done: /* Discard the DB_MPOOLFILE structure. */
+*** mp/mp_sync.c 2007-06-02 04:32:44.000000000 +1000
+--- mp/mp_sync.c 2008-02-12 16:09:42.000000000 +1100
+***************
+*** 755,761 ****
+ * This is important since we are called with the hash bucket
+ * locked. The mfp will get freed via the cleanup pass.
+ */
+! if (dbmfp != NULL && (t_ret = __memp_fclose(dbmfp, 0)) != 0 && ret == 0)
+ ret = t_ret;
+
+ --mfp->mpf_cnt;
+--- 755,762 ----
+ * This is important since we are called with the hash bucket
+ * locked. The mfp will get freed via the cleanup pass.
+ */
+! if (dbmfp != NULL &&
+! (t_ret = __memp_fclose(dbmfp, DB_MPOOL_NOLOCK)) != 0 && ret == 0)
+ ret = t_ret;
+
+ --mfp->mpf_cnt;
+
diff --git a/distribution/src/thirdparty/db/db-4.6.21.patch b/distribution/src/thirdparty/db/patch.4.6.21.15663
index 0955cb88ea6..0955cb88ea6 100644
--- a/distribution/src/thirdparty/db/db-4.6.21.patch
+++ b/distribution/src/thirdparty/db/patch.4.6.21.15663
diff --git a/distribution/src/thirdparty/db/patch.4.6.21.2 b/distribution/src/thirdparty/db/patch.4.6.21.2
new file mode 100644
index 00000000000..4e59f18afe4
--- /dev/null
+++ b/distribution/src/thirdparty/db/patch.4.6.21.2
@@ -0,0 +1,27 @@
+*** mp/mp_region.c 2007-05-18 03:18:01.000000000 +1000
+--- mp/mp_region.c 2008-06-24 13:15:56.000000000 +1000
+***************
+*** 249,256 ****
+ mtx_base = htab[0].mtx_hash;
+ }
+
+ if (mtx_base != MUTEX_INVALID)
+! mtx_base += reginfo_off * htab_buckets;
+
+ /* Allocate hash table space and initialize it. */
+ if ((ret = __env_alloc(infop,
+--- 249,262 ----
+ mtx_base = htab[0].mtx_hash;
+ }
+
++ /*
++ * We preallocated all of the mutexes in a block, so for regions after
++ * the first, we skip mutexes in use in earlier regions. Each region
++ * has the same number of buckets and there are two mutexes per hash
++ * bucket (the bucket mutex and the I/O mutex).
++ */
+ if (mtx_base != MUTEX_INVALID)
+! mtx_base += reginfo_off * htab_buckets * 2;
+
+ /* Allocate hash table space and initialize it. */
+ if ((ret = __env_alloc(infop,
diff --git a/distribution/src/thirdparty/db/patch.4.6.21.3 b/distribution/src/thirdparty/db/patch.4.6.21.3
new file mode 100644
index 00000000000..e23a27a02ff
--- /dev/null
+++ b/distribution/src/thirdparty/db/patch.4.6.21.3
@@ -0,0 +1,53 @@
+*** sequence/sequence.c.orig 2007-05-17 10:18:04.000000000 -0700
+--- sequence/sequence.c 2008-08-14 12:24:23.000000000 -0700
+***************
+*** 252,257 ****
+--- 252,262 ----
+ if ((ret != DB_NOTFOUND && ret != DB_KEYEMPTY) ||
+ !LF_ISSET(DB_CREATE))
+ goto err;
++ if (IS_REP_CLIENT(dbenv) &&
++ !F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
++ ret = __db_rdonly(dbenv, "DB_SEQUENCE->open");
++ goto err;
++ }
+ ret = 0;
+
+ rp = &seq->seq_record;
+***************
+*** 304,310 ****
+ */
+ rp = seq->seq_data.data;
+ if (rp->seq_version == DB_SEQUENCE_OLDVER) {
+! oldver: rp->seq_version = DB_SEQUENCE_VERSION;
+ if (__db_isbigendian()) {
+ if (IS_DB_AUTO_COMMIT(dbp, txn)) {
+ if ((ret =
+--- 309,320 ----
+ */
+ rp = seq->seq_data.data;
+ if (rp->seq_version == DB_SEQUENCE_OLDVER) {
+! oldver: if (IS_REP_CLIENT(dbenv) &&
+! !F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
+! ret = __db_rdonly(dbenv, "DB_SEQUENCE->open");
+! goto err;
+! }
+! rp->seq_version = DB_SEQUENCE_VERSION;
+ if (__db_isbigendian()) {
+ if (IS_DB_AUTO_COMMIT(dbp, txn)) {
+ if ((ret =
+***************
+*** 713,718 ****
+--- 723,734 ----
+
+ MUTEX_LOCK(dbenv, seq->mtx_seq);
+
++ if (handle_check && IS_REP_CLIENT(dbenv) &&
++ !F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
++ ret = __db_rdonly(dbenv, "DB_SEQUENCE->get");
++ goto err;
++ }
++
+ if (rp->seq_min + delta > rp->seq_max) {
+ __db_errx(dbenv, "Sequence overflow");
+ ret = EINVAL;