aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Yu <tlyu@mit.edu>2002-08-28 06:36:55 +0000
committerTom Yu <tlyu@mit.edu>2002-08-28 06:36:55 +0000
commitf53da180e2a49527d5f630b3a0f6a2f31be95e5a (patch)
tree86730e21f162034b9439438c1548422bcd844020
parentf0cfadbe866fc501081a5c7def557b5c69deaf95 (diff)
downloadkrb5-f53da180e2a49527d5f630b3a0f6a2f31be95e5a.zip
krb5-f53da180e2a49527d5f630b3a0f6a2f31be95e5a.tar.gz
krb5-f53da180e2a49527d5f630b3a0f6a2f31be95e5a.tar.bz2
* btree/bt_split.c (bt_psplit): Correctly account for
sizeof(indx_t) when computing space used in a page by an item. [patch from www.sleepycat.com] [pullup from trunk] git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-2-2-branch@14781 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r--src/util/db2/ChangeLog7
-rw-r--r--src/util/db2/btree/bt_split.c5
2 files changed, 10 insertions, 2 deletions
diff --git a/src/util/db2/ChangeLog b/src/util/db2/ChangeLog
index 358844a..9c9768c 100644
--- a/src/util/db2/ChangeLog
+++ b/src/util/db2/ChangeLog
@@ -1,3 +1,10 @@
+2002-08-28 Tom Yu <tlyu@mit.edu>
+
+ * btree/bt_split.c (bt_psplit): Correctly account for
+ sizeof(indx_t) when computing space used in a page by an item.
+ [patch from www.sleepycat.com]
+ [pullup from trunk]
+
2002-08-26 Tom Yu <tlyu@mit.edu>
* Makefile.in (LIBMINOR): Bump due to addition of bt_rseq().
diff --git a/src/util/db2/btree/bt_split.c b/src/util/db2/btree/bt_split.c
index 0fc95ba..0cc6cf0 100644
--- a/src/util/db2/btree/bt_split.c
+++ b/src/util/db2/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;