Commit ef676263 authored by Rich Prohaska's avatar Rich Prohaska

#20 cleanup some static analysis issues

parent a9988038
......@@ -158,7 +158,6 @@ static uint32_t blob_field_index(TABLE *table, KEY_AND_COL_INFO *kc_info, uint i
int ha_tokudb::fast_update(THD *thd, List<Item> &update_fields, List<Item> &update_values, Item *conds) {
TOKUDB_DBUG_ENTER("ha_tokudb::fast_update");
int error = 0;
unsigned line = 0; // debug
if (tokudb_debug & TOKUDB_DEBUG_UPSERT) {
dump_item_list("fields", update_fields);
......@@ -170,24 +169,20 @@ int ha_tokudb::fast_update(THD *thd, List<Item> &update_fields, List<Item> &upda
if (update_fields.elements < 1 || update_fields.elements != update_values.elements) {
error = ENOTSUP; // something is fishy with the parameters
line = __LINE__;
goto return_error;
}
if (!check_fast_update(thd, update_fields, update_values, conds)) {
error = ENOTSUP;
line = __LINE__;
goto check_error;
}
error = send_update_message(update_fields, update_values, conds, transaction);
if (error != 0) {
line = __LINE__;
goto check_error;
}
check_error:
line = line; // debug
if (error != 0) {
if (get_disable_slow_update(thd))
error = HA_ERR_UNSUPPORTED;
......@@ -746,7 +741,6 @@ int ha_tokudb::upsert(THD *thd, List<Item> &update_fields, List<Item> &update_va
TOKUDB_DBUG_ENTER("ha_tokudb::upsert");
int error = 0;
unsigned line = 0; // debug
if (tokudb_debug & TOKUDB_DEBUG_UPSERT) {
fprintf(stderr, "upsert\n");
......@@ -756,24 +750,20 @@ int ha_tokudb::upsert(THD *thd, List<Item> &update_fields, List<Item> &update_va
if (update_fields.elements < 1 || update_fields.elements != update_values.elements) {
error = ENOTSUP; // not an upsert or something is fishy with the parameters
line = __LINE__;
goto return_error;
}
if (!check_upsert(thd, update_fields, update_values)) {
error = ENOTSUP;
line = __LINE__;
goto check_error;
}
error = send_upsert_message(thd, update_fields, update_values, transaction);
if (error != 0) {
line = __LINE__;
goto check_error;
}
check_error:
line = line; // debug
if (error != 0) {
if (get_disable_slow_upsert(thd))
error = HA_ERR_UNSUPPORTED;
......
......@@ -120,7 +120,9 @@ class buffer {
if (new_limit < m_size + s)
new_limit = m_size + s;
assert(!m_is_static);
m_data = realloc(m_data, new_limit);
void *new_data = realloc(m_data, new_limit);
assert(new_data != NULL);
m_data = new_data;
m_limit = new_limit;
}
}
......
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