summaryrefslogtreecommitdiffstats
path: root/src/plugins/kdb/db2/libdb2/btree
diff options
context:
space:
mode:
authorTom Yu <tlyu@mit.edu>2008-02-07 07:07:06 +0000
committerTom Yu <tlyu@mit.edu>2008-02-07 07:07:06 +0000
commit010a7773a51edec7dc977340aec4bb92b0f9a721 (patch)
tree9b673675ef191384a478c19cd03c45765bead0bf /src/plugins/kdb/db2/libdb2/btree
parentb1d03de332d2f10e20a1f5a49cef77171749bd24 (diff)
downloadkrb5-010a7773a51edec7dc977340aec4bb92b0f9a721.tar.gz
krb5-010a7773a51edec7dc977340aec4bb92b0f9a721.tar.xz
krb5-010a7773a51edec7dc977340aec4bb92b0f9a721.zip
more tests for libdb btree page split on zero index
Enhance btree debugging output somewhat to limit key printout to the key length if the key is not null-terminated. Add additional test case for the zero-index page split bug; test case can create a corrupted btree database with records unreachable by random access but reachable by sequential access. Requires recompiling with CPPFLAGS='-DDEBUG -DDEBUG_IDX0SPLIT' to correctly model mpool page reuse that would be present in production conditions. (CPPFLAGS=-DDEBUG would otherwise explicitly overwrite the contents of reused pages.) ticket: new target_version: 1.6.4 tags: pullup component: krb5-kdc git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20222 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/plugins/kdb/db2/libdb2/btree')
-rw-r--r--src/plugins/kdb/db2/libdb2/btree/bt_debug.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/kdb/db2/libdb2/btree/bt_debug.c b/src/plugins/kdb/db2/libdb2/btree/bt_debug.c
index d36256b3af..b302ca60d3 100644
--- a/src/plugins/kdb/db2/libdb2/btree/bt_debug.c
+++ b/src/plugins/kdb/db2/libdb2/btree/bt_debug.c
@@ -257,7 +257,8 @@ __bt_dpage(dbp, h)
*(db_pgno_t *)bl->bytes,
*(u_int32_t *)(bl->bytes + sizeof(db_pgno_t)));
else if (bl->ksize)
- (void)fprintf(tracefp, "%s/", bl->bytes);
+ (void)fprintf(tracefp, "%.*s/",
+ (int)bl->ksize, bl->bytes);
if (bl->flags & P_BIGDATA)
(void)fprintf(tracefp,
"big data page %lu size %u",