diff options
author | unknown <serg@serg.mylan> | 2006-05-30 18:15:18 +0200 |
---|---|---|
committer | unknown <serg@serg.mylan> | 2006-05-30 18:15:18 +0200 |
commit | 15a13203f198102a74462cc5ffb5bbb8dc652a3f (patch) | |
tree | b1cfd64caab412e06dc9f1423722025c190d194f /storage/myisam/mi_check.c | |
parent | f1bb09e777427145f614c52488ead02a62e062e2 (diff) | |
download | mariadb-git-15a13203f198102a74462cc5ffb5bbb8dc652a3f.tar.gz |
Now ftparser does not need to bother about memory management -
it can tell MySQL to make a copy of everything (bug#17123)
include/mysql/plugin.h:
Now ftparser does not need to bother about memory management -
it can tell MySQL to make a copy of everything (bug#17123)
MYSQL_FTFLAGS_NEED_COPY flag
storage/myisam/ft_boolean_search.c:
param->flags
storage/myisam/ft_nlq_search.c:
param->flags. ft_parse takes a mem_root as an argument
storage/myisam/ft_parser.c:
ftparser takes a memroot as an argument. words are copied there, if necessary.
memroot is reset for every parsing and free'd at the end of the statement.
storage/myisam/ft_update.c:
ftparser takes a memroot as an argument. words are copied there, if necessary.
memroot is reset for every parsing and free'd at the end of the statement.
storage/myisam/ftdefs.h:
ftparser takes a memroot as an argument. words are copied there, if necessary.
memroot is reset for every parsing and free'd at the end of the statement.
storage/myisam/mi_check.c:
ftparser takes a memroot as an argument. words are copied there, if necessary
storage/myisam/myisamdef.h:
memroot for ftparser in MI_INFO and MI_SORT_PARAM
storage/myisam/sort.c:
free ftparser memroot
Diffstat (limited to 'storage/myisam/mi_check.c')
-rw-r--r-- | storage/myisam/mi_check.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index 0fa095a21db..df0d363f7c3 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -2117,6 +2117,7 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info, my_seek(param->read_cache.file,0L,MY_SEEK_END,MYF(0)); sort_param.wordlist=NULL; + init_alloc_root(&sort_param.wordroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0); if (share->data_file_type == DYNAMIC_RECORD) length=max(share->base.min_pack_length+1,share->base.min_block_length); @@ -2200,6 +2201,7 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info, goto err; } param->calc_checksum=0; /* No need to calc glob_crc */ + free_root(&sort_param.wordroot, MYF(0)); /* Set for next loop */ sort_info.max_records= (ha_rows) info->state->records; @@ -2589,6 +2591,7 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info, uint ft_max_word_len_for_sort=FT_MAX_WORD_LEN_FOR_SORT* sort_param[i].keyinfo->seg->charset->mbmaxlen; sort_param[i].key_length+=ft_max_word_len_for_sort-HA_FT_MAXBYTELEN; + init_alloc_root(&sort_param[i].wordroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0); } } sort_info.total_keys=i; @@ -2810,10 +2813,11 @@ static int sort_ft_key_read(MI_SORT_PARAM *sort_param, void *key) { for (;;) { - my_free((char*) wptr, MYF(MY_ALLOW_ZERO_PTR)); + free_root(&sort_param->wordroot, MYF(MY_MARK_BLOCKS_FREE)); if ((error=sort_get_next_record(sort_param))) DBUG_RETURN(error); - if (!(wptr=_mi_ft_parserecord(info,sort_param->key,sort_param->record))) + if (!(wptr=_mi_ft_parserecord(info,sort_param->key,sort_param->record, + &sort_param->wordroot))) DBUG_RETURN(1); if (wptr->pos) break; @@ -2837,7 +2841,7 @@ static int sort_ft_key_read(MI_SORT_PARAM *sort_param, void *key) #endif if (!wptr->pos) { - my_free((char*) sort_param->wordlist, MYF(0)); + free_root(&sort_param->wordroot, MYF(MY_MARK_BLOCKS_FREE)); sort_param->wordlist=0; error=sort_write_record(sort_param); } |