cleanup: use MYF() for mysys flags

This commit is contained in:
Sergei Golubchik 2013-01-23 16:18:09 +01:00
parent a260b15554
commit 682da0aa75
71 changed files with 136 additions and 137 deletions

View File

@ -49,7 +49,7 @@ int completion_hash_init(HashTable *ht, uint nSize)
ht->initialized = 0; ht->initialized = 0;
return FAILURE; return FAILURE;
} }
init_alloc_root(&ht->mem_root, 8192, 0, 0); init_alloc_root(&ht->mem_root, 8192, 0, MYF(0));
ht->pHashFunction = hashpjw; ht->pHashFunction = hashpjw;
ht->nTableSize = nSize; ht->nTableSize = nSize;
ht->initialized = 1; ht->initialized = 1;

View File

@ -1157,7 +1157,7 @@ int main(int argc,char *argv[])
} }
glob_buffer.realloc(512); glob_buffer.realloc(512);
completion_hash_init(&ht, 128); completion_hash_init(&ht, 128);
init_alloc_root(&hash_mem_root, 16384, 0, 0); init_alloc_root(&hash_mem_root, 16384, 0, MYF(0));
bzero((char*) &mysql, sizeof(mysql)); bzero((char*) &mysql, sizeof(mysql));
if (sql_connect(current_host,current_db,current_user,opt_password, if (sql_connect(current_host,current_db,current_user,opt_password,
opt_silent)) opt_silent))

View File

@ -279,7 +279,7 @@ public:
int init() int init()
{ {
return my_init_dynamic_array(&file_names, sizeof(File_name_record), return my_init_dynamic_array(&file_names, sizeof(File_name_record),
100, 100, 0); 100, 100, MYF(0));
} }
void init_by_dir_name(const char *dir) void init_by_dir_name(const char *dir)
@ -2393,7 +2393,7 @@ int main(int argc, char** argv)
my_init_time(); // for time functions my_init_time(); // for time functions
init_alloc_root(&s_mem_root, 16384, 0, 0); init_alloc_root(&s_mem_root, 16384, 0, MYF(0));
if (load_defaults("my", load_groups, &argc, &argv)) if (load_defaults("my", load_groups, &argc, &argv))
exit(1); exit(1);

View File

@ -995,9 +995,9 @@ int main(int argc, char **argv)
if (opt_auto_repair && if (opt_auto_repair &&
(my_init_dynamic_array(&tables4repair, sizeof(char)*(NAME_LEN*2+2),16, (my_init_dynamic_array(&tables4repair, sizeof(char)*(NAME_LEN*2+2),16,
64, 0) || 64, MYF(0)) ||
my_init_dynamic_array(&tables4rebuild, sizeof(char)*(NAME_LEN*2+2),16, my_init_dynamic_array(&tables4rebuild, sizeof(char)*(NAME_LEN*2+2),16,
64, 0))) 64, MYF(0))))
goto end; goto end;
if (opt_alldbs) if (opt_alldbs)

View File

@ -4583,7 +4583,7 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
if (init_dumping(db, init_dumping_tables)) if (init_dumping(db, init_dumping_tables))
DBUG_RETURN(1); DBUG_RETURN(1);
init_alloc_root(&root, 8192, 0, 0); init_alloc_root(&root, 8192, 0, MYF(0));
if (!(dump_tables= pos= (char**) alloc_root(&root, tables * sizeof(char *)))) if (!(dump_tables= pos= (char**) alloc_root(&root, tables * sizeof(char *))))
die(EX_EOM, "alloc_root failure."); die(EX_EOM, "alloc_root failure.");

View File

@ -8899,7 +8899,7 @@ int main(int argc, char **argv)
cur_block->ok= TRUE; /* Outer block should always be executed */ cur_block->ok= TRUE; /* Outer block should always be executed */
cur_block->cmd= cmd_none; cur_block->cmd= cmd_none;
my_init_dynamic_array(&q_lines, sizeof(struct st_command*), 1024, 1024, 0); my_init_dynamic_array(&q_lines, sizeof(struct st_command*), 1024, 1024, MYF(0));
if (my_hash_init2(&var_hash, 64, charset_info, if (my_hash_init2(&var_hash, 64, charset_info,
128, 0, 0, get_var_key, var_free, MYF(0))) 128, 0, 0, get_var_key, var_free, MYF(0)))
@ -8929,7 +8929,7 @@ int main(int argc, char **argv)
#endif #endif
init_dynamic_string(&ds_res, "", 2048, 2048); init_dynamic_string(&ds_res, "", 2048, 2048);
init_alloc_root(&require_file_root, 1024, 1024, 0); init_alloc_root(&require_file_root, 1024, 1024, MYF(0));
parse_args(argc, argv); parse_args(argc, argv);
@ -9873,7 +9873,7 @@ struct st_replace_regex* init_replace_regex(char* expr)
/* my_malloc() will die on fail with MY_FAE */ /* my_malloc() will die on fail with MY_FAE */
res=(struct st_replace_regex*)my_malloc( res=(struct st_replace_regex*)my_malloc(
sizeof(*res)+expr_len ,MYF(MY_FAE+MY_WME)); sizeof(*res)+expr_len ,MYF(MY_FAE+MY_WME));
my_init_dynamic_array(&res->regex_arr,sizeof(struct st_regex), 128, 128, 0); my_init_dynamic_array(&res->regex_arr,sizeof(struct st_regex), 128, 128, MYF(0));
buf= (char*)res + sizeof(*res); buf= (char*)res + sizeof(*res);
expr_end= expr + expr_len; expr_end= expr + expr_len;
@ -10928,7 +10928,7 @@ void dynstr_append_sorted(DYNAMIC_STRING* ds, DYNAMIC_STRING *ds_input,
if (!*start) if (!*start)
DBUG_VOID_RETURN; /* No input */ DBUG_VOID_RETURN; /* No input */
my_init_dynamic_array(&lines, sizeof(const char*), 32, 32, 0); my_init_dynamic_array(&lines, sizeof(const char*), 32, 32, MYF(0));
if (keep_header) if (keep_header)
{ {

View File

@ -894,7 +894,7 @@ static struct errors *generate_empty_message(uint d_code)
if (!(new_error= (struct errors *) my_malloc(sizeof(*new_error), if (!(new_error= (struct errors *) my_malloc(sizeof(*new_error),
MYF(MY_WME)))) MYF(MY_WME))))
return(0); return(0);
if (my_init_dynamic_array(&new_error->msg, sizeof(struct message), 0, 1, 0)) if (my_init_dynamic_array(&new_error->msg, sizeof(struct message), 0, 1, MYF(0)))
return(0); /* OOM: Fatal error */ return(0); /* OOM: Fatal error */
new_error->er_name= NULL; new_error->er_name= NULL;
@ -928,7 +928,7 @@ static struct errors *parse_error_string(char *str, int er_count)
MYF(MY_WME)))) MYF(MY_WME))))
DBUG_RETURN(0); DBUG_RETURN(0);
if (my_init_dynamic_array(&new_error->msg, sizeof(struct message), 0, 0, 0)) if (my_init_dynamic_array(&new_error->msg, sizeof(struct message), 0, 0, MYF(0)))
DBUG_RETURN(0); /* OOM: Fatal error */ DBUG_RETURN(0); /* OOM: Fatal error */
/* getting the error name */ /* getting the error name */

View File

@ -223,7 +223,7 @@ static void init_sym_table()
{ {
char buf[512]; char buf[512];
if (my_init_dynamic_array(&sym_table, sizeof(SYM_ENTRY), INIT_SYM_TABLE, if (my_init_dynamic_array(&sym_table, sizeof(SYM_ENTRY), INIT_SYM_TABLE,
INC_SYM_TABLE, 0)) INC_SYM_TABLE, MYF(0)))
die("Failed in my_init_dynamic_array() -- looks like out of memory problem"); die("Failed in my_init_dynamic_array() -- looks like out of memory problem");
while (fgets(buf, sizeof(buf), fp_sym)) while (fgets(buf, sizeof(buf), fp_sym))

View File

@ -1520,8 +1520,8 @@ mysql_stmt_init(MYSQL *mysql)
DBUG_RETURN(NULL); DBUG_RETURN(NULL);
} }
init_alloc_root(&stmt->mem_root, 2048, 2048, MY_THREAD_SPECIFIC); init_alloc_root(&stmt->mem_root, 2048, 2048, MYF(MY_THREAD_SPECIFIC));
init_alloc_root(&stmt->result.alloc, 4096, 4096, MY_THREAD_SPECIFIC); init_alloc_root(&stmt->result.alloc, 4096, 4096, MYF(MY_THREAD_SPECIFIC));
stmt->result.alloc.min_malloc= sizeof(MYSQL_ROWS); stmt->result.alloc.min_malloc= sizeof(MYSQL_ROWS);
mysql->stmts= list_add(mysql->stmts, &stmt->list); mysql->stmts= list_add(mysql->stmts, &stmt->list);
stmt->list.data= stmt; stmt->list.data= stmt;

View File

@ -415,7 +415,7 @@ int emb_load_querycache_result(THD *thd, Querycache_stream *src)
if (!data) if (!data)
goto err; goto err;
init_alloc_root(&data->alloc, 8192,0,0); init_alloc_root(&data->alloc, 8192,0,MYF(0));
f_alloc= &data->alloc; f_alloc= &data->alloc;
data->fields= src->load_int(); data->fields= src->load_int();

View File

