mirror of
https://github.com/MariaDB/server.git
synced 2025-02-02 12:01:42 +01:00
Handle another merge case. Addresses #1195.
git-svn-id: file:///svn/toku/tokudb.1195@7508 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
55111c50cd
commit
7d9610c0bf
1 changed files with 19 additions and 1 deletions
20
newbrt/brt.c
20
newbrt/brt.c
|
@ -1901,7 +1901,25 @@ brt_merge_child (BRT t, BRTNODE node, int childnum_to_merge, BOOL *did_io, TOKUL
|
|||
BOOL did_merge;
|
||||
r = maybe_merge_pinned_nodes(t, childa, childb, logger, &did_merge);
|
||||
if (r!=0) goto return_r;
|
||||
if (did_merge) abort(); // cannot handle it.
|
||||
if (did_merge) {
|
||||
{
|
||||
struct kv_pair *delete_this_key = node->u.n.childkeys[childnuma];
|
||||
node->u.n.totalchildkeylens -= toku_brt_pivot_key_len(t, delete_this_key);
|
||||
toku_free(delete_this_key);
|
||||
}
|
||||
toku_fifo_free(&BNC_BUFFER(node, childnumb));
|
||||
node->u.n.n_children--;
|
||||
memmove(&node->u.n.childinfos[childnumb],
|
||||
&node->u.n.childinfos[childnumb+1],
|
||||
(node->u.n.n_children-childnumb)*sizeof(node->u.n.childinfos[0]));
|
||||
REALLOC_N(node->u.n.n_children, node->u.n.childinfos);
|
||||
memmove(&node->u.n.childkeys[childnuma],
|
||||
&node->u.n.childkeys[childnuma+1],
|
||||
(node->u.n.n_children-childnumb)*sizeof(node->u.n.childkeys[0]));
|
||||
REALLOC_N(node->u.n.n_children-1, node->u.n.childkeys);
|
||||
fixup_child_fingerprint(node, childnuma, childa, t, logger);
|
||||
|
||||
}
|
||||
}
|
||||
return_r:
|
||||
// Unpin both, and return the first nonzero error code that is found
|
||||
|
|
Loading…
Add table
Reference in a new issue