mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 14:54:20 +01:00
[t:4875], memset header to 0 when creating it, get rid of calls to toku_read_brt_header_and_store_in_cachefile in brt-test-helpers
git-svn-id: file:///svn/toku/tokudb@43428 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
f3a3fe1e44
commit
445f9283d5
2 changed files with 1 additions and 6 deletions
|
@ -35,8 +35,6 @@ BOOL ignore_if_was_already_open;
|
|||
int toku_testsetup_leaf(BRT brt, BLOCKNUM *blocknum, int n_children, char **keys, int *keylens) {
|
||||
BRTNODE node;
|
||||
assert(testsetup_initialized);
|
||||
int r = toku_read_brt_header_and_store_in_cachefile(brt, brt->h->cf, MAX_LSN, &brt->h, &ignore_if_was_already_open);
|
||||
if (r!=0) return r;
|
||||
toku_create_new_brtnode(brt, &node, 0, n_children);
|
||||
int i;
|
||||
for (i=0; i<n_children; i++) {
|
||||
|
@ -58,8 +56,6 @@ int toku_testsetup_nonleaf (BRT brt, int height, BLOCKNUM *blocknum, int n_child
|
|||
BRTNODE node;
|
||||
assert(testsetup_initialized);
|
||||
assert(n_children<=BRT_FANOUT);
|
||||
int r = toku_read_brt_header_and_store_in_cachefile(brt, brt->h->cf, MAX_LSN, &brt->h, &ignore_if_was_already_open);
|
||||
if (r!=0) return r;
|
||||
toku_create_new_brtnode(brt, &node, height, n_children);
|
||||
int i;
|
||||
for (i=0; i<n_children; i++) {
|
||||
|
@ -77,8 +73,6 @@ int toku_testsetup_nonleaf (BRT brt, int height, BLOCKNUM *blocknum, int n_child
|
|||
|
||||
int toku_testsetup_root(BRT brt, BLOCKNUM blocknum) {
|
||||
assert(testsetup_initialized);
|
||||
int r = toku_read_brt_header_and_store_in_cachefile(brt, brt->h->cf, MAX_LSN, &brt->h, &ignore_if_was_already_open);
|
||||
if (r!=0) return r;
|
||||
brt->h->root_blocknum = blocknum;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -408,6 +408,7 @@ toku_create_new_brtheader(BRT t, CACHEFILE cf, TOKUTXN txn) {
|
|||
r = ENOMEM;
|
||||
goto exit;
|
||||
}
|
||||
memset(t->h, 0, sizeof(struct brt_header));
|
||||
|
||||
t->h->layout_version = BRT_LAYOUT_VERSION;
|
||||
t->h->layout_version_original = BRT_LAYOUT_VERSION;
|
||||
|
|
Loading…
Add table
Reference in a new issue