diff options
Diffstat (limited to 'storage/tokudb/tokudb_update_fun.cc')
-rw-r--r-- | storage/tokudb/tokudb_update_fun.cc | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/storage/tokudb/tokudb_update_fun.cc b/storage/tokudb/tokudb_update_fun.cc index ddf509fd9b8..3ab7510121a 100644 --- a/storage/tokudb/tokudb_update_fun.cc +++ b/storage/tokudb/tokudb_update_fun.cc @@ -485,7 +485,7 @@ static int tokudb_hcad_update_fun( extra_pos += sizeof(uint32_t); max_num_bytes = old_val->size + extra->size + new_len_of_offsets + new_fixed_field_size; - new_val_data = (uchar *)my_malloc( + new_val_data = (uchar *)tokudb_my_malloc( max_num_bytes, MYF(MY_FAE) ); @@ -511,7 +511,6 @@ static int tokudb_hcad_update_fun( old_null_bytes = (uchar *)old_val->data; new_null_bytes = new_val_data; - memcpy(&curr_old_null_pos, extra_pos, sizeof(uint32_t)); extra_pos += sizeof(uint32_t); @@ -520,6 +519,8 @@ static int tokudb_hcad_update_fun( memcpy(&num_columns, extra_pos, sizeof(num_columns)); extra_pos += sizeof(num_columns); + + memset(new_null_bytes, 0, new_num_null_bytes); // shut valgrind up // // now go through and apply the change into new_val_data @@ -815,7 +816,7 @@ static int tokudb_hcad_update_fun( error = 0; cleanup: - my_free(new_val_data); + tokudb_my_free(new_val_data); return error; } @@ -856,7 +857,7 @@ static int tokudb_expand_variable_offsets( uchar *old_val_ptr = (uchar *)old_val->data; // allocate space for the new val's data - uchar *new_val_ptr = (uchar *)my_malloc(number_of_offsets + old_val->size, MYF(MY_FAE)); + uchar *new_val_ptr = (uchar *)tokudb_my_malloc(number_of_offsets + old_val->size, MYF(MY_FAE)); if (!new_val_ptr) { error = ENOMEM; goto cleanup; @@ -893,7 +894,7 @@ static int tokudb_expand_variable_offsets( error = 0; cleanup: - my_free(new_val.data); + tokudb_my_free(new_val.data); return error; } @@ -932,7 +933,7 @@ static int tokudb_expand_int_field( uchar *old_val_ptr = (uchar *)old_val->data; // allocate space for the new val's data - uchar *new_val_ptr = (uchar *)my_malloc(old_val->size + (new_length - old_length), MYF(MY_FAE)); + uchar *new_val_ptr = (uchar *)tokudb_my_malloc(old_val->size + (new_length - old_length), MYF(MY_FAE)); if (!new_val_ptr) { error = ENOMEM; goto cleanup; @@ -980,7 +981,7 @@ static int tokudb_expand_int_field( error = 0; cleanup: - my_free(new_val.data); + tokudb_my_free(new_val.data); return error; } @@ -1021,7 +1022,7 @@ static int tokudb_expand_char_field( uchar *old_val_ptr = (uchar *)old_val->data; // allocate space for the new val's data - uchar *new_val_ptr = (uchar *)my_malloc(old_val->size + (new_length - old_length), MYF(MY_FAE)); + uchar *new_val_ptr = (uchar *)tokudb_my_malloc(old_val->size + (new_length - old_length), MYF(MY_FAE)); if (!new_val_ptr) { error = ENOMEM; goto cleanup; @@ -1062,7 +1063,7 @@ static int tokudb_expand_char_field( error = 0; cleanup: - my_free(new_val.data); + tokudb_my_free(new_val.data); return error; } |