diff options
Diffstat (limited to 'storage/myisam')
-rw-r--r-- | storage/myisam/ft_boolean_search.c | 4 | ||||
-rw-r--r-- | storage/myisam/ft_nlq_search.c | 2 | ||||
-rw-r--r-- | storage/myisam/ft_stopwords.c | 6 | ||||
-rw-r--r-- | storage/myisam/ha_myisam.cc | 4 | ||||
-rw-r--r-- | storage/myisam/mi_check.c | 40 | ||||
-rw-r--r-- | storage/myisam/mi_close.c | 12 | ||||
-rw-r--r-- | storage/myisam/mi_create.c | 4 | ||||
-rw-r--r-- | storage/myisam/mi_dynrec.c | 4 | ||||
-rw-r--r-- | storage/myisam/mi_open.c | 4 | ||||
-rw-r--r-- | storage/myisam/mi_packrec.c | 4 | ||||
-rw-r--r-- | storage/myisam/mi_preload.c | 4 | ||||
-rw-r--r-- | storage/myisam/mi_test2.c | 5 | ||||
-rw-r--r-- | storage/myisam/mi_write.c | 4 | ||||
-rw-r--r-- | storage/myisam/myisamchk.c | 7 | ||||
-rw-r--r-- | storage/myisam/myisamlog.c | 12 | ||||
-rw-r--r-- | storage/myisam/myisampack.c | 37 | ||||
-rw-r--r-- | storage/myisam/rt_index.c | 2 | ||||
-rw-r--r-- | storage/myisam/sort.c | 22 |
18 files changed, 81 insertions, 96 deletions
diff --git a/storage/myisam/ft_boolean_search.c b/storage/myisam/ft_boolean_search.c index 52ad6b11aa1..33c1e092a00 100644 --- a/storage/myisam/ft_boolean_search.c +++ b/storage/myisam/ft_boolean_search.c @@ -608,7 +608,7 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, uchar *query, return ftb; err: free_root(& ftb->mem_root, MYF(0)); - my_free((uchar*)ftb,MYF(0)); + my_free(ftb); return 0; } @@ -1032,7 +1032,7 @@ void ft_boolean_close_search(FT_INFO *ftb) delete_tree(& ftb->no_dupes); } free_root(& ftb->mem_root, MYF(0)); - my_free((uchar*)ftb,MYF(0)); + my_free(ftb); } diff --git a/storage/myisam/ft_nlq_search.c b/storage/myisam/ft_nlq_search.c index 5317da78ee4..7d9b13b7714 100644 --- a/storage/myisam/ft_nlq_search.c +++ b/storage/myisam/ft_nlq_search.c @@ -357,7 +357,7 @@ float ft_nlq_find_relevance(FT_INFO *handler, void ft_nlq_close_search(FT_INFO *handler) { - my_free((uchar*)handler,MYF(0)); + my_free(handler); } diff --git a/storage/myisam/ft_stopwords.c b/storage/myisam/ft_stopwords.c index 9838b15af34..1467cc56759 100644 --- a/storage/myisam/ft_stopwords.c +++ b/storage/myisam/ft_stopwords.c @@ -38,7 +38,7 @@ static void FT_STOPWORD_free(FT_STOPWORD *w, TREE_FREE action, void *arg __attribute__((unused))) { if (action == free_free) - my_free((uchar*) w->pos, MYF(0)); + my_free((void*)w->pos); } static int ft_add_stopword(const char *w) @@ -87,7 +87,7 @@ int ft_init_stopwords() } error=0; err1: - my_free(buffer, MYF(0)); + my_free(buffer); err0: my_close(fd, MYF(MY_WME)); return error; @@ -121,7 +121,7 @@ void ft_free_stopwords() if (stopwords3) { delete_tree(stopwords3); /* purecov: inspected */ - my_free((char*) stopwords3,MYF(0)); + my_free(stopwords3); stopwords3=0; } ft_stopword_file= 0; diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index 26f6a3903a8..87de58076cd 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -756,7 +756,7 @@ int ha_myisam::open(const char *name, int mode, uint test_if_locked) recinfo must be freed. */ if (recinfo) - my_free((uchar*) recinfo, MYF(0)); + my_free(recinfo); return my_errno; } @@ -1883,7 +1883,7 @@ int ha_myisam::create(const char *name, register TABLE *table_arg, records, recinfo, 0, (MI_UNIQUEDEF*) 0, &create_info, create_flags); - my_free((uchar*) recinfo, MYF(0)); + my_free(recinfo); DBUG_RETURN(error); } diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index 25267bfb9ea..13427130069 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -1369,12 +1369,12 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend) printf("Lost space: %12s Linkdata: %10s\n", llstr(empty,llbuff),llstr(link_used,llbuff2)); } - my_free(mi_get_rec_buff_ptr(info, record), MYF(0)); + my_free(mi_get_rec_buff_ptr(info, record)); DBUG_RETURN (error); err: mi_check_print_error(param,"got error: %d when reading datafile at record: %s",my_errno, llstr(records,llbuff)); err2: - my_free(mi_get_rec_buff_ptr(info, record), MYF(0)); + my_free(mi_get_rec_buff_ptr(info, record)); param->testflag|=T_RETRY_WITHOUT_QUICK; DBUG_RETURN(1); } /* chk_data_link */ @@ -1774,11 +1774,9 @@ err: } mi_mark_crashed_on_repair(info); } - my_free(mi_get_rec_buff_ptr(info, sort_param.rec_buff), - MYF(MY_ALLOW_ZERO_PTR)); - my_free(mi_get_rec_buff_ptr(info, sort_param.record), - MYF(MY_ALLOW_ZERO_PTR)); - my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mi_get_rec_buff_ptr(info, sort_param.rec_buff)); + my_free(mi_get_rec_buff_ptr(info, sort_param.record)); + my_free(sort_info.buff); (void) end_io_cache(¶m->read_cache); info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED); (void) end_io_cache(&info->rec_cache); @@ -2208,11 +2206,11 @@ int filecopy(MI_CHECK *param, File to,File from,my_off_t start, mysql_file_write(to, (uchar*) buff, (uint) length, param->myf_rw)) goto err; if (buff != tmp_buff) - my_free(buff,MYF(0)); + my_free(buff); DBUG_RETURN(0); err: if (buff != tmp_buff) - my_free(buff,MYF(0)); + my_free(buff); mi_check_print_error(param,"Can't copy %s to tempfile, error %d", type,my_errno); DBUG_RETURN(1); @@ -2595,13 +2593,11 @@ err: share->state.changed&= ~STATE_NOT_OPTIMIZED_KEYS; share->state.changed|=STATE_NOT_SORTED_PAGES; - my_free(mi_get_rec_buff_ptr(info, sort_param.rec_buff), - MYF(MY_ALLOW_ZERO_PTR)); - my_free(mi_get_rec_buff_ptr(info, sort_param.record), - MYF(MY_ALLOW_ZERO_PTR)); - my_free((uchar*) sort_info.key_block,MYF(MY_ALLOW_ZERO_PTR)); - my_free((uchar*) sort_info.ft_buf, MYF(MY_ALLOW_ZERO_PTR)); - my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mi_get_rec_buff_ptr(info, sort_param.rec_buff)); + my_free(mi_get_rec_buff_ptr(info, sort_param.record)); + my_free(sort_info.key_block); + my_free(sort_info.ft_buf); + my_free(sort_info.buff); (void) end_io_cache(¶m->read_cache); info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED); if (!got_error && (param->testflag & T_UNPACK)) @@ -3142,10 +3138,10 @@ err: mysql_mutex_destroy(¶m->print_msg_mutex); param->need_print_msg_lock= 0; - my_free((uchar*) sort_info.ft_buf, MYF(MY_ALLOW_ZERO_PTR)); - my_free((uchar*) sort_info.key_block,MYF(MY_ALLOW_ZERO_PTR)); - my_free((uchar*) sort_param,MYF(MY_ALLOW_ZERO_PTR)); - my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR)); + my_free(sort_info.ft_buf); + my_free(sort_info.key_block); + my_free(sort_param); + my_free(sort_info.buff); (void) end_io_cache(¶m->read_cache); info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED); if (!got_error && (param->testflag & T_UNPACK)) @@ -4551,7 +4547,7 @@ void update_auto_increment_key(MI_CHECK *param, MI_INFO *info, if (my_errno != HA_ERR_END_OF_FILE) { mi_extra(info,HA_EXTRA_NO_KEYREAD,0); - my_free(mi_get_rec_buff_ptr(info, record), MYF(0)); + my_free(mi_get_rec_buff_ptr(info, record)); mi_check_print_error(param,"%d when reading last record",my_errno); DBUG_VOID_RETURN; } @@ -4566,7 +4562,7 @@ void update_auto_increment_key(MI_CHECK *param, MI_INFO *info, set_if_bigger(info->s->state.auto_increment, param->auto_increment_value); } mi_extra(info,HA_EXTRA_NO_KEYREAD,0); - my_free(mi_get_rec_buff_ptr(info, record), MYF(0)); + my_free(mi_get_rec_buff_ptr(info, record)); update_state_info(param, info, UPDATE_AUTO_INC); DBUG_VOID_RETURN; } diff --git a/storage/myisam/mi_close.c b/storage/myisam/mi_close.c index 8ec0bf14e0a..51408ab191c 100644 --- a/storage/myisam/mi_close.c +++ b/storage/myisam/mi_close.c @@ -57,7 +57,7 @@ int mi_close(register MI_INFO *info) myisam_open_list=list_delete(myisam_open_list,&info->open_list); mysql_mutex_unlock(&share->intern_lock); - my_free(mi_get_rec_buff_ptr(info, info->rec_buff), MYF(MY_ALLOW_ZERO_PTR)); + my_free(mi_get_rec_buff_ptr(info, info->rec_buff)); if (flag) { DBUG_EXECUTE_IF("crash_before_flush_keys", @@ -88,8 +88,8 @@ int mi_close(register MI_INFO *info) #endif if (share->decode_trees) { - my_free((uchar*) share->decode_trees,MYF(0)); - my_free((uchar*) share->decode_tables,MYF(0)); + my_free(share->decode_trees); + my_free(share->decode_tables); } #ifdef THREAD thr_lock_delete(&share->lock); @@ -103,19 +103,19 @@ int mi_close(register MI_INFO *info) } } #endif - my_free((uchar*) info->s,MYF(0)); + my_free(info->s); } mysql_mutex_unlock(&THR_LOCK_myisam); if (info->ftparser_param) { - my_free((uchar*)info->ftparser_param, MYF(0)); + my_free(info->ftparser_param); info->ftparser_param= 0; } if (info->dfile >= 0 && mysql_file_close(info->dfile, MYF(0))) error = my_errno; myisam_log_command(MI_LOG_CLOSE,info,NULL,0,error); - my_free((uchar*) info,MYF(0)); + my_free(info); if (error) { diff --git a/storage/myisam/mi_create.c b/storage/myisam/mi_create.c index 3db03e23637..c415264cd98 100644 --- a/storage/myisam/mi_create.c +++ b/storage/myisam/mi_create.c @@ -834,7 +834,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, mysql_mutex_unlock(&THR_LOCK_myisam); if (mysql_file_close(file, MYF(0))) goto err; - my_free((char*) rec_per_key_part,MYF(0)); + my_free(rec_per_key_part); DBUG_RETURN(0); err: @@ -860,7 +860,7 @@ err: MY_UNPACK_FILENAME | MY_APPEND_EXT), MYF(0)); } - my_free((char*) rec_per_key_part, MYF(0)); + my_free(rec_per_key_part); DBUG_RETURN(my_errno=save_errno); /* return the fatal errno */ } diff --git a/storage/myisam/mi_dynrec.c b/storage/myisam/mi_dynrec.c index 02a8f21e3e2..59b895b5e64 100644 --- a/storage/myisam/mi_dynrec.c +++ b/storage/myisam/mi_dynrec.c @@ -44,7 +44,7 @@ static int _mi_cmp_buffer(File file, const uchar *buff, my_off_t filepos, #undef my_alloca #undef my_afree #define my_alloca(A) my_malloc((A),MYF(0)) -#define my_afree(A) my_free((A),MYF(0)) +#define my_afree(A) my_free((A)) #endif /* Interface function from MI_INFO */ @@ -1575,7 +1575,7 @@ int _mi_cmp_dynamic_unique(MI_INFO *info, MI_UNIQUEDEF *def, error=mi_unique_comp(def, record, old_record, def->null_are_equal); if (info->s->base.blobs) { - my_free(mi_get_rec_buff_ptr(info, info->rec_buff), MYF(MY_ALLOW_ZERO_PTR)); + my_free(mi_get_rec_buff_ptr(info, info->rec_buff)); info->rec_buff=rec_buff; } my_afree(old_record); diff --git a/storage/myisam/mi_open.c b/storage/myisam/mi_open.c index 1d877748b31..014cf1c5a2c 100644 --- a/storage/myisam/mi_open.c +++ b/storage/myisam/mi_open.c @@ -676,7 +676,7 @@ err: mi_report_error(save_errno, name); switch (errpos) { case 6: - my_free((uchar*) m_info,MYF(0)); + my_free(m_info); /* fall through */ case 5: (void) mysql_file_close(info.dfile, MYF(0)); @@ -684,7 +684,7 @@ err: break; /* Don't remove open table */ /* fall through */ case 4: - my_free((uchar*) share,MYF(0)); + my_free(share); /* fall through */ case 3: if (! lock_error) diff --git a/storage/myisam/mi_packrec.c b/storage/myisam/mi_packrec.c index 580c58e6ea1..0ba495fdd68 100644 --- a/storage/myisam/mi_packrec.c +++ b/storage/myisam/mi_packrec.c @@ -298,9 +298,9 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys) err3: my_errno=HA_ERR_WRONG_IN_RECORD; err2: - my_free((uchar*) share->decode_tables,MYF(0)); + my_free(share->decode_tables); err1: - my_free((uchar*) share->decode_trees,MYF(0)); + my_free(share->decode_trees); err0: DBUG_RETURN(1); } diff --git a/storage/myisam/mi_preload.c b/storage/myisam/mi_preload.c index ae45014eab5..31537f7054b 100644 --- a/storage/myisam/mi_preload.c +++ b/storage/myisam/mi_preload.c @@ -113,11 +113,11 @@ int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves) } while (pos != key_file_length); - my_free((char*) buff, MYF(0)); + my_free(buff); DBUG_RETURN(0); err: - my_free((char*) buff, MYF(MY_ALLOW_ZERO_PTR)); + my_free(buff); DBUG_RETURN(my_errno= errno); } diff --git a/storage/myisam/mi_test2.c b/storage/myisam/mi_test2.c index 63525b08820..60b16d5549e 100644 --- a/storage/myisam/mi_test2.c +++ b/storage/myisam/mi_test2.c @@ -21,9 +21,6 @@ #ifdef DBUG_OFF #undef DBUG_OFF #endif -#ifndef SAFEMALLOC -#define SAFEMALLOC -#endif #include "myisamdef.h" #include <m_ctype.h> #include <my_bit.h> @@ -856,7 +853,7 @@ reads: %10lu\n", } end_key_cache(dflt_key_cache,1); if (blob_buffer) - my_free(blob_buffer,MYF(0)); + my_free(blob_buffer); my_end(silent ? MY_CHECK_ERROR : MY_CHECK_ERROR | MY_GIVE_INFO); return(0); err: diff --git a/storage/myisam/mi_write.c b/storage/myisam/mi_write.c index 5b46db111b3..f2d43585eef 100644 --- a/storage/myisam/mi_write.c +++ b/storage/myisam/mi_write.c @@ -286,7 +286,7 @@ int _mi_ck_write_btree(register MI_INFO *info, uint keynr, uchar *key, if (!error) error= _mi_ft_convert_to_ft2(info, keynr, key); delete_dynamic(info->ft1_to_ft2); - my_free((uchar*)info->ft1_to_ft2, MYF(0)); + my_free(info->ft1_to_ft2); info->ft1_to_ft2=0; } DBUG_RETURN(error); @@ -1045,7 +1045,7 @@ void mi_end_bulk_insert(MI_INFO *info) delete_tree(& info->bulk_insert[i]); } } - my_free((void *)info->bulk_insert, MYF(0)); + my_free(info->bulk_insert); info->bulk_insert=0; } } diff --git a/storage/myisam/myisamchk.c b/storage/myisam/myisamchk.c index 11ec52fd123..0e32dc59d89 100644 --- a/storage/myisam/myisamchk.c +++ b/storage/myisam/myisamchk.c @@ -1629,11 +1629,10 @@ err: { my_afree((uchar*) temp_buff); } - my_free(mi_get_rec_buff_ptr(info, sort_param.record), - MYF(MY_ALLOW_ZERO_PTR)); + my_free(mi_get_rec_buff_ptr(info, sort_param.record)); info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED); (void) end_io_cache(&info->rec_cache); - my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR)); + my_free(sort_info.buff); sort_info.buff=0; share->state.sortkey=sort_key; DBUG_RETURN(flush_blocks(param, share->key_cache, share->kfile) | @@ -1673,7 +1672,6 @@ static int sort_record_index(MI_SORT_PARAM *sort_param,MI_INFO *info, endpos=buff+used_length; for ( ;; ) { - _sanity(__FILE__,__LINE__); if (nod_flag) { next_page=_mi_kpos(nod_flag,keypos); @@ -1689,7 +1687,6 @@ static int sort_record_index(MI_SORT_PARAM *sort_param,MI_INFO *info, new_file, update_index)) goto err; } - _sanity(__FILE__,__LINE__); if (keypos >= endpos || (key_length=(*keyinfo->get_key)(keyinfo,nod_flag,&keypos,lastkey)) == 0) diff --git a/storage/myisam/myisamlog.c b/storage/myisam/myisamlog.c index 089e3480da6..1733d7140cd 100644 --- a/storage/myisam/myisamlog.c +++ b/storage/myisam/myisamlog.c @@ -616,7 +616,7 @@ static int examine_log(char * file_name, char **table_names) } } } - my_free(buff,MYF(0)); + my_free(buff); break; case MI_LOG_LOCK: if (my_b_read(&cache,(uchar*) head,sizeof(lock_command))) @@ -683,12 +683,12 @@ static int read_string(IO_CACHE *file, register uchar* *to, register uint length DBUG_ENTER("read_string"); if (*to) - my_free((uchar*) *to,MYF(0)); + my_free(*to); if (!(*to= (uchar*) my_malloc(length+1,MYF(MY_WME))) || my_b_read(file,(uchar*) *to,length)) { if (*to) - my_free(*to,MYF(0)); + my_free(*to); *to= 0; DBUG_RETURN(1); } @@ -759,10 +759,10 @@ static void file_info_free(struct file_info *fileinfo) if (!fileinfo->closed) (void) mi_close(fileinfo->isam); if (fileinfo->record) - my_free(fileinfo->record,MYF(0)); + my_free(fileinfo->record); } - my_free(fileinfo->name,MYF(0)); - my_free(fileinfo->show_name,MYF(0)); + my_free(fileinfo->name); + my_free(fileinfo->show_name); DBUG_VOID_RETURN; } diff --git a/storage/myisam/myisampack.c b/storage/myisam/myisampack.c index 18810a60166..d4997a2bcbb 100644 --- a/storage/myisam/myisampack.c +++ b/storage/myisam/myisampack.c @@ -486,7 +486,7 @@ static my_bool open_isam_files(PACK_MRG_INFO *mrg, char **names, uint count) error: while (i--) mi_close(mrg->file[i]); - my_free((uchar*) mrg->file,MYF(0)); + my_free(mrg->file); return 1; } @@ -534,10 +534,10 @@ static int compress(PACK_MRG_INFO *mrg,char *result_table) my_write(join_isam_file,buff,length, MYF(MY_WME | MY_NABP | MY_WAIT_IF_FULL))) { - my_free(buff,MYF(0)); + my_free(buff); goto err; } - my_free(buff,MYF(0)); + my_free(buff); (void) fn_format(new_name,result_table,"",MI_NAME_DEXT,2); } else if (!tmp_dir[0]) @@ -564,7 +564,6 @@ static int compress(PACK_MRG_INFO *mrg,char *result_table) } trees=fields=share->base.fields; huff_counts=init_huff_count(isam_file,mrg->records); - QUICK_SAFEMALLOC; /* Read the whole data file(s) for statistics. @@ -574,7 +573,7 @@ static int compress(PACK_MRG_INFO *mrg,char *result_table) printf("- Calculating statistics\n"); if (get_statistic(mrg,huff_counts)) goto err; - NORMAL_SAFEMALLOC; + old_length=0; for (i=0; i < mrg->count ; i++) old_length+= (mrg->file[i]->s->state.state.data_file_length - @@ -857,11 +856,11 @@ static void free_counts_and_tree_and_queue(HUFF_TREE *huff_trees, uint trees, for (i=0 ; i < trees ; i++) { if (huff_trees[i].element_buffer) - my_free((uchar*) huff_trees[i].element_buffer,MYF(0)); + my_free(huff_trees[i].element_buffer); if (huff_trees[i].code) - my_free((uchar*) huff_trees[i].code,MYF(0)); + my_free(huff_trees[i].code); } - my_free((uchar*) huff_trees,MYF(0)); + my_free(huff_trees); } if (huff_counts) { @@ -869,11 +868,11 @@ static void free_counts_and_tree_and_queue(HUFF_TREE *huff_trees, uint trees, { if (huff_counts[i].tree_buff) { - my_free((uchar*) huff_counts[i].tree_buff,MYF(0)); + my_free(huff_counts[i].tree_buff); delete_tree(&huff_counts[i].int_tree); } } - my_free((uchar*) huff_counts,MYF(0)); + my_free(huff_counts); } delete_queue(&queue); /* This is safe to free */ return; @@ -977,7 +976,7 @@ static int get_statistic(PACK_MRG_INFO *mrg,HUFF_COUNTS *huff_counts) count->int_tree.elements_in_tree > 1)) { delete_tree(&count->int_tree); - my_free(count->tree_buff,MYF(0)); + my_free(count->tree_buff); count->tree_buff=0; } else @@ -1374,12 +1373,12 @@ static void check_counts(HUFF_COUNTS *huff_counts, uint trees, } else { - my_free((uchar*) huff_counts->tree_buff,MYF(0)); + my_free(huff_counts->tree_buff); delete_tree(&huff_counts->int_tree); huff_counts->tree_buff=0; } if (tree.element_buffer) - my_free((uchar*) tree.element_buffer,MYF(0)); + my_free(tree.element_buffer); } if (huff_counts->pack_type & PACK_TYPE_SPACE_FIELDS) space_fields++; @@ -1496,8 +1495,8 @@ static HUFF_TREE* make_huff_trees(HUFF_COUNTS *huff_counts, uint trees) if (make_huff_tree(huff_tree+tree,huff_counts+tree)) { while (tree--) - my_free((uchar*) huff_tree[tree].element_buffer,MYF(0)); - my_free((uchar*) huff_tree,MYF(0)); + my_free(huff_tree[tree].element_buffer); + my_free(huff_tree); DBUG_RETURN(0); } } @@ -1907,7 +1906,7 @@ static uint join_same_trees(HUFF_COUNTS *huff_counts, uint trees) { memcpy_fixed((uchar*) i->counts,(uchar*) count.counts, sizeof(count.counts[0])*256); - my_free((uchar*) j->tree->element_buffer,MYF(0)); + my_free(j->tree->element_buffer); j->tree->element_buffer=0; j->tree=i->tree; bmove((uchar*) i->counts,(uchar*) count.counts, @@ -2913,7 +2912,7 @@ static int flush_buffer(ulong neaded_length) static void end_file_buffer(void) { - my_free((uchar*) file_buffer.buffer,MYF(0)); + my_free(file_buffer.buffer); } /* output `bits` low bits of `value' */ @@ -3117,7 +3116,7 @@ static int mrg_close(PACK_MRG_INFO *mrg) for (i=0 ; i < mrg->count ; i++) error|=mi_close(mrg->file[i]); if (mrg->free_file) - my_free((uchar*) mrg->file,MYF(0)); + my_free(mrg->file); return error; } @@ -3180,7 +3179,7 @@ static void fakebigcodes(HUFF_COUNTS *huff_counts, HUFF_COUNTS *end_count) */ if (huff_counts->tree_buff) { - my_free((uchar*) huff_counts->tree_buff, MYF(0)); + my_free(huff_counts->tree_buff); delete_tree(&huff_counts->int_tree); huff_counts->tree_buff= NULL; DBUG_PRINT("fakebigcodes", ("freed distinct column values")); diff --git a/storage/myisam/rt_index.c b/storage/myisam/rt_index.c index 410badd3145..32cf1fd924d 100644 --- a/storage/myisam/rt_index.c +++ b/storage/myisam/rt_index.c @@ -972,7 +972,7 @@ int rtree_delete(MI_INFO *info, uint keynr, uchar *key, uint key_length) goto err1; } if (ReinsertList.pages) - my_free((uchar*) ReinsertList.pages, MYF(0)); + my_free(ReinsertList.pages); /* check for redundant root (not leaf, 1 child) and eliminate */ if ((old_root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR) diff --git a/storage/myisam/sort.c b/storage/myisam/sort.c index 539630899f4..a824de8c9fb 100644 --- a/storage/myisam/sort.c +++ b/storage/myisam/sort.c @@ -162,7 +162,7 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages, if (my_init_dynamic_array(&buffpek, sizeof(BUFFPEK), maxbuffer, maxbuffer/2)) { - my_free((uchar*) sort_keys,MYF(0)); + my_free(sort_keys); sort_keys= 0; } else @@ -242,8 +242,7 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages, error =0; err: - if (sort_keys) - my_free((uchar*) sort_keys,MYF(0)); + my_free(sort_keys); delete_dynamic(&buffpek); close_cached_file(&tempfile); close_cached_file(&tempfile_for_exceptions); @@ -382,7 +381,7 @@ pthread_handler_t thr_find_all_keys(void *arg) if (my_init_dynamic_array(&sort_param->buffpek, sizeof(BUFFPEK), maxbuffer, maxbuffer/2)) { - my_free((uchar*) sort_keys,MYF(0)); + my_free(sort_keys); sort_keys= (uchar **) NULL; /* for err: label */ } else @@ -451,8 +450,7 @@ pthread_handler_t thr_find_all_keys(void *arg) err: DBUG_PRINT("error", ("got some error")); sort_param->sort_info->got_error= 1; /* no need to protect with a mutex */ - if (sort_keys) - my_free((uchar*) sort_keys,MYF(0)); + my_free(sort_keys); sort_param->sort_keys= 0; delete_dynamic(& sort_param->buffpek); close_cached_file(&sort_param->tempfile); @@ -509,8 +507,7 @@ int thr_write_keys(MI_SORT_PARAM *sort_param) if (!sinfo->sort_keys) { got_error=1; - my_free(mi_get_rec_buff_ptr(info, sinfo->rec_buff), - MYF(MY_ALLOW_ZERO_PTR)); + my_free(mi_get_rec_buff_ptr(info, sinfo->rec_buff)); continue; } if (!got_error) @@ -528,9 +525,8 @@ int thr_write_keys(MI_SORT_PARAM *sort_param) got_error=1; } } - my_free((uchar*) sinfo->sort_keys,MYF(0)); - my_free(mi_get_rec_buff_ptr(info, sinfo->rec_buff), - MYF(MY_ALLOW_ZERO_PTR)); + my_free(sinfo->sort_keys); + my_free(mi_get_rec_buff_ptr(info, sinfo->rec_buff)); sinfo->sort_keys=0; } @@ -638,7 +634,7 @@ int thr_write_keys(MI_SORT_PARAM *sort_param) sinfo->notnull : NULL, (ulonglong) info->state->records); } - my_free((uchar*) mergebuf,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mergebuf); DBUG_RETURN(got_error); } #endif /* THREAD */ @@ -1057,7 +1053,7 @@ flush_ft_buf(MI_SORT_PARAM *info) if (info->sort_info->ft_buf) { err=sort_ft_buf_flush(info); - my_free((uchar*)info->sort_info->ft_buf, MYF(0)); + my_free(info->sort_info->ft_buf); info->sort_info->ft_buf=0; } return err; |