]> git.ipfire.org Git - people/pmueller/ipfire-3.x.git/blame - db4/patches/db-4.7.25-upstream_fixes-1.patch
Move all packages to root.
[people/pmueller/ipfire-3.x.git] / db4 / patches / db-4.7.25-upstream_fixes-1.patch
CommitLineData
24d34be6
MT
1Submitted By: DJ Lucas <dj_AT_linuxfromscratch_DOT_org>
2Date: 2008-09-28
3Initial Package Version: 4.7.25
4Upstream Status: From Upstream
5Origin: http://www.oracle.com/technology/products/berkeley-db/db/update/4.7.25/patch.4.7.25.1
6Description: Update to latest patch for 4.7.25 release (avoid improperly named
7 patches in LFS).
8
9diff -Naur db-4.7.25-orig/sequence/sequence.c db-4.7.25/sequence/sequence.c
10--- db-4.7.25-orig/sequence/sequence.c 2008-05-05 15:25:09.000000000 -0500
11+++ db-4.7.25/sequence/sequence.c 2008-09-28 00:03:59.000000000 -0500
12@@ -187,7 +187,11 @@
13 if ((ret = __db_get_flags(dbp, &tflags)) != 0)
14 goto err;
15
16- if (DB_IS_READONLY(dbp)) {
17+ /*
18+ * We can let replication clients open sequences, but must
19+ * check later that they do not update them.
20+ */
21+ if (F_ISSET(dbp, DB_AM_RDONLY)) {
22 ret = __db_rdonly(dbp->env, "DB_SEQUENCE->open");
23 goto err;
24 }
25@@ -244,6 +248,11 @@
26 if ((ret != DB_NOTFOUND && ret != DB_KEYEMPTY) ||
27 !LF_ISSET(DB_CREATE))
28 goto err;
29+ if (IS_REP_CLIENT(env) &&
30+ !F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
31+ ret = __db_rdonly(env, "DB_SEQUENCE->open");
32+ goto err;
33+ }
34 ret = 0;
35
36 rp = &seq->seq_record;
37@@ -296,7 +305,12 @@
38 */
39 rp = seq->seq_data.data;
40 if (rp->seq_version == DB_SEQUENCE_OLDVER) {
41-oldver: rp->seq_version = DB_SEQUENCE_VERSION;
42+oldver: if (IS_REP_CLIENT(env) &&
43+ !F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
44+ ret = __db_rdonly(env, "DB_SEQUENCE->open");
45+ goto err;
46+ }
47+ rp->seq_version = DB_SEQUENCE_VERSION;
48 if (!F_ISSET(env, ENV_LITTLEENDIAN)) {
49 if (IS_DB_AUTO_COMMIT(dbp, txn)) {
50 if ((ret =
51@@ -707,6 +721,13 @@
52
53 MUTEX_LOCK(env, seq->mtx_seq);
54
55+ if (handle_check && IS_REP_CLIENT(env) &&
56+ !F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
57+ ret = __db_rdonly(env, "DB_SEQUENCE->get");
58+ goto err;
59+ }
60+
61+
62 if (rp->seq_min + delta > rp->seq_max) {
63 __db_errx(env, "Sequence overflow");
64 ret = EINVAL;