@ -634,7 +634,7 @@ void init_embedded_mysql(MYSQL *mysql, int client_flag)
mysql->server_version= server_version; mysql->server_version= server_version;
mysql->client_flag= client_flag; mysql->client_flag= client_flag;
//mysql->server_capabilities= client_flag; //mysql->server_capabilities= client_flag;
init_alloc_root(&mysql->field_alloc, 8192, 0, 0); init_alloc_root(&mysql->field_alloc, 8192, 0, MYF(0));
} }
/** /**

View File

@ -520,7 +520,7 @@ int my_load_defaults(const char *conf_file, const char **groups,
uint args_sep= my_getopt_use_args_separator ? 1 : 0; uint args_sep= my_getopt_use_args_separator ? 1 : 0;
DBUG_ENTER("load_defaults"); DBUG_ENTER("load_defaults");
init_alloc_root(&alloc, 512, 0, 0); init_alloc_root(&alloc, 512, 0, MYF(0));
if ((dirs= init_default_directories(&alloc)) == NULL) if ((dirs= init_default_directories(&alloc)) == NULL)
goto err; goto err;
/* /*
@ -566,7 +566,7 @@ int my_load_defaults(const char *conf_file, const char **groups,
for (; *groups ; groups++) for (; *groups ; groups++)
group.count++; group.count++;
if (my_init_dynamic_array(&args, sizeof(char*),*argc, 32, 0)) if (my_init_dynamic_array(&args, sizeof(char*),*argc, 32, MYF(0)))
goto err; goto err;
ctx.alloc= &alloc; ctx.alloc= &alloc;
@ -1043,7 +1043,7 @@ void my_print_default_files(const char *conf_file)
{ {
const char **dirs; const char **dirs;
MEM_ROOT alloc; MEM_ROOT alloc;
init_alloc_root(&alloc, 512, 0, 0); init_alloc_root(&alloc, 512, 0, MYF(0));
if ((dirs= init_default_directories(&alloc)) == NULL) if ((dirs= init_default_directories(&alloc)) == NULL)
{ {

View File

@ -2410,7 +2410,7 @@ dynamic_column_list(DYNAMIC_COLUMN *str, DYNAMIC_ARRAY *array_of_uint)
return ER_DYNCOL_FORMAT; return ER_DYNCOL_FORMAT;
if (my_init_dynamic_array(array_of_uint, sizeof(uint), header.column_count, if (my_init_dynamic_array(array_of_uint, sizeof(uint), header.column_count,
0, 0)) 0, MYF(0)))
return ER_DYNCOL_RESOURCE; return ER_DYNCOL_RESOURCE;
for (i= 0, read= header.header; for (i= 0, read= header.header;

View File

@ -30,7 +30,7 @@ my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist)
DBUG_PRINT("enter", ("pathlist: %s", pathlist ? pathlist : "NULL")); DBUG_PRINT("enter", ("pathlist: %s", pathlist ? pathlist : "NULL"));
mysql_mutex_init(key_TMPDIR_mutex, &tmpdir->mutex, MY_MUTEX_INIT_FAST); mysql_mutex_init(key_TMPDIR_mutex, &tmpdir->mutex, MY_MUTEX_INIT_FAST);
if (my_init_dynamic_array(&tmpdir->full_list, sizeof(char*), 1, 5, 0)) if (my_init_dynamic_array(&tmpdir->full_list, sizeof(char*), 1, 5, MYF(0)))
goto err; goto err;
if (!pathlist || !pathlist[0]) if (!pathlist || !pathlist[0])
{ {

View File

@ -123,13 +123,13 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
if (my_init_dynamic_array(dir_entries_storage, sizeof(FILEINFO), if (my_init_dynamic_array(dir_entries_storage, sizeof(FILEINFO),
ENTRIES_START_SIZE, ENTRIES_INCREMENT, ENTRIES_START_SIZE, ENTRIES_INCREMENT,
MyFlags)) MYF(MyFlags)))
{ {
my_free(buffer); my_free(buffer);
goto error; goto error;
} }
init_alloc_root(names_storage, NAMES_START_SIZE, NAMES_START_SIZE, init_alloc_root(names_storage, NAMES_START_SIZE, NAMES_START_SIZE,
MyFlags); MYF(MyFlags));
/* MY_DIR structure is allocated and completly initialized at this point */ /* MY_DIR structure is allocated and completly initialized at this point */
result= (MY_DIR*)buffer; result= (MY_DIR*)buffer;
@ -266,12 +266,12 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
if (my_init_dynamic_array(dir_entries_storage, sizeof(FILEINFO), if (my_init_dynamic_array(dir_entries_storage, sizeof(FILEINFO),
ENTRIES_START_SIZE, ENTRIES_INCREMENT, ENTRIES_START_SIZE, ENTRIES_INCREMENT,
MyFlags)) MYF(MyFlags)))
{ {
my_free(buffer); my_free(buffer);
goto error; goto error;
} }
init_alloc_root(names_storage, NAMES_START_SIZE, NAMES_START_SIZE, MyFlags); init_alloc_root(names_storage, NAMES_START_SIZE, NAMES_START_SIZE, MYF(MyFlags));
/* MY_DIR structure is allocated and completly initialized at this point */ /* MY_DIR structure is allocated and completly initialized at this point */
result= (MY_DIR*)buffer; result= (MY_DIR*)buffer;

View File

@ -129,8 +129,7 @@ void init_tree(TREE *tree, size_t default_alloc_size, size_t memory_limit,
} }
if (!(tree->with_delete= test(my_flags & MY_TREE_WITH_DELETE))) if (!(tree->with_delete= test(my_flags & MY_TREE_WITH_DELETE)))
{ {
init_alloc_root(&tree->mem_root, default_alloc_size, 0, init_alloc_root(&tree->mem_root, default_alloc_size, 0, MYF(my_flags));
my_flags);
tree->mem_root.min_malloc= sizeof(TREE_ELEMENT)+tree->size_of_element; tree->mem_root.min_malloc= sizeof(TREE_ELEMENT)+tree->size_of_element;
} }
DBUG_VOID_RETURN; DBUG_VOID_RETURN;

View File

