Commit 59d6ed78 authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

refs #5333 dispatch update callbacks based on operation to handler functions

git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@47368 c7de825b-a66e-492c-adef-691d508d4ae1
parent 50bec466
......@@ -158,8 +158,8 @@ copy_toku_blob(uchar* to_ptr, uchar* from_ptr, uint32_t len_bytes, bool skip) {
return (length + len_bytes);
}
int
tokudb_update_fun(
static int
tokudb_hcad_update_fun(
DB* db,
const DBT *key,
const DBT *old_val,
......@@ -588,3 +588,29 @@ tokudb_update_fun(
my_free(new_val_data, MYF(MY_ALLOW_ZERO_PTR));
return error;
}
int
tokudb_update_fun(
DB* db,
const DBT *key,
const DBT *old_val,
const DBT *extra,
void (*set_val)(const DBT *new_val, void *set_extra),
void *set_extra
)
{
uchar *extra_pos = (uchar *)extra->data;
uchar operation = extra_pos[0];
int error = 0;
switch (operation) {
case UP_COL_ADD_OR_DROP:
error = tokudb_hcad_update_fun(db, key, old_val, extra, set_val, set_extra);
break;
default:
error = EINVAL;
break;
}
return error;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment