diff options
-rw-r--r-- | client/mysqlcheck.c | 4 | ||||
-rw-r--r-- | client/mysqltest.c | 2 | ||||
-rw-r--r-- | extra/mysql_install.c | 2 | ||||
-rw-r--r-- | extra/resolve_stack_dump.c | 4 | ||||
-rw-r--r-- | fs/database.c | 4 | ||||
-rw-r--r-- | include/my_sys.h | 6 | ||||
-rw-r--r-- | myisam/sort.c | 2 | ||||
-rw-r--r-- | mysys/array.c | 2 | ||||
-rw-r--r-- | mysys/charset.c | 4 | ||||
-rw-r--r-- | mysys/default.c | 2 | ||||
-rw-r--r-- | mysys/hash.c | 2 | ||||
-rw-r--r-- | mysys/raid.cc | 2 | ||||
-rw-r--r-- | sql/log.cc | 4 | ||||
-rw-r--r-- | sql/slave.cc | 2 | ||||
-rw-r--r-- | sql/sql_acl.cc | 8 | ||||
-rw-r--r-- | sql/sql_select.cc | 2 | ||||
-rw-r--r-- | sql/uniques.cc | 2 |
17 files changed, 27 insertions, 27 deletions
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index 86507bc0b31..7945407ccae 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -614,8 +614,8 @@ int main(int argc, char **argv) if (dbConnect(current_host, current_user, opt_password)) exit(EX_MYSQLERR); - if (opt_auto_repair && - init_dynamic_array(&tables4repair, sizeof(char)*(NAME_LEN*2+2),16,64)) + if (opt_auto_repair && + my_init_dynamic_array(&tables4repair, sizeof(char)*(NAME_LEN*2+2),16,64)) { first_error = 1; goto end; diff --git a/client/mysqltest.c b/client/mysqltest.c index a007c7778e0..a161b9352d4 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -2360,7 +2360,7 @@ int main(int argc, char** argv) file_stack_end = file_stack + MAX_INCLUDE_DEPTH; cur_file = file_stack; lineno = lineno_stack; - init_dynamic_array(&q_lines, sizeof(struct st_query*), INIT_Q_LINES, + my_init_dynamic_array(&q_lines, sizeof(struct st_query*), INIT_Q_LINES, INIT_Q_LINES); memset(block_stack, 0, sizeof(block_stack)); block_stack_end = block_stack + BLOCK_STACK_DEPTH; diff --git a/extra/mysql_install.c b/extra/mysql_install.c index 1fa62f35b7e..d02c054d4eb 100644 --- a/extra/mysql_install.c +++ b/extra/mysql_install.c @@ -135,7 +135,7 @@ static int init_question_widget(QUESTION_WIDGET* w, const char* question, } w->question = question; w->default_ind = default_ind; - if (init_dynamic_array(&w->answers,sizeof(char*), + if (my_init_dynamic_array(&w->answers,sizeof(char*), ANSWERS_CHUNCK,ANSWERS_CHUNCK)) die("Out of memory"); return 0; diff --git a/extra/resolve_stack_dump.c b/extra/resolve_stack_dump.c index 6c2ddf66027..7c33bd51dbe 100644 --- a/extra/resolve_stack_dump.c +++ b/extra/resolve_stack_dump.c @@ -230,9 +230,9 @@ static int init_sym_entry(SYM_ENTRY* se, char* buf) static void init_sym_table() { char buf[512]; - if(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)) - die("Failed in 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)) { diff --git a/fs/database.c b/fs/database.c index 4a328c41618..0ff12e433ee 100644 --- a/fs/database.c +++ b/fs/database.c @@ -243,7 +243,7 @@ int db_show_field(char *b,const char *database,const char *table, const char *fi if (!(database[0] && table[0] && field[0])) DBUG_RETURN(-1); - init_dynamic_array(&field_array, sizeof(buff), 4096, 1024); + my_init_dynamic_array(&field_array, sizeof(buff), 4096, 1024); if (mysql_select_db(sock,database)) { @@ -593,7 +593,7 @@ gptr db_load_functions() int i=0; struct func_st func; DBUG_ENTER("db_load_functions"); - init_dynamic_array(&functions_array, sizeof(struct func_st), 4096, 1024); + my_init_dynamic_array(&functions_array, sizeof(struct func_st), 4096, 1024); while(functions[i]) { strcpy(func.type_s, functions[i]); /* Type in string: "table"` */ strcpy(func.filename, functions[i+1]); /* Name like it appears on FS: "count" */ diff --git a/include/my_sys.h b/include/my_sys.h index 175f7a86789..3ff35763bce 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -651,9 +651,9 @@ extern my_bool real_open_cached_file(IO_CACHE *cache); extern void close_cached_file(IO_CACHE *cache); File create_temp_file(char *to, const char *dir, const char *pfx, int mode, myf MyFlags); -#define init_dynamic_array(A,B,C,D) _init_dynamic_array(A,B,C,D CALLER_INFO) -#define init_dynamic_array_ci(A,B,C,D) _init_dynamic_array(A,B,C,D ORIG_CALLER_INFO) -extern my_bool _init_dynamic_array(DYNAMIC_ARRAY *array,uint element_size, +#define my_init_dynamic_array(A,B,C,D) init_dynamic_array(A,B,C,D CALLER_INFO) +#define my_init_dynamic_array_ci(A,B,C,D) init_dynamic_array(A,B,C,D ORIG_CALLER_INFO) +extern my_bool init_dynamic_array(DYNAMIC_ARRAY *array,uint element_size, uint init_alloc,uint alloc_increment CALLER_INFO_PROTO); extern my_bool insert_dynamic(DYNAMIC_ARRAY *array,gptr element); extern byte *alloc_dynamic(DYNAMIC_ARRAY *array); diff --git a/myisam/sort.c b/myisam/sort.c index 66a8254732a..bec77b231b8 100644 --- a/myisam/sort.c +++ b/myisam/sort.c @@ -122,7 +122,7 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages, if ((sort_keys=(uchar **)my_malloc(keys*(sort_length+sizeof(char*))+ HA_FT_MAXLEN, MYF(0)))) { - if (init_dynamic_array(&buffpek, sizeof(BUFFPEK), maxbuffer, + if (my_init_dynamic_array(&buffpek, sizeof(BUFFPEK), maxbuffer, maxbuffer/2)) my_free((gptr) sort_keys,MYF(0)); else diff --git a/mysys/array.c b/mysys/array.c index 2420213d454..2a0723fbd69 100644 --- a/mysys/array.c +++ b/mysys/array.c @@ -28,7 +28,7 @@ even if space allocation failed */ -my_bool _init_dynamic_array(DYNAMIC_ARRAY *array, uint element_size, +my_bool init_dynamic_array(DYNAMIC_ARRAY *array, uint element_size, uint init_alloc, uint alloc_increment CALLER_INFO_PROTO) { diff --git a/mysys/charset.c b/mysys/charset.c index 93e8b697904..1001b76f417 100644 --- a/mysys/charset.c +++ b/mysys/charset.c @@ -122,7 +122,7 @@ static my_bool read_charset_index(CS_ID ***charsets, myf myflags) fb.buf[0] = '\0'; fb.p = fb.buf; - if (init_dynamic_array(&cs, sizeof(CS_ID *), 32, 32)) + if (my_init_dynamic_array(&cs, sizeof(CS_ID *), 32, 32)) return TRUE; while (!get_word(&fb, buf) && !get_word(&fb, num_buf)) @@ -180,7 +180,7 @@ static my_bool init_available_charsets(myf myflags) pthread_mutex_lock(&THR_LOCK_charset); if (!cs_info_table.buffer) /* If not initialized */ { - init_dynamic_array(&cs_info_table, sizeof(CHARSET_INFO*), 16, 8); + my_init_dynamic_array(&cs_info_table, sizeof(CHARSET_INFO*), 16, 8); error = read_charset_index(&available_charsets, myflags); } charset_initialized=1; diff --git a/mysys/default.c b/mysys/default.c index d3c1b3815eb..12d7d2e4ed0 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -123,7 +123,7 @@ void load_defaults(const char *conf_file, const char **groups, for (; *groups ; groups++) group.count++; - if (init_dynamic_array(&args, sizeof(char*),*argc, 32)) + if (my_init_dynamic_array(&args, sizeof(char*),*argc, 32)) goto err; if (forced_default_file) { diff --git a/mysys/hash.c b/mysys/hash.c index b3769d1dfb2..eaea6d7503f 100644 --- a/mysys/hash.c +++ b/mysys/hash.c @@ -44,7 +44,7 @@ my_bool _hash_init(HASH *hash,uint size,uint key_offset,uint key_length, DBUG_PRINT("enter",("hash: %lx size: %d",hash,size)); hash->records=0; - if (init_dynamic_array_ci(&hash->array,sizeof(HASH_LINK),size,0)) + if (my_init_dynamic_array_ci(&hash->array,sizeof(HASH_LINK),size,0)) { hash->free=0; /* Allow call to hash_free */ DBUG_RETURN(TRUE); diff --git a/mysys/raid.cc b/mysys/raid.cc index 72d3b2074be..6196e1f1aa6 100644 --- a/mysys/raid.cc +++ b/mysys/raid.cc @@ -94,7 +94,7 @@ extern "C" { void init_raid(void) { /* Allocate memory for global file to raid map */ - init_dynamic_array(&RaidFd::_raid_map, sizeof(RaidFd*), 4096, 1024); + my_init_dynamic_array(&RaidFd::_raid_map, sizeof(RaidFd*), 4096, 1024); } void end_raid(void) { diff --git a/sql/log.cc b/sql/log.cc index 40cafeeaad1..f0012a94f5d 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -531,14 +531,14 @@ int MYSQL_LOG::purge_logs(THD* thd, const char* to_log) error = LOG_INFO_MEM; goto err; } - if (init_dynamic_array(&logs_to_purge, sizeof(char*), 1024, 1024)) + if (my_init_dynamic_array(&logs_to_purge, sizeof(char*), 1024, 1024)) { error = LOG_INFO_MEM; goto err; } logs_to_purge_inited = 1; - if (init_dynamic_array(&logs_to_keep, sizeof(char*), 1024, 1024)) + if (my_init_dynamic_array(&logs_to_keep, sizeof(char*), 1024, 1024)) { error = LOG_INFO_MEM; goto err; diff --git a/sql/slave.cc b/sql/slave.cc index 930155206c2..6d61ad95475 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -514,7 +514,7 @@ void init_table_rule_hash(HASH* h, bool* h_inited) void init_table_rule_array(DYNAMIC_ARRAY* a, bool* a_inited) { - 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); *a_inited = 1; } diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 104b431bdbb..1c9e269fde9 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -163,7 +163,7 @@ int acl_init(bool dont_read_acl_tables) init_sql_alloc(&mem,1024,0); init_read_record(&read_record_info,thd,table= tables[0].table,NULL,1,0); - VOID(init_dynamic_array(&acl_hosts,sizeof(ACL_HOST),20,50)); + VOID(my_init_dynamic_array(&acl_hosts,sizeof(ACL_HOST),20,50)); while (!(read_record_info.read_record(&read_record_info))) { ACL_HOST host; @@ -187,7 +187,7 @@ int acl_init(bool dont_read_acl_tables) freeze_size(&acl_hosts); init_read_record(&read_record_info,thd,table=tables[1].table,NULL,1,0); - VOID(init_dynamic_array(&acl_users,sizeof(ACL_USER),50,100)); + VOID(my_init_dynamic_array(&acl_users,sizeof(ACL_USER),50,100)); if (table->field[2]->field_length == 8 && protocol_version == PROTOCOL_VERSION) { @@ -273,7 +273,7 @@ int acl_init(bool dont_read_acl_tables) freeze_size(&acl_users); init_read_record(&read_record_info,thd,table=tables[2].table,NULL,1,0); - VOID(init_dynamic_array(&acl_dbs,sizeof(ACL_DB),50,100)); + VOID(my_init_dynamic_array(&acl_dbs,sizeof(ACL_DB),50,100)); while (!(read_record_info.read_record(&read_record_info))) { ACL_DB db; @@ -846,7 +846,7 @@ int wild_case_compare(const char *str,const char *wildstr) static void init_check_host(void) { DBUG_ENTER("init_check_host"); - VOID(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)); VOID(hash_init(&acl_check_hosts,acl_users.elements,0,0, (hash_get_key) check_get_key,0,HASH_CASE_INSENSITIVE)); diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 18f256d9edb..d8dcb3a4ea7 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1610,7 +1610,7 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab, join_tab[i].table->map); } } - if (init_dynamic_array(keyuse,sizeof(KEYUSE),20,64)) + if (my_init_dynamic_array(keyuse,sizeof(KEYUSE),20,64)) return TRUE; /* fill keyuse with found key parts */ for (KEY_FIELD *field=key_fields ; field != end ; field++) diff --git a/sql/uniques.cc b/sql/uniques.cc index 6b05618bcc7..3a26f610dc5 100644 --- a/sql/uniques.cc +++ b/sql/uniques.cc @@ -55,7 +55,7 @@ Unique::Unique(qsort_cmp2 comp_func, void * comp_func_fixed_arg, my_b_clear(&file); init_tree(&tree, max_in_memory_size / 16, 0, size, comp_func, 0, NULL, comp_func_fixed_arg); /* If the following fail's the next add will also fail */ - init_dynamic_array(&file_ptrs, sizeof(BUFFPEK), 16, 16); + my_init_dynamic_array(&file_ptrs, sizeof(BUFFPEK), 16, 16); max_elements= max_in_memory_size / ALIGN_SIZE(sizeof(TREE_ELEMENT)+size); open_cached_file(&file, mysql_tmpdir,TEMP_PREFIX, DISK_BUFFER_SIZE, MYF(MY_WME)); |