@ -403,7 +403,7 @@ static void wt_resource_init(uchar *arg)
bzero(rc, sizeof(*rc)); bzero(rc, sizeof(*rc));
rc_rwlock_init(rc); rc_rwlock_init(rc);
mysql_cond_init(key_WT_RESOURCE_cond, &rc->cond, 0); mysql_cond_init(key_WT_RESOURCE_cond, &rc->cond, 0);
my_init_dynamic_array(&rc->owners, sizeof(WT_THD *), 0, 5, 0); my_init_dynamic_array(&rc->owners, sizeof(WT_THD *), 0, 5, MYF(0));
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
@ -509,7 +509,7 @@ void wt_thd_lazy_init(WT_THD *thd, const ulong *ds, const ulong *ts,
thd->deadlock_search_depth_long= dl; thd->deadlock_search_depth_long= dl;
thd->timeout_long= tl; thd->timeout_long= tl;
/* dynamic array is also initialized lazily - without memory allocations */ /* dynamic array is also initialized lazily - without memory allocations */
my_init_dynamic_array(&thd->my_resources, sizeof(WT_RESOURCE *), 0, 5, 0); my_init_dynamic_array(&thd->my_resources, sizeof(WT_RESOURCE *), 0, 5, MYF(0));
#ifndef DBUG_OFF #ifndef DBUG_OFF
thd->name= my_thread_name(); thd->name= my_thread_name();
#endif #endif

View File

@ -1170,7 +1170,7 @@ static int add_init_command(struct st_mysql_options *options, const char *cmd)
{ {
options->init_commands= (DYNAMIC_ARRAY*)my_malloc(sizeof(DYNAMIC_ARRAY), options->init_commands= (DYNAMIC_ARRAY*)my_malloc(sizeof(DYNAMIC_ARRAY),
MYF(MY_WME)); MYF(MY_WME));
my_init_dynamic_array(options->init_commands,sizeof(char*),5, 5, 0); my_init_dynamic_array(options->init_commands,sizeof(char*),5, 5, MYF(0));
} }
if (!(tmp= my_strdup(cmd,MYF(MY_WME))) || if (!(tmp= my_strdup(cmd,MYF(MY_WME))) ||

View File

@ -251,7 +251,7 @@ int mysql_client_plugin_init()
bzero(&mysql, sizeof(mysql)); /* dummy mysql for set_mysql_extended_error */ bzero(&mysql, sizeof(mysql)); /* dummy mysql for set_mysql_extended_error */
pthread_mutex_init(&LOCK_load_client_plugin, MY_MUTEX_INIT_SLOW); pthread_mutex_init(&LOCK_load_client_plugin, MY_MUTEX_INIT_SLOW);
init_alloc_root(&mem_root, 128, 128, 0); init_alloc_root(&mem_root, 128, 128, MYF(0));
bzero(&plugin_list, sizeof(plugin_list)); bzero(&plugin_list, sizeof(plugin_list));

View File

@ -209,7 +209,7 @@ Event_basic::Event_basic()
{ {
DBUG_ENTER("Event_basic::Event_basic"); DBUG_ENTER("Event_basic::Event_basic");
/* init memory root */ /* init memory root */
init_sql_alloc(&mem_root, 256, 512, 0); init_sql_alloc(&mem_root, 256, 512, MYF(0));
dbname.str= name.str= NULL; dbname.str= name.str= NULL;
dbname.length= name.length= 0; dbname.length= name.length= 0;
time_zone= NULL; time_zone= NULL;

View File

@ -8649,7 +8649,7 @@ NDB_SHARE *ndbcluster_get_share(const char *key, TABLE *table,
MEM_ROOT **root_ptr= MEM_ROOT **root_ptr=
my_pthread_getspecific_ptr(MEM_ROOT**, THR_MALLOC); my_pthread_getspecific_ptr(MEM_ROOT**, THR_MALLOC);
MEM_ROOT *old_root= *root_ptr; MEM_ROOT *old_root= *root_ptr;
init_sql_alloc(&share->mem_root, 1024, 0, 0); init_sql_alloc(&share->mem_root, 1024, 0, MYF(0));
*root_ptr= &share->mem_root; // remember to reset before return *root_ptr= &share->mem_root; // remember to reset before return
share->state= NSS_INITIAL; share->state= NSS_INITIAL;
/* enough space for key, db, and table_name */ /* enough space for key, db, and table_name */

View File

@ -3964,7 +3964,7 @@ restart:
my_pthread_getspecific_ptr(MEM_ROOT**, THR_MALLOC); my_pthread_getspecific_ptr(MEM_ROOT**, THR_MALLOC);
MEM_ROOT *old_root= *root_ptr; MEM_ROOT *old_root= *root_ptr;
MEM_ROOT mem_root; MEM_ROOT mem_root;
init_sql_alloc(&mem_root, 4096, 0, 0); init_sql_alloc(&mem_root, 4096, 0, MYF(0));
List<Cluster_schema> post_epoch_log_list; List<Cluster_schema> post_epoch_log_list;
List<Cluster_schema> post_epoch_unlock_list; List<Cluster_schema> post_epoch_unlock_list;
*root_ptr= &mem_root; *root_ptr= &mem_root;

View File

@ -168,7 +168,7 @@ ha_partition::ha_partition(handlerton *hton, TABLE_SHARE *share)
:handler(hton, share) :handler(hton, share)
{ {
DBUG_ENTER("ha_partition::ha_partition(table)"); DBUG_ENTER("ha_partition::ha_partition(table)");
init_alloc_root(&m_mem_root, 512, 512, 0); init_alloc_root(&m_mem_root, 512, 512, MYF(0));
init_handler_variables(); init_handler_variables();
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
@ -190,7 +190,7 @@ ha_partition::ha_partition(handlerton *hton, partition_info *part_info)
{ {
DBUG_ENTER("ha_partition::ha_partition(part_info)"); DBUG_ENTER("ha_partition::ha_partition(part_info)");
DBUG_ASSERT(part_info); DBUG_ASSERT(part_info);
init_alloc_root(&m_mem_root, 512, 512, 0); init_alloc_root(&m_mem_root, 512, 512, MYF(0));
init_handler_variables(); init_handler_variables();
m_part_info= part_info; m_part_info= part_info;
m_create_handler= TRUE; m_create_handler= TRUE;
@ -217,7 +217,7 @@ ha_partition::ha_partition(handlerton *hton, TABLE_SHARE *share,
:handler(hton, share) :handler(hton, share)
{ {
DBUG_ENTER("ha_partition::ha_partition(clone)"); DBUG_ENTER("ha_partition::ha_partition(clone)");
init_alloc_root(&m_mem_root, 512, 512, 0); init_alloc_root(&m_mem_root, 512, 512, MYF(0));
init_handler_variables(); init_handler_variables();
m_part_info= part_info_arg; m_part_info= part_info_arg;
m_create_handler= TRUE; m_create_handler= TRUE;

View File

@ -8311,7 +8311,7 @@ int TC_LOG_BINLOG::recover(LOG_INFO *linfo, const char *last_log_name,
sizeof(my_xid), 0, 0, MYF(0))) sizeof(my_xid), 0, 0, MYF(0)))
goto err1; goto err1;
init_alloc_root(&mem_root, TC_LOG_PAGE_SIZE, TC_LOG_PAGE_SIZE, 0); init_alloc_root(&mem_root, TC_LOG_PAGE_SIZE, TC_LOG_PAGE_SIZE, MYF(0));
fdle->flags&= ~LOG_EVENT_BINLOG_IN_USE_F; // abort on the first error fdle->flags&= ~LOG_EVENT_BINLOG_IN_USE_F; // abort on the first error

View File

@ -1121,7 +1121,7 @@ private:
void Buffered_logs::init() void Buffered_logs::init()
{ {
init_alloc_root(&m_root, 1024, 0, 0); init_alloc_root(&m_root, 1024, 0, MYF(0));
} }
void Buffered_logs::cleanup() void Buffered_logs::cleanup()
@ -4761,7 +4761,7 @@ int mysqld_main(int argc, char **argv)
my_getopt_skip_unknown= TRUE; my_getopt_skip_unknown= TRUE;
/* prepare all_early_options array */ /* prepare all_early_options array */
my_init_dynamic_array(&all_early_options, sizeof(my_option), 100, 25, 0); my_init_dynamic_array(&all_early_options, sizeof(my_option), 100, 25, MYF(0));
sys_var_add_options(&all_early_options, sys_var::PARSE_EARLY); sys_var_add_options(&all_early_options, sys_var::PARSE_EARLY);
add_terminator(&all_early_options); add_terminator(&all_early_options);
@ -5355,7 +5355,7 @@ static void bootstrap(MYSQL_FILE *file)
THD *thd= new THD; THD *thd= new THD;
thd->bootstrap=1; thd->bootstrap=1;
my_net_init(&thd->net,(st_vio*) 0, 0); my_net_init(&thd->net,(st_vio*) 0, MYF(0));
thd->max_client_packet_length= thd->net.max_packet; thd->max_client_packet_length= thd->net.max_packet;
thd->security_ctx->master_access= ~(ulong)0; thd->security_ctx->master_access= ~(ulong)0;
thd->thread_id= thd->variables.pseudo_thread_id= thread_id++; thd->thread_id= thd->variables.pseudo_thread_id= thread_id++;
@ -7249,7 +7249,7 @@ static int option_cmp(my_option *a, my_option *b)
static void print_help() static void print_help()
{ {
MEM_ROOT mem_root; MEM_ROOT mem_root;
init_alloc_root(&mem_root, 4096, 4096, 0); init_alloc_root(&mem_root, 4096, 4096, MYF(0));
pop_dynamic(&all_options); pop_dynamic(&all_options);
sys_var_add_options(&all_options, sys_var::PARSE_EARLY); sys_var_add_options(&all_options, sys_var::PARSE_EARLY);
@ -7941,7 +7941,7 @@ static int get_options(int *argc_ptr, char ***argv_ptr)
/* prepare all_options array */ /* prepare all_options array */
my_init_dynamic_array(&all_options, sizeof(my_option), my_init_dynamic_array(&all_options, sizeof(my_option),
array_elements(my_long_options), array_elements(my_long_options),
array_elements(my_long_options)/4, 0); array_elements(my_long_options)/4, MYF(0));
for (my_option *opt= my_long_options; for (my_option *opt= my_long_options;
opt < my_long_options + array_elements(my_long_options) - 1; opt < my_long_options + array_elements(my_long_options) - 1;
opt++) opt++)

View File

@ -573,7 +573,7 @@ void
Rpl_filter::init_table_rule_array(DYNAMIC_ARRAY* a, bool* a_inited) Rpl_filter::init_table_rule_array(DYNAMIC_ARRAY* a, bool* a_inited)
{ {
my_init_dynamic_array(a, sizeof(TABLE_RULE_ENT*), TABLE_RULE_ARR_SIZE, my_init_dynamic_array(a, sizeof(TABLE_RULE_ENT*), TABLE_RULE_ARR_SIZE,
TABLE_RULE_ARR_SIZE, 0); TABLE_RULE_ARR_SIZE, MYF(0));
*a_inited = 1; *a_inited = 1;
} }

View File

@ -189,7 +189,7 @@ void delegates_destroy()
DYNAMIC_ARRAY *plugins= &s.plugins; \ DYNAMIC_ARRAY *plugins= &s.plugins; \
plugin_ref *plugins_buffer= s.plugins_buffer; \ plugin_ref *plugins_buffer= s.plugins_buffer; \
my_init_dynamic_array2(plugins, sizeof(plugin_ref), \ my_init_dynamic_array2(plugins, sizeof(plugin_ref), \
plugins_buffer, 8, 8, 0); \ plugins_buffer, 8, 8, MYF(0)); \
read_lock(); \ read_lock(); \
Observer_info_iterator iter= observer_info_iter(); \ Observer_info_iterator iter= observer_info_iter(); \
Observer_info *info= iter++; \ Observer_info *info= iter++; \

View File

@ -124,7 +124,7 @@ public:
inited= FALSE; inited= FALSE;
if (my_rwlock_init(&lock, NULL)) if (my_rwlock_init(&lock, NULL))
return; return;
init_sql_alloc(&memroot, 1024, 0, 0); init_sql_alloc(&memroot, 1024, 0, MYF(0));
inited= TRUE; inited= TRUE;
} }
~Delegate() ~Delegate()

View File

@ -61,7 +61,7 @@ Master_info::Master_info(LEX_STRING *connection_name_arg,
my_casedn_str(system_charset_info, cmp_connection_name.str); my_casedn_str(system_charset_info, cmp_connection_name.str);
} }
my_init_dynamic_array(&ignore_server_ids, sizeof(::server_id), 16, 16, 0); my_init_dynamic_array(&ignore_server_ids, sizeof(::server_id), 16, 16, MYF(0));
bzero((char*) &file, sizeof(file)); bzero((char*) &file, sizeof(file));
mysql_mutex_init(key_master_info_run_lock, &run_lock, MY_MUTEX_INIT_FAST); mysql_mutex_init(key_master_info_run_lock, &run_lock, MY_MUTEX_INIT_FAST);
mysql_mutex_init(key_master_info_data_lock, &data_lock, MY_MUTEX_INIT_FAST); mysql_mutex_init(key_master_info_data_lock, &data_lock, MY_MUTEX_INIT_FAST);

View File

@ -46,7 +46,7 @@ table_mapping::table_mapping()
offsetof(entry,table_id),sizeof(ulong), offsetof(entry,table_id),sizeof(ulong),
0,0,0); 0,0,0);
/* We don't preallocate any block, this is consistent with m_free=0 above */ /* We don't preallocate any block, this is consistent with m_free=0 above */
init_alloc_root(&m_mem_root, TABLE_ID_HASH_SIZE*sizeof(entry), 0, 0); init_alloc_root(&m_mem_root, TABLE_ID_HASH_SIZE*sizeof(entry), 0, MYF(0));
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }

View File

@ -1117,7 +1117,7 @@ bool event_checksum_test(uchar *event_buf, ulong event_len, uint8 alg)
Deferred_log_events::Deferred_log_events(Relay_log_info *rli) : last_added(NULL) Deferred_log_events::Deferred_log_events(Relay_log_info *rli) : last_added(NULL)
{ {
my_init_dynamic_array(&array, sizeof(Log_event *), 32, 16, 0); my_init_dynamic_array(&array, sizeof(Log_event *), 32, 16, MYF(0));
} }
Deferred_log_events::~Deferred_log_events() Deferred_log_events::~Deferred_log_events()

View File

@ -510,7 +510,7 @@ sp_head::operator new(size_t size) throw()
MEM_ROOT own_root; MEM_ROOT own_root;
sp_head *sp; sp_head *sp;
init_sql_alloc(&own_root, MEM_ROOT_BLOCK_SIZE, MEM_ROOT_PREALLOC, 0); init_sql_alloc(&own_root, MEM_ROOT_BLOCK_SIZE, MEM_ROOT_PREALLOC, MYF(0));
sp= (sp_head *) alloc_root(&own_root, size); sp= (sp_head *) alloc_root(&own_root, size);
if (sp == NULL) if (sp == NULL)
DBUG_RETURN(NULL); DBUG_RETURN(NULL);
@ -594,7 +594,7 @@ sp_head::init(LEX *lex)
types of stored procedures to simplify reset_lex()/restore_lex() code. types of stored procedures to simplify reset_lex()/restore_lex() code.
*/ */
lex->trg_table_fields.empty(); lex->trg_table_fields.empty();
my_init_dynamic_array(&m_instr, sizeof(sp_instr *), 16, 8, 0); my_init_dynamic_array(&m_instr, sizeof(sp_instr *), 16, 8, MYF(0));
m_param_begin= NULL; m_param_begin= NULL;
m_param_end= NULL; m_param_end= NULL;
@ -1254,7 +1254,7 @@ sp_head::execute(THD *thd, bool merge_da_on_success)
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
/* init per-instruction memroot */ /* init per-instruction memroot */
init_sql_alloc(&execute_mem_root, MEM_ROOT_BLOCK_SIZE, 0, 0); init_sql_alloc(&execute_mem_root, MEM_ROOT_BLOCK_SIZE, 0, MYF(0));
DBUG_ASSERT(!(m_flags & IS_INVOKED)); DBUG_ASSERT(!(m_flags & IS_INVOKED));
m_flags|= IS_INVOKED; m_flags|= IS_INVOKED;
@ -1711,7 +1711,7 @@ sp_head::execute_trigger(THD *thd,
TODO: we should create sp_rcontext once per command and reuse it TODO: we should create sp_rcontext once per command and reuse it
on subsequent executions of a trigger. on subsequent executions of a trigger.
*/ */
init_sql_alloc(&call_mem_root, MEM_ROOT_BLOCK_SIZE, 0, 0); init_sql_alloc(&call_mem_root, MEM_ROOT_BLOCK_SIZE, 0, MYF(0));
thd->set_n_backup_active_arena(&call_arena, &backup_arena); thd->set_n_backup_active_arena(&call_arena, &backup_arena);
if (!(nctx= new sp_rcontext(m_pcont, 0, octx)) || if (!(nctx= new sp_rcontext(m_pcont, 0, octx)) ||
@ -1828,7 +1828,7 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount,
TODO: we should create sp_rcontext once per command and reuse TODO: we should create sp_rcontext once per command and reuse
it on subsequent executions of a function/trigger. it on subsequent executions of a function/trigger.
*/ */
init_sql_alloc(&call_mem_root, MEM_ROOT_BLOCK_SIZE, 0, 0); init_sql_alloc(&call_mem_root, MEM_ROOT_BLOCK_SIZE, 0, MYF(0));
thd->set_n_backup_active_arena(&call_arena, &backup_arena); thd->set_n_backup_active_arena(&call_arena, &backup_arena);
if (!(nctx= new sp_rcontext(m_pcont, return_value_fld, octx)) || if (!(nctx= new sp_rcontext(m_pcont, return_value_fld, octx)) ||

View File

@ -62,19 +62,19 @@ sp_pcontext::sp_pcontext()
{ {
(void) my_init_dynamic_array(&m_vars, sizeof(sp_variable_t *), (void) my_init_dynamic_array(&m_vars, sizeof(sp_variable_t *),
PCONTEXT_ARRAY_INIT_ALLOC, PCONTEXT_ARRAY_INIT_ALLOC,
PCONTEXT_ARRAY_INCREMENT_ALLOC, 0); PCONTEXT_ARRAY_INCREMENT_ALLOC, MYF(0));
(void) my_init_dynamic_array(&m_case_expr_id_lst, sizeof(int), (void) my_init_dynamic_array(&m_case_expr_id_lst, sizeof(int),
PCONTEXT_ARRAY_INIT_ALLOC, PCONTEXT_ARRAY_INIT_ALLOC,
PCONTEXT_ARRAY_INCREMENT_ALLOC, 0); PCONTEXT_ARRAY_INCREMENT_ALLOC, MYF(0));
(void) my_init_dynamic_array(&m_conds, sizeof(sp_cond_type_t *), (void) my_init_dynamic_array(&m_conds, sizeof(sp_cond_type_t *),
PCONTEXT_ARRAY_INIT_ALLOC, PCONTEXT_ARRAY_INIT_ALLOC,
PCONTEXT_ARRAY_INCREMENT_ALLOC, 0); PCONTEXT_ARRAY_INCREMENT_ALLOC, MYF(0));
(void) my_init_dynamic_array(&m_cursors, sizeof(LEX_STRING), (void) my_init_dynamic_array(&m_cursors, sizeof(LEX_STRING),
PCONTEXT_ARRAY_INIT_ALLOC, PCONTEXT_ARRAY_INIT_ALLOC,
PCONTEXT_ARRAY_INCREMENT_ALLOC, 0); PCONTEXT_ARRAY_INCREMENT_ALLOC, MYF(0));
(void) my_init_dynamic_array(&m_handlers, sizeof(sp_cond_type_t *), (void) my_init_dynamic_array(&m_handlers, sizeof(sp_cond_type_t *),
PCONTEXT_ARRAY_INIT_ALLOC, PCONTEXT_ARRAY_INIT_ALLOC,
PCONTEXT_ARRAY_INCREMENT_ALLOC, 0); PCONTEXT_ARRAY_INCREMENT_ALLOC, MYF(0));
m_label.empty(); m_label.empty();
m_children.empty(); m_children.empty();
@ -90,19 +90,19 @@ sp_pcontext::sp_pcontext(sp_pcontext *prev, label_scope_type label_scope)
{ {
(void) my_init_dynamic_array(&m_vars, sizeof(sp_variable_t *), (void) my_init_dynamic_array(&m_vars, sizeof(sp_variable_t *),
PCONTEXT_ARRAY_INIT_ALLOC, PCONTEXT_ARRAY_INIT_ALLOC,
PCONTEXT_ARRAY_INCREMENT_ALLOC, 0); PCONTEXT_ARRAY_INCREMENT_ALLOC, MYF(0));
(void) my_init_dynamic_array(&m_case_expr_id_lst, sizeof(int), (void) my_init_dynamic_array(&m_case_expr_id_lst, sizeof(int),
PCONTEXT_ARRAY_INIT_ALLOC, PCONTEXT_ARRAY_INIT_ALLOC,
PCONTEXT_ARRAY_INCREMENT_ALLOC, 0); PCONTEXT_ARRAY_INCREMENT_ALLOC, MYF(0));
(void) my_init_dynamic_array(&m_conds, sizeof(sp_cond_type_t *), (void) my_init_dynamic_array(&m_conds, sizeof(sp_cond_type_t *),
PCONTEXT_ARRAY_INIT_ALLOC, PCONTEXT_ARRAY_INIT_ALLOC,
PCONTEXT_ARRAY_INCREMENT_ALLOC, 0); PCONTEXT_ARRAY_INCREMENT_ALLOC, MYF(0));
(void) my_init_dynamic_array(&m_cursors, sizeof(LEX_STRING), (void) my_init_dynamic_array(&m_cursors, sizeof(LEX_STRING),
PCONTEXT_ARRAY_INIT_ALLOC, PCONTEXT_ARRAY_INIT_ALLOC,
PCONTEXT_ARRAY_INCREMENT_ALLOC, 0); PCONTEXT_ARRAY_INCREMENT_ALLOC, MYF(0));
(void) my_init_dynamic_array(&m_handlers, sizeof(sp_cond_type_t *), (void) my_init_dynamic_array(&m_handlers, sizeof(sp_cond_type_t *),
PCONTEXT_ARRAY_INIT_ALLOC, PCONTEXT_ARRAY_INIT_ALLOC,
PCONTEXT_ARRAY_INCREMENT_ALLOC, 0); PCONTEXT_ARRAY_INCREMENT_ALLOC, MYF(0));
m_label.empty(); m_label.empty();
m_children.empty(); m_children.empty();

View File

@ -749,13 +749,13 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
acl_cache->clear(1); // Clear locked hostname cache acl_cache->clear(1); // Clear locked hostname cache
init_sql_alloc(&mem, ACL_ALLOC_BLOCK_SIZE, 0, 0); init_sql_alloc(&mem, ACL_ALLOC_BLOCK_SIZE, 0, MYF(0));
if (init_read_record(&read_record_info,thd,table= tables[0].table,NULL,1,0, if (init_read_record(&read_record_info,thd,table= tables[0].table,NULL,1,0,
FALSE)) FALSE))
goto end; goto end;
table->use_all_columns(); table->use_all_columns();
(void) my_init_dynamic_array(&acl_hosts,sizeof(ACL_HOST), 20, 50, 0); (void) my_init_dynamic_array(&acl_hosts,sizeof(ACL_HOST), 20, 50, MYF(0));
while (!(read_record_info.read_record(&read_record_info))) while (!(read_record_info.read_record(&read_record_info)))
{ {
ACL_HOST host; ACL_HOST host;
@ -807,7 +807,7 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
goto end; goto end;
table->use_all_columns(); table->use_all_columns();
(void) my_init_dynamic_array(&acl_users,sizeof(ACL_USER), 50, 100, 0); (void) my_init_dynamic_array(&acl_users,sizeof(ACL_USER), 50, 100, MYF(0));
password_length= table->field[2]->field_length / password_length= table->field[2]->field_length /
table->field[2]->charset()->mbmaxlen; table->field[2]->charset()->mbmaxlen;
if (password_length < SCRAMBLED_PASSWORD_CHAR_LENGTH_323) if (password_length < SCRAMBLED_PASSWORD_CHAR_LENGTH_323)
@ -1009,7 +1009,7 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
goto end; goto end;
table->use_all_columns(); table->use_all_columns();
(void) my_init_dynamic_array(&acl_dbs,sizeof(ACL_DB), 50, 100, 0); (void) my_init_dynamic_array(&acl_dbs,sizeof(ACL_DB), 50, 100, MYF(0));
while (!(read_record_info.read_record(&read_record_info))) while (!(read_record_info.read_record(&read_record_info)))
{ {
ACL_DB db; ACL_DB db;
@ -1067,7 +1067,7 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
freeze_size(&acl_dbs); freeze_size(&acl_dbs);
(void) my_init_dynamic_array(&acl_proxy_users, sizeof(ACL_PROXY_USER), (void) my_init_dynamic_array(&acl_proxy_users, sizeof(ACL_PROXY_USER),
50, 100, 0); 50, 100, MYF(0));
if (tables[3].table) if (tables[3].table)
{ {
init_read_record(&read_record_info, thd, table= tables[3].table, NULL, 1, init_read_record(&read_record_info, thd, table= tables[3].table, NULL, 1,
@ -1722,7 +1722,7 @@ static void init_check_host(void)
{ {
DBUG_ENTER("init_check_host"); DBUG_ENTER("init_check_host");
(void) my_init_dynamic_array(&acl_wild_hosts,sizeof(struct acl_host_and_ip), (void) my_init_dynamic_array(&acl_wild_hosts,sizeof(struct acl_host_and_ip),
acl_users.elements, 1, 0); acl_users.elements, 1, MYF(0));
(void) my_hash_init(&acl_check_hosts,system_charset_info, (void) my_hash_init(&acl_check_hosts,system_charset_info,
acl_users.elements, 0, 0, acl_users.elements, 0, 0,
(my_hash_get_key) check_get_key, 0, 0); (my_hash_get_key) check_get_key, 0, 0);
@ -4412,7 +4412,7 @@ my_bool grant_reload(THD *thd)
opertion possible in case of failure. opertion possible in case of failure.
*/ */
old_mem= memex; old_mem= memex;
init_sql_alloc(&memex, ACL_ALLOC_BLOCK_SIZE, 0, 0); init_sql_alloc(&memex, ACL_ALLOC_BLOCK_SIZE, 0, MYF(0));
if ((return_val= grant_load(thd, tables))) if ((return_val= grant_load(thd, tables)))
{ // Error. Revert to old hash { // Error. Revert to old hash

View File

@ -101,7 +101,7 @@ public:
Dynamic_array(uint prealloc=16, uint increment=16) Dynamic_array(uint prealloc=16, uint increment=16)
{ {
my_init_dynamic_array(&array, sizeof(Elem), prealloc, increment, my_init_dynamic_array(&array, sizeof(Elem), prealloc, increment,
MY_THREAD_SPECIFIC); MYF(MY_THREAD_SPECIFIC));
} }
Elem& at(int idx) Elem& at(int idx)

View File

@ -156,7 +156,7 @@ static my_bool acquire_plugins(THD *thd, plugin_ref plugin, void *arg)
{ {
/* specify some reasonable initialization defaults */ /* specify some reasonable initialization defaults */
my_init_dynamic_array(&thd->audit_class_plugins, my_init_dynamic_array(&thd->audit_class_plugins,
sizeof(plugin_ref), 16, 16, 0); sizeof(plugin_ref), 16, 16, MYF(0));
} }
/* lock the plugin and add it to the list */ /* lock the plugin and add it to the list */

View File

@ -4973,7 +4973,7 @@ bool open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags,
anything yet, to avoid penalty for statements which don't use views anything yet, to avoid penalty for statements which don't use views
and thus new .FRM format. and thus new .FRM format.
*/ */
init_sql_alloc(&new_frm_mem, 8024, 0, 0); init_sql_alloc(&new_frm_mem, 8024, 0, MYF(0));
thd->current_tablenr= 0; thd->current_tablenr= 0;
restart: restart:

View File

@ -935,7 +935,7 @@ THD::THD()
/* For user vars replication*/ /* For user vars replication*/
if (opt_bin_log) if (opt_bin_log)
my_init_dynamic_array(&user_var_events, my_init_dynamic_array(&user_var_events,
sizeof(BINLOG_USER_VAR_EVENT *), 16, 16, 0); sizeof(BINLOG_USER_VAR_EVENT *), 16, 16, MYF(0));
else else
bzero((char*) &user_var_events, sizeof(user_var_events)); bzero((char*) &user_var_events, sizeof(user_var_events));

View File

@ -1429,7 +1429,7 @@ public:
m_locked_tables_count(0) m_locked_tables_count(0)
{ {
init_sql_alloc(&m_locked_tables_root, MEM_ROOT_BLOCK_SIZE, 0, init_sql_alloc(&m_locked_tables_root, MEM_ROOT_BLOCK_SIZE, 0,
MY_THREAD_SPECIFIC); MYF(MY_THREAD_SPECIFIC));
} }
void unlock_locked_tables(THD *thd); void unlock_locked_tables(THD *thd);
~Locked_tables_list() ~Locked_tables_list()
@ -1886,7 +1886,7 @@ public:
bzero((char*)this, sizeof(*this)); bzero((char*)this, sizeof(*this));
xid_state.xid.null(); xid_state.xid.null();
init_sql_alloc(&mem_root, ALLOC_ROOT_MIN_BLOCK_SIZE, 0, init_sql_alloc(&mem_root, ALLOC_ROOT_MIN_BLOCK_SIZE, 0,
MY_THREAD_SPECIFIC); MYF(MY_THREAD_SPECIFIC));
} }
} transaction; } transaction;
Global_read_lock global_read_lock; Global_read_lock global_read_lock;

View File

@ -305,7 +305,7 @@ struct LEX_MASTER_INFO
{ {
bzero(this, sizeof(*this)); bzero(this, sizeof(*this));
my_init_dynamic_array(&repl_ignore_server_ids, my_init_dynamic_array(&repl_ignore_server_ids,
sizeof(::server_id), 0, 16, 0); sizeof(::server_id), 0, 16, MYF(0));
} }
void reset() void reset()
{ {

View File

@ -1114,7 +1114,7 @@ static bool plugin_add(MEM_ROOT *tmp_root,
plugin_array_version++; plugin_array_version++;
if (my_hash_insert(&plugin_hash[plugin->type], (uchar*)tmp_plugin_ptr)) if (my_hash_insert(&plugin_hash[plugin->type], (uchar*)tmp_plugin_ptr))
tmp_plugin_ptr->state= PLUGIN_IS_FREED; tmp_plugin_ptr->state= PLUGIN_IS_FREED;
init_alloc_root(&tmp_plugin_ptr->mem_root, 4096, 4096, 0); init_alloc_root(&tmp_plugin_ptr->mem_root, 4096, 4096, MYF(0));
if (name->str) if (name->str)
DBUG_RETURN(FALSE); // all done DBUG_RETURN(FALSE); // all done
@ -1507,8 +1507,8 @@ int plugin_init(int *argc, char **argv, int flags)
init_plugin_psi_keys(); init_plugin_psi_keys();
#endif #endif
init_alloc_root(&plugin_mem_root, 4096, 4096, 0); init_alloc_root(&plugin_mem_root, 4096, 4096, MYF(0));
init_alloc_root(&tmp_root, 4096, 4096, 0); init_alloc_root(&tmp_root, 4096, 4096, MYF(0));
if (my_hash_init(&bookmark_hash, &my_charset_bin, 16, 0, 0, if (my_hash_init(&bookmark_hash, &my_charset_bin, 16, 0, 0,
get_bookmark_hash_key, NULL, HASH_UNIQUE)) get_bookmark_hash_key, NULL, HASH_UNIQUE))
@ -1518,9 +1518,9 @@ int plugin_init(int *argc, char **argv, int flags)
mysql_mutex_init(key_LOCK_plugin, &LOCK_plugin, MY_MUTEX_INIT_FAST); mysql_mutex_init(key_LOCK_plugin, &LOCK_plugin, MY_MUTEX_INIT_FAST);
if (my_init_dynamic_array(&plugin_dl_array, if (my_init_dynamic_array(&plugin_dl_array,
sizeof(struct st_plugin_dl *),16,16,0) || sizeof(struct st_plugin_dl *), 16, 16, MYF(0)) ||
my_init_dynamic_array(&plugin_array, my_init_dynamic_array(&plugin_array,
sizeof(struct st_plugin_int *),16,16,0)) sizeof(struct st_plugin_int *), 16, 16, MYF(0)))
goto err; goto err;
for (i= 0; i < MYSQL_MAX_PLUGIN_TYPE_NUM; i++) for (i= 0; i < MYSQL_MAX_PLUGIN_TYPE_NUM; i++)

View File

@ -209,7 +209,7 @@ static bool servers_load(THD *thd, TABLE_LIST *tables)
my_hash_reset(&servers_cache); my_hash_reset(&servers_cache);
free_root(&mem, MYF(0)); free_root(&mem, MYF(0));
init_sql_alloc(&mem, ACL_ALLOC_BLOCK_SIZE, 0, 0); init_sql_alloc(&mem, ACL_ALLOC_BLOCK_SIZE, 0, MYF(0));
if (init_read_record(&read_record_info,thd,table=tables[0].table,NULL,1,0, if (init_read_record(&read_record_info,thd,table=tables[0].table,NULL,1,0,
FALSE)) FALSE))

View File

@ -458,7 +458,7 @@ bool
ignore_db_dirs_init() ignore_db_dirs_init()
{ {
return my_init_dynamic_array(&ignore_db_dirs_array, sizeof(LEX_STRING *), return my_init_dynamic_array(&ignore_db_dirs_array, sizeof(LEX_STRING *),
0, 0, 0); 0, 0, MYF(0));
} }
@ -2676,7 +2676,7 @@ int add_status_vars(SHOW_VAR *list)
if (status_vars_inited) if (status_vars_inited)
mysql_mutex_lock(&LOCK_status); mysql_mutex_lock(&LOCK_status);
if (!all_status_vars.buffer && // array is not allocated yet - do it now if (!all_status_vars.buffer && // array is not allocated yet - do it now
my_init_dynamic_array(&all_status_vars, sizeof(SHOW_VAR), 200, 20, 0)) my_init_dynamic_array(&all_status_vars, sizeof(SHOW_VAR), 200, 20, MYF(0)))
{ {
res= 1; res= 1;
goto err; goto err;
@ -4399,7 +4399,7 @@ static int fill_schema_table_from_frm(THD *thd, TABLE_LIST *tables,
if (schema_table->i_s_requested_object & OPEN_TRIGGER_ONLY) if (schema_table->i_s_requested_object & OPEN_TRIGGER_ONLY)
{ {
init_sql_alloc(&tbl.mem_root, TABLE_ALLOC_BLOCK_SIZE, 0, 0); init_sql_alloc(&tbl.mem_root, TABLE_ALLOC_BLOCK_SIZE, 0, MYF(0));
if (!Table_triggers_list::check_n_load(thd, db_name->str, if (!Table_triggers_list::check_n_load(thd, db_name->str,
table_name->str, &tbl, 1)) table_name->str, &tbl, 1))
{ {

View File

@ -1779,7 +1779,7 @@ bool Table_triggers_list::drop_all_triggers(THD *thd, char *db, char *name)
DBUG_ENTER("drop_all_triggers"); DBUG_ENTER("drop_all_triggers");
bzero(&table, sizeof(table)); bzero(&table, sizeof(table));
init_sql_alloc(&table.mem_root, 8192, 0, 0); init_sql_alloc(&table.mem_root, 8192, 0, MYF(0));
if (Table_triggers_list::check_n_load(thd, db, name, &table, 1)) if (Table_triggers_list::check_n_load(thd, db, name, &table, 1))
{ {
@ -1999,7 +1999,7 @@ bool Table_triggers_list::change_table_name(THD *thd, const char *db,
DBUG_ENTER("change_table_name"); DBUG_ENTER("change_table_name");
bzero(&table, sizeof(table)); bzero(&table, sizeof(table));
init_sql_alloc(&table.mem_root, 8192, 0, 0); init_sql_alloc(&table.mem_root, 8192, 0, MYF(0));
/* /*
This method interfaces the mysql server code protected by This method interfaces the mysql server code protected by

View File

@ -151,7 +151,7 @@ void udf_init()
mysql_rwlock_init(key_rwlock_THR_LOCK_udf, &THR_LOCK_udf); mysql_rwlock_init(key_rwlock_THR_LOCK_udf, &THR_LOCK_udf);
init_sql_alloc(&mem, UDF_ALLOC_BLOCK_SIZE, 0, 0); init_sql_alloc(&mem, UDF_ALLOC_BLOCK_SIZE, 0, MYF(0));
THD *new_thd = new THD; THD *new_thd = new THD;
if (!new_thd || if (!new_thd ||
my_hash_init(&udf_hash,system_charset_info,32,0,0,get_hash_key, NULL, 0)) my_hash_init(&udf_hash,system_charset_info,32,0,0,get_hash_key, NULL, 0))

View File

@ -307,7 +307,7 @@ TABLE_SHARE *alloc_table_share(TABLE_LIST *table_list, char *key,
path_length= build_table_filename(path, sizeof(path) - 1, path_length= build_table_filename(path, sizeof(path) - 1,
table_list->db, table_list->db,
table_list->table_name, "", 0); table_list->table_name, "", 0);
init_sql_alloc(&mem_root, TABLE_ALLOC_BLOCK_SIZE, 0, 0); init_sql_alloc(&mem_root, TABLE_ALLOC_BLOCK_SIZE, 0, MYF(0));
if (multi_alloc_root(&mem_root, if (multi_alloc_root(&mem_root,
&share, sizeof(*share), &share, sizeof(*share),
&key_buff, key_length, &key_buff, key_length,
@ -340,7 +340,7 @@ TABLE_SHARE *alloc_table_share(TABLE_LIST *table_list, char *key,
share->free_tables.empty(); share->free_tables.empty();
share->m_flush_tickets.empty(); share->m_flush_tickets.empty();
init_sql_alloc(&share->stats_cb.mem_root, TABLE_ALLOC_BLOCK_SIZE, 0, 0); init_sql_alloc(&share->stats_cb.mem_root, TABLE_ALLOC_BLOCK_SIZE, 0, MYF(0));
memcpy((char*) &share->mem_root, (char*) &mem_root, sizeof(mem_root)); memcpy((char*) &share->mem_root, (char*) &mem_root, sizeof(mem_root));
mysql_mutex_init(key_TABLE_SHARE_LOCK_ha_data, mysql_mutex_init(key_TABLE_SHARE_LOCK_ha_data,
@ -2358,7 +2358,7 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
outparam->db_stat= db_stat; outparam->db_stat= db_stat;
outparam->write_row_record= NULL; outparam->write_row_record= NULL;
init_sql_alloc(&outparam->mem_root, TABLE_ALLOC_BLOCK_SIZE, 0, 0); init_sql_alloc(&outparam->mem_root, TABLE_ALLOC_BLOCK_SIZE, 0, MYF(0));
if (outparam->alias.copy(alias, strlen(alias), table_alias_charset)) if (outparam->alias.copy(alias, strlen(alias), table_alias_charset))
goto err; goto err;

View File

@ -1637,7 +1637,7 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap)
my_hash_free(&tz_names); my_hash_free(&tz_names);
goto end; goto end;
} }
init_sql_alloc(&tz_storage, 32 * 1024, 0, 0); init_sql_alloc(&tz_storage, 32 * 1024, 0, MYF(0));
mysql_mutex_init(key_tz_LOCK, &tz_LOCK, MY_MUTEX_INIT_FAST); mysql_mutex_init(key_tz_LOCK, &tz_LOCK, MY_MUTEX_INIT_FAST);
tz_inited= 1; tz_inited= 1;
@ -2599,7 +2599,7 @@ main(int argc, char **argv)
} }
else else
{ {
init_alloc_root(&tz_storage, 32768, 0, 0); init_alloc_root(&tz_storage, 32768, 0, MYF(0));
if (strcmp(argv[1], "--leap") == 0) if (strcmp(argv[1], "--leap") == 0)
{ {
@ -2676,7 +2676,7 @@ main(int argc, char **argv)
MY_INIT(argv[0]); MY_INIT(argv[0]);
init_alloc_root(&tz_storage, 32768, 0); init_alloc_root(&tz_storage, 32768, MYF(0));
/* let us set some well known timezone */ /* let us set some well known timezone */
setenv("TZ", "MET", 1); setenv("TZ", "MET", 1);

View File

@ -497,7 +497,7 @@ ha_tina::ha_tina(handlerton *hton, TABLE_SHARE *table_arg)
buffer.set((char*)byte_buffer, IO_SIZE, &my_charset_bin); buffer.set((char*)byte_buffer, IO_SIZE, &my_charset_bin);
chain= chain_buffer; chain= chain_buffer;
file_buff= new Transparent_file(); file_buff= new Transparent_file();
init_alloc_root(&blobroot, BLOB_MEMROOT_ALLOC_SIZE, 0, 0); init_alloc_root(&blobroot, BLOB_MEMROOT_ALLOC_SIZE, 0, MYF(0));
} }
@ -961,7 +961,7 @@ int ha_tina::open(const char *name, int mode, uint open_options)
*/ */
thr_lock_data_init(&share->lock, &lock, (void*) this); thr_lock_data_init(&share->lock, &lock, (void*) this);
ref_length= sizeof(my_off_t); ref_length= sizeof(my_off_t);
init_alloc_root(&blobroot, BLOB_MEMROOT_ALLOC_SIZE, 0, 0); init_alloc_root(&blobroot, BLOB_MEMROOT_ALLOC_SIZE, 0, MYF(0));
share->lock.get_status= tina_get_status; share->lock.get_status= tina_get_status;
share->lock.update_status= tina_update_status; share->lock.update_status= tina_update_status;

View File

@ -1515,7 +1515,7 @@ static FEDERATED_SHARE *get_share(const char *table_name, TABLE *table)
*/ */
query.length(0); query.length(0);
init_alloc_root(&mem_root, 256, 0, 0); init_alloc_root(&mem_root, 256, 0, MYF(0));
mysql_mutex_lock(&federated_mutex); mysql_mutex_lock(&federated_mutex);
@ -1656,7 +1656,7 @@ int ha_federated::open(const char *name, int mode, uint test_if_locked)
ref_length= sizeof(MYSQL_RES *) + sizeof(MYSQL_ROW_OFFSET); ref_length= sizeof(MYSQL_RES *) + sizeof(MYSQL_ROW_OFFSET);
DBUG_PRINT("info", ("ref_length: %u", ref_length)); DBUG_PRINT("info", ("ref_length: %u", ref_length));
my_init_dynamic_array(&results, sizeof(MYSQL_RES *), 4, 4, 0); my_init_dynamic_array(&results, sizeof(MYSQL_RES *), 4, 4, MYF(0));
reset(); reset();
DBUG_RETURN(0); DBUG_RETURN(0);

View File

@ -136,7 +136,7 @@ federatedx_io_mysql::federatedx_io_mysql(FEDERATEDX_SERVER *aserver)
bzero(&mysql, sizeof(MYSQL)); bzero(&mysql, sizeof(MYSQL));
bzero(&savepoints, sizeof(DYNAMIC_ARRAY)); bzero(&savepoints, sizeof(DYNAMIC_ARRAY));
my_init_dynamic_array(&savepoints, sizeof(SAVEPT), 16, 16, 0); my_init_dynamic_array(&savepoints, sizeof(SAVEPT), 16, 16, MYF(0));
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }

View File

@ -1519,7 +1519,7 @@ static FEDERATEDX_SERVER *get_server(FEDERATEDX_SHARE *share, TABLE *table)
mysql_mutex_assert_owner(&federatedx_mutex); mysql_mutex_assert_owner(&federatedx_mutex);
init_alloc_root(&mem_root, 4096, 4096, 0); init_alloc_root(&mem_root, 4096, 4096, MYF(0));
fill_server(&mem_root, &tmp_server, share, table ? table->s->table_charset : 0); fill_server(&mem_root, &tmp_server, share, table ? table->s->table_charset : 0);
@ -1577,7 +1577,7 @@ static FEDERATEDX_SHARE *get_share(const char *table_name, TABLE *table)
query.length(0); query.length(0);
bzero(&tmp_share, sizeof(tmp_share)); bzero(&tmp_share, sizeof(tmp_share));
init_alloc_root(&mem_root, 256, 0, 0); init_alloc_root(&mem_root, 256, 0, MYF(0));
mysql_mutex_lock(&federatedx_mutex); mysql_mutex_lock(&federatedx_mutex);
@ -1791,7 +1791,7 @@ int ha_federatedx::open(const char *name, int mode, uint test_if_locked)
DBUG_PRINT("info", ("ref_length: %u", ref_length)); DBUG_PRINT("info", ("ref_length: %u", ref_length));
my_init_dynamic_array(&results, sizeof(FEDERATEDX_IO_RESULT*), 4, 4, 0); my_init_dynamic_array(&results, sizeof(FEDERATEDX_IO_RESULT*), 4, 4, MYF(0));
reset(); reset();

View File

@ -239,7 +239,7 @@ my_bool _ma_bitmap_init(MARIA_SHARE *share, File file,
if (((bitmap->map= (uchar*) my_malloc(size, MYF(MY_WME))) == NULL) || if (((bitmap->map= (uchar*) my_malloc(size, MYF(MY_WME))) == NULL) ||
my_init_dynamic_array(&bitmap->pinned_pages, my_init_dynamic_array(&bitmap->pinned_pages,
sizeof(MARIA_PINNED_PAGE), 1, 1, 0)) sizeof(MARIA_PINNED_PAGE), 1, 1, MYF(0)))
return 1; return 1;
bitmap->block_size= share->block_size; bitmap->block_size= share->block_size;

View File

@ -528,7 +528,7 @@ my_bool _ma_init_block_record(MARIA_HA *info)
if (my_init_dynamic_array(&info->bitmap_blocks, if (my_init_dynamic_array(&info->bitmap_blocks,
sizeof(MARIA_BITMAP_BLOCK), default_extents, sizeof(MARIA_BITMAP_BLOCK), default_extents,
64, 0)) 64, MYF(0)))
goto err; goto err;
info->cur_row.extents_buffer_length= default_extents * ROW_EXTENT_SIZE; info->cur_row.extents_buffer_length= default_extents * ROW_EXTENT_SIZE;
if (!(info->cur_row.extents= my_malloc(info->cur_row.extents_buffer_length, if (!(info->cur_row.extents= my_malloc(info->cur_row.extents_buffer_length,

View File

@ -3766,7 +3766,7 @@ int maria_repair_by_sort(HA_CHECK *param, register MARIA_HA *info,
param->read_cache.end_of_file= sort_info.filelength; param->read_cache.end_of_file= sort_info.filelength;
sort_param.wordlist=NULL; sort_param.wordlist=NULL;
init_alloc_root(&sort_param.wordroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0, init_alloc_root(&sort_param.wordroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0,
param->malloc_flags); MYF(param->malloc_flags));
sort_param.key_cmp=sort_key_cmp; sort_param.key_cmp=sort_key_cmp;
sort_param.lock_in_memory=maria_lock_memory; sort_param.lock_in_memory=maria_lock_memory;
@ -4404,7 +4404,7 @@ int maria_repair_parallel(HA_CHECK *param, register MARIA_HA *info,
sort_param[i].keyinfo->seg->charset->mbmaxlen); sort_param[i].keyinfo->seg->charset->mbmaxlen);
sort_param[i].key_length+=ft_max_word_len_for_sort-HA_FT_MAXBYTELEN; 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, init_alloc_root(&sort_param[i].wordroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0,
param->malloc_flags); MYF(param->malloc_flags));
} }
} }
sort_info.total_keys=i; sort_info.total_keys=i;

View File

@ -240,7 +240,7 @@ FT_INFO *maria_ft_init_nlq_search(MARIA_HA *info, uint keynr, uchar *query,
bzero(&wtree,sizeof(wtree)); bzero(&wtree,sizeof(wtree));
init_tree(&aio.dtree,0,0,sizeof(FT_SUPERDOC),(qsort_cmp2)&FT_SUPERDOC_cmp, init_tree(&aio.dtree,0,0,sizeof(FT_SUPERDOC),(qsort_cmp2)&FT_SUPERDOC_cmp,
NULL, NULL, 0); NULL, NULL, MYF(0));
maria_ft_parse_init(&wtree, aio.charset); maria_ft_parse_init(&wtree, aio.charset);
ftparser_param->flags= 0; ftparser_param->flags= 0;

View File

@ -255,7 +255,7 @@ void maria_ft_parse_init(TREE *wtree, CHARSET_INFO *cs)
DBUG_ENTER("maria_ft_parse_init"); DBUG_ENTER("maria_ft_parse_init");
if (!is_tree_inited(wtree)) if (!is_tree_inited(wtree))
init_tree(wtree,0,0,sizeof(FT_WORD),(qsort_cmp2)&FT_WORD_cmp, NULL, init_tree(wtree,0,0,sizeof(FT_WORD),(qsort_cmp2)&FT_WORD_cmp, NULL,
(void*) cs, 0); (void*) cs, MYF(0));
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
@ -348,7 +348,7 @@ MYSQL_FTPARSER_PARAM* maria_ftparser_alloc_param(MARIA_HA *info)
info->ftparser_param= (MYSQL_FTPARSER_PARAM *) info->ftparser_param= (MYSQL_FTPARSER_PARAM *)
my_malloc(MAX_PARAM_NR * sizeof(MYSQL_FTPARSER_PARAM) * my_malloc(MAX_PARAM_NR * sizeof(MYSQL_FTPARSER_PARAM) *
info->s->ftkeys, MYF(MY_WME | MY_ZEROFILL)); info->s->ftkeys, MYF(MY_WME | MY_ZEROFILL));
init_alloc_root(&info->ft_memroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0, 0); init_alloc_root(&info->ft_memroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0, MYF(0));
} }
return info->ftparser_param; return info->ftparser_param;
} }

View File

@ -3629,10 +3629,10 @@ my_bool translog_init_with_table(const char *directory,
mysql_rwlock_init(key_TRANSLOG_DESCRIPTOR_open_files_lock, mysql_rwlock_init(key_TRANSLOG_DESCRIPTOR_open_files_lock,
&log_descriptor.open_files_lock) || &log_descriptor.open_files_lock) ||
my_init_dynamic_array(&log_descriptor.open_files, my_init_dynamic_array(&log_descriptor.open_files,
sizeof(TRANSLOG_FILE*), 10, 10, 0) || sizeof(TRANSLOG_FILE*), 10, 10, MYF(0)) ||
my_init_dynamic_array(&log_descriptor.unfinished_files, my_init_dynamic_array(&log_descriptor.unfinished_files,
sizeof(struct st_file_counter), sizeof(struct st_file_counter),
10, 10, 0)) 10, 10, MYF(0)))
goto err; goto err;
log_descriptor.min_need_file= 0; log_descriptor.min_need_file= 0;
log_descriptor.min_file_number= 0; log_descriptor.min_file_number= 0;
@ -5528,7 +5528,7 @@ translog_write_variable_record_mgroup(LSN *lsn,
if (my_init_dynamic_array(&groups, if (my_init_dynamic_array(&groups,
sizeof(struct st_translog_group_descriptor), sizeof(struct st_translog_group_descriptor),
10, 10, 0)) 10, 10, MYF(0)))
{ {
translog_unlock(); translog_unlock();
DBUG_PRINT("error", ("init array failed")); DBUG_PRINT("error", ("init array failed"));

View File

@ -160,7 +160,7 @@ static MARIA_HA *maria_clone_internal(MARIA_SHARE *share, const char *name,
if (my_init_dynamic_array(&info.pinned_pages, if (my_init_dynamic_array(&info.pinned_pages,
sizeof(MARIA_PINNED_PAGE), sizeof(MARIA_PINNED_PAGE),
max(share->base.blobs*2 + 4, max(share->base.blobs*2 + 4,
MARIA_MAX_TREE_LEVELS*3), 16, 0)) MARIA_MAX_TREE_LEVELS*3), 16, MYF(0)))
goto err; goto err;

View File

@ -164,7 +164,7 @@ int _ma_create_index_by_sort(MARIA_SORT_PARAM *info, my_bool no_messages,
HA_FT_MAXBYTELEN, MYF(0)))) HA_FT_MAXBYTELEN, MYF(0))))
{ {
if (my_init_dynamic_array(&buffpek, sizeof(BUFFPEK), maxbuffer, if (my_init_dynamic_array(&buffpek, sizeof(BUFFPEK), maxbuffer,
maxbuffer/2, 0)) maxbuffer/2, MYF(0)))
{ {
my_free(sort_keys); my_free(sort_keys);
sort_keys= 0; sort_keys= 0;
@ -397,7 +397,7 @@ pthread_handler_t _ma_thr_find_all_keys(void *arg)
HA_FT_MAXBYTELEN : 0), MYF(0)))) HA_FT_MAXBYTELEN : 0), MYF(0))))
{ {
if (my_init_dynamic_array(&sort_param->buffpek, sizeof(BUFFPEK), if (my_init_dynamic_array(&sort_param->buffpek, sizeof(BUFFPEK),
maxbuffer, maxbuffer/2, 0)) maxbuffer, maxbuffer/2, MYF(0)))
{ {
my_free(sort_keys); my_free(sort_keys);
sort_keys= (uchar **) NULL; /* for err: label */ sort_keys= (uchar **) NULL; /* for err: label */

View File

@ -881,7 +881,7 @@ ChangeSet@1.2562, 2008-04-09 07:41:40+02:00, serg@janus.mylan +9 -0
/* Yup. converting */ /* Yup. converting */
info->ft1_to_ft2=(DYNAMIC_ARRAY *) info->ft1_to_ft2=(DYNAMIC_ARRAY *)
my_malloc(sizeof(DYNAMIC_ARRAY), MYF(MY_WME)); my_malloc(sizeof(DYNAMIC_ARRAY), MYF(MY_WME));
my_init_dynamic_array(info->ft1_to_ft2, ft2len, 300, 50, 0); my_init_dynamic_array(info->ft1_to_ft2, ft2len, 300, 50, MYF(0));
/* /*
Now, adding all keys from the page to dynarray Now, adding all keys from the page to dynarray
@ -1767,7 +1767,7 @@ int maria_init_bulk_insert(MARIA_HA *info, ulong cache_size, ha_rows rows)
cache_size * key[i].maxlength, cache_size * key[i].maxlength,
cache_size * key[i].maxlength, 0, cache_size * key[i].maxlength, 0,
(qsort_cmp2)keys_compare, (qsort_cmp2)keys_compare,
(tree_element_free) keys_free, (void *)params++, 0); (tree_element_free) keys_free, (void *)params++, MYF(0));
} }
else else
info->bulk_insert[i].root=0; info->bulk_insert[i].root=0;

View File

@ -799,7 +799,7 @@ static HUFF_COUNTS *init_huff_count(MARIA_HA *info,my_off_t records)
This is accomplished by '-1' as the element size. This is accomplished by '-1' as the element size.
*/ */
init_tree(&count[i].int_tree,0,0,-1,(qsort_cmp2) compare_tree, NULL, init_tree(&count[i].int_tree,0,0,-1,(qsort_cmp2) compare_tree, NULL,
NULL, 0); NULL, MYF(0));
if (records && type != FIELD_BLOB && type != FIELD_VARCHAR) if (records && type != FIELD_BLOB && type != FIELD_VARCHAR)
count[i].tree_pos=count[i].tree_buff = count[i].tree_pos=count[i].tree_buff =
my_malloc(count[i].field_length > 1 ? tree_buff_length : 2, my_malloc(count[i].field_length > 1 ? tree_buff_length : 2,

View File

@ -33,7 +33,7 @@ my_bool seq_storage_reader_init(SEQ_STORAGE *seq, const char *file)
seq->pos= 0; seq->pos= 0;
if ((fd= my_fopen(file, O_RDONLY, MYF(MY_WME))) == NULL) if ((fd= my_fopen(file, O_RDONLY, MYF(MY_WME))) == NULL)
return 1; return 1;
if (my_init_dynamic_array(&seq->seq, sizeof(ulong), 10, 10, 0)) if (my_init_dynamic_array(&seq->seq, sizeof(ulong), 10, 10, MYF(0)))
return 1; return 1;
for(;;) for(;;)

View File

@ -550,7 +550,7 @@ static void _ftb_init_index_search(FT_INFO *ftb)
/* 4 */ /* 4 */
if (!is_tree_inited(& ftb->no_dupes)) if (!is_tree_inited(& ftb->no_dupes))
init_tree(& ftb->no_dupes,0,0,sizeof(my_off_t), init_tree(& ftb->no_dupes,0,0,sizeof(my_off_t),
_ftb_no_dupes_cmp,0,0,0); _ftb_no_dupes_cmp,0,0,MYF(0));
else else
reset_tree(& ftb->no_dupes); reset_tree(& ftb->no_dupes);
} }
@ -583,7 +583,7 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, uchar *query,
bzero(& ftb->no_dupes, sizeof(TREE)); bzero(& ftb->no_dupes, sizeof(TREE));
ftb->last_word= 0; ftb->last_word= 0;
init_alloc_root(&ftb->mem_root, 1024, 1024, 0); init_alloc_root(&ftb->mem_root, 1024, 1024, MYF(0));
ftb->queue.max_elements= 0; ftb->queue.max_elements= 0;
if (!(ftbe=(FTB_EXPR *)alloc_root(&ftb->mem_root, sizeof(FTB_EXPR)))) if (!(ftbe=(FTB_EXPR *)alloc_root(&ftb->mem_root, sizeof(FTB_EXPR))))
goto err; goto err;

View File

@ -249,7 +249,7 @@ FT_INFO *ft_init_nlq_search(MI_INFO *info, uint keynr, uchar *query,
bzero(&wtree,sizeof(wtree)); bzero(&wtree,sizeof(wtree));
init_tree(&aio.dtree,0,0,sizeof(FT_SUPERDOC),(qsort_cmp2)&FT_SUPERDOC_cmp, init_tree(&aio.dtree,0,0,sizeof(FT_SUPERDOC),(qsort_cmp2)&FT_SUPERDOC_cmp,
NULL, NULL, 0); NULL, NULL, MYF(0));
ft_parse_init(&wtree, aio.charset); ft_parse_init(&wtree, aio.charset);
ftparser_param->flags= 0; ftparser_param->flags= 0;

View File

@ -250,7 +250,7 @@ void ft_parse_init(TREE *wtree, CHARSET_INFO *cs)
DBUG_ENTER("ft_parse_init"); DBUG_ENTER("ft_parse_init");
if (!is_tree_inited(wtree)) if (!is_tree_inited(wtree))
init_tree(wtree, 0, 0, sizeof(FT_WORD), (qsort_cmp2)&FT_WORD_cmp, 0, init_tree(wtree, 0, 0, sizeof(FT_WORD), (qsort_cmp2)&FT_WORD_cmp, 0,
(void*)cs, 0); (void*)cs, MYF(0));
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
@ -342,7 +342,7 @@ MYSQL_FTPARSER_PARAM* ftparser_alloc_param(MI_INFO *info)
info->ftparser_param= (MYSQL_FTPARSER_PARAM *) info->ftparser_param= (MYSQL_FTPARSER_PARAM *)
my_malloc(MAX_PARAM_NR * sizeof(MYSQL_FTPARSER_PARAM) * my_malloc(MAX_PARAM_NR * sizeof(MYSQL_FTPARSER_PARAM) *
info->s->ftkeys, MYF(MY_WME | MY_ZEROFILL)); info->s->ftkeys, MYF(MY_WME | MY_ZEROFILL));
init_alloc_root(&info->ft_memroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0, 0); init_alloc_root(&info->ft_memroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0, MYF(0));
} }
return info->ftparser_param; return info->ftparser_param;
} }

View File

@ -62,7 +62,7 @@ int ft_init_stopwords()
DBUG_RETURN(-1); DBUG_RETURN(-1);
init_tree(stopwords3,0,0,sizeof(FT_STOPWORD),(qsort_cmp2)&FT_STOPWORD_cmp, init_tree(stopwords3,0,0,sizeof(FT_STOPWORD),(qsort_cmp2)&FT_STOPWORD_cmp,
(ft_stopword_file ? (tree_element_free)&FT_STOPWORD_free : 0), (ft_stopword_file ? (tree_element_free)&FT_STOPWORD_free : 0),
NULL, 0); NULL, MYF(0));
/* /*
Stopword engine currently does not support tricky Stopword engine currently does not support tricky
character sets UCS2, UTF16, UTF32. character sets UCS2, UTF16, UTF32.

View File

@ -2300,7 +2300,7 @@ int mi_repair_by_sort(HA_CHECK *param, register MI_INFO *info,
sort_param.wordlist=NULL; sort_param.wordlist=NULL;
init_alloc_root(&sort_param.wordroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0, init_alloc_root(&sort_param.wordroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0,
param->malloc_flags); MYF(param->malloc_flags));
if (share->data_file_type == DYNAMIC_RECORD) if (share->data_file_type == DYNAMIC_RECORD)
length=max(share->base.min_pack_length+1,share->base.min_block_length); length=max(share->base.min_pack_length+1,share->base.min_block_length);
@ -2871,7 +2871,7 @@ int mi_repair_parallel(HA_CHECK *param, register MI_INFO *info,
sort_param[i].keyinfo->seg->charset->mbmaxlen; sort_param[i].keyinfo->seg->charset->mbmaxlen;
sort_param[i].key_length+=ft_max_word_len_for_sort-HA_FT_MAXBYTELEN; 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, init_alloc_root(&sort_param[i].wordroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0,
param->malloc_flags); MYF(param->malloc_flags));
} }
} }
sort_info.total_keys=i; sort_info.total_keys=i;

View File

@ -544,7 +544,7 @@ int _mi_insert(register MI_INFO *info, register MI_KEYDEF *keyinfo,
/* yup. converting */ /* yup. converting */
info->ft1_to_ft2=(DYNAMIC_ARRAY *) info->ft1_to_ft2=(DYNAMIC_ARRAY *)
my_malloc(sizeof(DYNAMIC_ARRAY), MYF(MY_WME)); my_malloc(sizeof(DYNAMIC_ARRAY), MYF(MY_WME));
my_init_dynamic_array(info->ft1_to_ft2, ft2len, 300, 50, 0); my_init_dynamic_array(info->ft1_to_ft2, ft2len, 300, 50, MYF(0));
/* /*
now, adding all keys from the page to dynarray now, adding all keys from the page to dynarray
@ -1014,7 +1014,7 @@ int mi_init_bulk_insert(MI_INFO *info, ulong cache_size, ha_rows rows)
cache_size * key[i].maxlength, cache_size * key[i].maxlength,
cache_size * key[i].maxlength, 0, cache_size * key[i].maxlength, 0,
(qsort_cmp2)keys_compare, (qsort_cmp2)keys_compare,
(tree_element_free) keys_free, (void *)params++, 0); (tree_element_free) keys_free, (void *)params++, MYF(0));
} }
else else
info->bulk_insert[i].root=0; info->bulk_insert[i].root=0;

View File

@ -817,7 +817,7 @@ static HUFF_COUNTS *init_huff_count(MI_INFO *info,my_off_t records)
This is accomplished by '-1' as the element size. This is accomplished by '-1' as the element size.
*/ */
init_tree(&count[i].int_tree,0,0,-1,(qsort_cmp2) compare_tree, NULL, init_tree(&count[i].int_tree,0,0,-1,(qsort_cmp2) compare_tree, NULL,
NULL, 0); NULL, MYF(0));
if (records && type != FIELD_BLOB && type != FIELD_VARCHAR) if (records && type != FIELD_BLOB && type != FIELD_VARCHAR)
count[i].tree_pos=count[i].tree_buff = count[i].tree_pos=count[i].tree_buff =
my_malloc(count[i].field_length > 1 ? tree_buff_length : 2, my_malloc(count[i].field_length > 1 ? tree_buff_length : 2,

View File

@ -165,7 +165,7 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
HA_FT_MAXBYTELEN, MYF(0)))) HA_FT_MAXBYTELEN, MYF(0))))
{ {
if (my_init_dynamic_array(&buffpek, sizeof(BUFFPEK), maxbuffer, if (my_init_dynamic_array(&buffpek, sizeof(BUFFPEK), maxbuffer,
maxbuffer/2, 0)) maxbuffer/2, MYF(0)))
{ {
my_free(sort_keys); my_free(sort_keys);
sort_keys= 0; sort_keys= 0;
@ -389,7 +389,7 @@ pthread_handler_t thr_find_all_keys(void *arg)
HA_FT_MAXBYTELEN : 0), MYF(0)))) HA_FT_MAXBYTELEN : 0), MYF(0))))
{ {
if (my_init_dynamic_array(&sort_param->buffpek, sizeof(BUFFPEK), if (my_init_dynamic_array(&sort_param->buffpek, sizeof(BUFFPEK),
maxbuffer, maxbuffer/2, 0)) maxbuffer, maxbuffer/2, MYF(0)))
{ {
my_free(sort_keys); my_free(sort_keys);
sort_keys= (uchar **) NULL; /* for err: label */ sort_keys= (uchar **) NULL; /* for err: label */

View File

@ -120,7 +120,7 @@ ha_myisammrg::ha_myisammrg(handlerton *hton, TABLE_SHARE *table_arg)
:handler(hton, table_arg), file(0), is_cloned(0) :handler(hton, table_arg), file(0), is_cloned(0)
{ {
init_sql_alloc(&children_mem_root, init_sql_alloc(&children_mem_root,
FN_REFLEN + ALLOC_ROOT_MIN_BLOCK_SIZE, 0, 0); FN_REFLEN + ALLOC_ROOT_MIN_BLOCK_SIZE, 0, MYF(0));
} }