From: Eduardo Lima (Etrunko) Date: Wed, 11 Dec 2013 13:25:55 +0000 (-0200) Subject: patch.1.3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b9fd2fa46d85ceb5d60b89d1d2e244295d5c2ea7;p=platform%2Fupstream%2Flibdb.git patch.1.3 http://www.oracle.com/technetwork/products/berkeleydb/patch-082767.html Problem: DB 1.85 core dumps on certain data sets when using the B+tree access method. (Patch #2 MUST be applied before this patch.) Signed-off-by: Eduardo Lima (Etrunko) --- diff --git a/db.1.85/btree/bt_split.c b/db.1.85/btree/bt_split.c index 7ef8413..c7779b8 100644 --- a/db.1.85/btree/bt_split.c +++ b/db.1.85/btree/bt_split.c @@ -673,7 +673,8 @@ bt_psplit(t, h, l, r, pskip, ilen) * where we decide to try and copy too much onto the left page. * Make sure that doesn't happen. */ - if (skip <= off && used + nbytes >= full || nxt == top - 1) { + if (skip <= off && + used + nbytes + sizeof(indx_t) >= full || nxt == top - 1) { --off; break; } @@ -686,7 +687,7 @@ bt_psplit(t, h, l, r, pskip, ilen) memmove((char *)l + l->upper, src, nbytes); } - used += nbytes; + used += nbytes + sizeof(indx_t); if (used >= half) { if (!isbigkey || bigkeycnt == 3) break; diff --git a/packaging/libdb.spec b/packaging/libdb.spec index 48123c2..dbd3915 100644 --- a/packaging/libdb.spec +++ b/packaging/libdb.spec @@ -7,7 +7,6 @@ Version: 5.3.21 Release: 11 Source0: http://download.oracle.com/berkeley-db/db-%{version}.tar.gz # db-1.85 upstream patches -Patch12: http://www.oracle.com/technology/products/berkeley-db/db/update/1.85/patch.1.3 Patch13: http://www.oracle.com/technology/products/berkeley-db/db/update/1.85/patch.1.4 # other patches Patch20: db-1.85-errno.patch @@ -187,7 +186,6 @@ for building programs which use the Berkeley DB in Java. %setup -q -n db-%{version} pushd db.1.85 -%patch12 -p0 -b .1.3 %patch13 -p0 -b .1.4 %patch20 -p1 -b .errno popd diff --git a/packaging/patch.1.3 b/packaging/patch.1.3 deleted file mode 100644 index 5ca03df..0000000 --- a/packaging/patch.1.3 +++ /dev/null @@ -1,37 +0,0 @@ -*** btree/bt_split.c.orig Sat Feb 8 10:14:10 1997 ---- btree/bt_split.c Sat Feb 8 10:14:51 1997 -*************** -*** 673,679 **** - * where we decide to try and copy too much onto the left page. - * Make sure that doesn't happen. - */ -! if (skip <= off && used + nbytes >= full || nxt == top - 1) { - --off; - break; - } ---- 673,680 ---- - * where we decide to try and copy too much onto the left page. - * Make sure that doesn't happen. - */ -! if (skip <= off && -! used + nbytes + sizeof(indx_t) >= full || nxt == top - 1) { - --off; - break; - } -*************** -*** 686,692 **** - memmove((char *)l + l->upper, src, nbytes); - } - -! used += nbytes; - if (used >= half) { - if (!isbigkey || bigkeycnt == 3) - break; ---- 687,693 ---- - memmove((char *)l + l->upper, src, nbytes); - } - -! used += nbytes + sizeof(indx_t); - if (used >= half) { - if (!isbigkey || bigkeycnt == 3) - break;