diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/completion_hash.cc | 6 | ||||
-rw-r--r-- | client/mysql.cc | 43 | ||||
-rw-r--r-- | client/mysql_plugin.c | 42 | ||||
-rw-r--r-- | client/mysqladmin.cc | 8 | ||||
-rw-r--r-- | client/mysqlbinlog.cc | 17 | ||||
-rw-r--r-- | client/mysqlcheck.c | 29 | ||||
-rw-r--r-- | client/mysqldump.c | 42 | ||||
-rw-r--r-- | client/mysqlimport.c | 7 | ||||
-rw-r--r-- | client/mysqlshow.c | 2 | ||||
-rw-r--r-- | client/mysqlslap.c | 72 | ||||
-rw-r--r-- | client/mysqltest.cc | 106 | ||||
-rw-r--r-- | client/readline.cc | 18 |
12 files changed, 198 insertions, 194 deletions
diff --git a/client/completion_hash.cc b/client/completion_hash.cc index 0d88aa9b15e..0bfb4e879e4 100644 --- a/client/completion_hash.cc +++ b/client/completion_hash.cc @@ -41,15 +41,15 @@ uint hashpjw(const char *arKey, uint nKeyLength) int completion_hash_init(HashTable *ht, uint nSize) { - ht->arBuckets = (Bucket **) my_malloc(nSize* sizeof(Bucket *), - MYF(MY_ZEROFILL | MY_WME)); + ht->arBuckets = (Bucket **) my_malloc(PSI_NOT_INSTRUMENTED, + nSize* sizeof(Bucket *), MYF(MY_ZEROFILL | MY_WME)); if (!ht->arBuckets) { ht->initialized = 0; return FAILURE; } - init_alloc_root(&ht->mem_root, "completion_hash", 8192, 0, MYF(0)); + init_alloc_root(PSI_NOT_INSTRUMENTED, &ht->mem_root, 8192, 0, MYF(0)); ht->pHashFunction = hashpjw; ht->nTableSize = nSize; ht->initialized = 1; diff --git a/client/mysql.cc b/client/mysql.cc index c30139cd96b..f3c936e3028 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1133,10 +1133,10 @@ int main(int argc,char *argv[]) charset_index= get_command_index('C'); delimiter_index= get_command_index('d'); delimiter_str= delimiter; - default_prompt = my_strdup(getenv("MYSQL_PS1") ? + default_prompt = my_strdup(PSI_NOT_INSTRUMENTED, getenv("MYSQL_PS1") ? getenv("MYSQL_PS1") : "\\N [\\d]> ",MYF(MY_WME)); - current_prompt = my_strdup(default_prompt,MYF(MY_WME)); + current_prompt = my_strdup(PSI_NOT_INSTRUMENTED, default_prompt,MYF(MY_WME)); prompt_counter=0; aborted= 0; sf_leaking_memory= 1; /* no memory leak reports yet */ @@ -1204,7 +1204,7 @@ int main(int argc,char *argv[]) sf_leaking_memory= 0; glob_buffer.realloc(512); completion_hash_init(&ht, 128); - init_alloc_root(&hash_mem_root, "hash", 16384, 0, MYF(0)); + init_alloc_root(PSI_NOT_INSTRUMENTED, &hash_mem_root, 16384, 0, MYF(0)); if (sql_connect(current_host,current_db,current_user,opt_password, opt_silent)) { @@ -1246,12 +1246,11 @@ int main(int argc,char *argv[]) { /* read-history from file, default ~/.mysql_history*/ if (getenv("MYSQL_HISTFILE")) - histfile=my_strdup(getenv("MYSQL_HISTFILE"),MYF(MY_WME)); + histfile=my_strdup(PSI_NOT_INSTRUMENTED, getenv("MYSQL_HISTFILE"),MYF(MY_WME)); else if (getenv("HOME")) { - histfile=(char*) my_malloc((uint) strlen(getenv("HOME")) - + (uint) strlen("/.mysql_history")+2, - MYF(MY_WME)); + histfile=(char*) my_malloc(PSI_NOT_INSTRUMENTED, + strlen(getenv("HOME")) + strlen("/.mysql_history")+2, MYF(MY_WME)); if (histfile) sprintf(histfile,"%s/.mysql_history",getenv("HOME")); char link_name[FN_REFLEN]; @@ -1273,8 +1272,8 @@ int main(int argc,char *argv[]) if (verbose) tee_fprintf(stdout, "Reading history-file %s\n",histfile); read_history(histfile); - if (!(histfile_tmp= (char*) my_malloc((uint) strlen(histfile) + 5, - MYF(MY_WME)))) + if (!(histfile_tmp= (char*) my_malloc(PSI_NOT_INSTRUMENTED, + strlen(histfile) + 5, MYF(MY_WME)))) { fprintf(stderr, "Couldn't allocate memory for temp histfile!\n"); exit(1); @@ -1810,7 +1809,7 @@ get_one_option(const struct my_option *opt, char *argument, const char *) } if (embedded_server_arg_count == MAX_SERVER_ARGS-1 || !(embedded_server_args[embedded_server_arg_count++]= - my_strdup(argument, MYF(MY_FAE)))) + my_strdup(PSI_NOT_INSTRUMENTED, argument, MYF(MY_FAE)))) { put_info("Can't use server argument", INFO_ERROR); return 0; @@ -1846,7 +1845,7 @@ get_one_option(const struct my_option *opt, char *argument, const char *) { char *start= argument; my_free(opt_password); - opt_password= my_strdup(argument, MYF(MY_FAE)); + opt_password= my_strdup(PSI_NOT_INSTRUMENTED, argument, MYF(MY_FAE)); while (*argument) *argument++= 'x'; // Destroy argument if (*start) start[1]=0 ; @@ -1909,7 +1908,7 @@ static int get_options(int argc, char **argv) tmp= (char *) getenv("MYSQL_HOST"); if (tmp) - current_host= my_strdup(tmp, MYF(MY_WME)); + current_host= my_strdup(PSI_NOT_INSTRUMENTED, tmp, MYF(MY_WME)); pagpoint= getenv("PAGER"); if (!((char*) (pagpoint))) @@ -1951,7 +1950,7 @@ static int get_options(int argc, char **argv) { skip_updates= 0; my_free(current_db); - current_db= my_strdup(*argv, MYF(MY_WME)); + current_db= my_strdup(PSI_NOT_INSTRUMENTED, *argv, MYF(MY_WME)); } if (tty_password) opt_password= get_tty_password(NullS); @@ -2975,7 +2974,7 @@ static void get_current_db() { MYSQL_ROW row= mysql_fetch_row(res); if (row && row[0]) - current_db= my_strdup(row[0], MYF(MY_WME)); + current_db= my_strdup(PSI_NOT_INSTRUMENTED, row[0], MYF(MY_WME)); mysql_free_result(res); } } @@ -4331,12 +4330,12 @@ com_connect(String *buffer, char *line) if (tmp && *tmp) { my_free(current_db); - current_db= my_strdup(tmp, MYF(MY_WME)); + current_db= my_strdup(PSI_NOT_INSTRUMENTED, tmp, MYF(MY_WME)); tmp= get_arg(buff, GET_NEXT); if (tmp) { my_free(current_host); - current_host=my_strdup(tmp,MYF(MY_WME)); + current_host=my_strdup(PSI_NOT_INSTRUMENTED, tmp,MYF(MY_WME)); } } else @@ -4521,7 +4520,7 @@ com_use(String *buffer __attribute__((unused)), char *line) return put_error(&mysql); } my_free(current_db); - current_db=my_strdup(tmp,MYF(MY_WME)); + current_db=my_strdup(PSI_NOT_INSTRUMENTED, tmp,MYF(MY_WME)); #ifdef HAVE_READLINE if (select_db > 1) build_completion_hash(opt_rehash, 1); @@ -4929,7 +4928,7 @@ server_version_string(MYSQL *con) /* version, space, comment, \0 */ size_t len= strlen(mysql_get_server_info(con)) + strlen(cur[0]) + 2; - if ((server_version= (char *) my_malloc(len, MYF(MY_WME)))) + if ((server_version= (char *) my_malloc(PSI_NOT_INSTRUMENTED, len, MYF(MY_WME)))) { char *bufp; bufp = strmov(server_version, mysql_get_server_info(con)); @@ -4946,7 +4945,7 @@ server_version_string(MYSQL *con) */ if (server_version == NULL) - server_version= my_strdup(mysql_get_server_info(con), MYF(MY_WME)); + server_version= my_strdup(PSI_NOT_INSTRUMENTED, mysql_get_server_info(con), MYF(MY_WME)); } return server_version ? server_version : ""; @@ -5348,8 +5347,8 @@ static void init_username() (result=mysql_use_result(&mysql))) { MYSQL_ROW cur=mysql_fetch_row(result); - full_username=my_strdup(cur[0],MYF(MY_WME)); - part_username=my_strdup(strtok(cur[0],"@"),MYF(MY_WME)); + full_username=my_strdup(PSI_NOT_INSTRUMENTED, cur[0],MYF(MY_WME)); + part_username=my_strdup(PSI_NOT_INSTRUMENTED, strtok(cur[0],"@"),MYF(MY_WME)); (void) mysql_fetch_row(result); // Read eof } } @@ -5360,7 +5359,7 @@ static int com_prompt(String *buffer __attribute__((unused)), char *ptr=strchr(line, ' '); prompt_counter = 0; my_free(current_prompt); - current_prompt=my_strdup(ptr ? ptr+1 : default_prompt,MYF(MY_WME)); + current_prompt=my_strdup(PSI_NOT_INSTRUMENTED, ptr ? ptr+1 : default_prompt,MYF(MY_WME)); if (!ptr) tee_fprintf(stdout, "Returning to default PROMPT of %s\n", default_prompt); else diff --git a/client/mysql_plugin.c b/client/mysql_plugin.c index 998524ac1f1..15bbc71183d 100644 --- a/client/mysql_plugin.c +++ b/client/mysql_plugin.c @@ -191,7 +191,7 @@ static char *get_value(char *line, const char *item) char *s= 0; s = line + item_len + 1; - destination= my_strndup(s, line_len - start, MYF(MY_FAE)); + destination= my_strndup(PSI_NOT_INSTRUMENTED, s, line_len - start, MYF(MY_FAE)); destination[line_len - item_len - 2]= 0; } return destination; @@ -259,7 +259,7 @@ static int has_spaces(const char *path) static char *convert_path(const char *argument) { /* Convert / to \\ to make Windows paths */ - char *winfilename= my_strdup(argument, MYF(MY_FAE)); + char *winfilename= my_strdup(PSI_NOT_INSTRUMENTED, argument, MYF(MY_FAE)); char *pos, *end; size_t length= strlen(argument); @@ -291,7 +291,7 @@ static char *add_quotes(const char *path) else snprintf(windows_cmd_friendly, sizeof(windows_cmd_friendly), "%s", path); - return my_strdup(windows_cmd_friendly, MYF(MY_FAE)); + return my_strdup(PSI_NOT_INSTRUMENTED, windows_cmd_friendly, MYF(MY_FAE)); } #endif @@ -376,19 +376,19 @@ static int get_default_values() if ((opt_datadir == 0) && ((value= get_value(line, "--datadir")))) { - opt_datadir= my_strdup(value, MYF(MY_FAE)); + opt_datadir= my_strdup(PSI_NOT_INSTRUMENTED, value, MYF(MY_FAE)); } if ((opt_basedir == 0) && ((value= get_value(line, "--basedir")))) { - opt_basedir= my_strdup(value, MYF(MY_FAE)); + opt_basedir= my_strdup(PSI_NOT_INSTRUMENTED, value, MYF(MY_FAE)); } if ((opt_plugin_dir == 0) && ((value= get_value(line, "--plugin_dir")))) { - opt_plugin_dir= my_strdup(value, MYF(MY_FAE)); + opt_plugin_dir= my_strdup(PSI_NOT_INSTRUMENTED, value, MYF(MY_FAE)); } if ((opt_plugin_ini == 0) && ((value= get_value(line, "--plugin_ini")))) { - opt_plugin_ini= my_strdup(value, MYF(MY_FAE)); + opt_plugin_ini= my_strdup(PSI_NOT_INSTRUMENTED, value, MYF(MY_FAE)); } } } @@ -497,22 +497,22 @@ get_one_option(const struct my_option *opt, usage(); exit(0); case 'd': - opt_datadir= my_strdup(argument, MYF(MY_FAE)); + opt_datadir= my_strdup(PSI_NOT_INSTRUMENTED, argument, MYF(MY_FAE)); break; case 'b': - opt_basedir= my_strdup(argument, MYF(MY_FAE)); + opt_basedir= my_strdup(PSI_NOT_INSTRUMENTED, argument, MYF(MY_FAE)); break; case 'p': - opt_plugin_dir= my_strdup(argument, MYF(MY_FAE)); + opt_plugin_dir= my_strdup(PSI_NOT_INSTRUMENTED, argument, MYF(MY_FAE)); break; case 'i': - opt_plugin_ini= my_strdup(argument, MYF(MY_FAE)); + opt_plugin_ini= my_strdup(PSI_NOT_INSTRUMENTED, argument, MYF(MY_FAE)); break; case 'm': - opt_mysqld= my_strdup(argument, MYF(MY_FAE)); + opt_mysqld= my_strdup(PSI_NOT_INSTRUMENTED, argument, MYF(MY_FAE)); break; case 'f': - opt_my_print_defaults= my_strdup(argument, MYF(MY_FAE)); + opt_my_print_defaults= my_strdup(PSI_NOT_INSTRUMENTED, argument, MYF(MY_FAE)); break; } return 0; @@ -620,7 +620,7 @@ static int load_plugin_data(char *plugin_name, char *config_file) if (opt_plugin_ini == 0) { fn_format(path, config_file, opt_plugin_dir, "", MYF(0)); - opt_plugin_ini= my_strdup(path, MYF(MY_FAE)); + opt_plugin_ini= my_strdup(PSI_NOT_INSTRUMENTED, path, MYF(MY_FAE)); } if (!file_exists(opt_plugin_ini)) { @@ -636,7 +636,7 @@ static int load_plugin_data(char *plugin_name, char *config_file) } /* save name */ - plugin_data.name= my_strdup(plugin_name, MYF(MY_WME)); + plugin_data.name= my_strdup(PSI_NOT_INSTRUMENTED, plugin_name, MYF(MY_WME)); /* Read plugin components */ while (i < 16) @@ -666,14 +666,14 @@ static int load_plugin_data(char *plugin_name, char *config_file) /* Add proper file extension for soname */ strcat(line, FN_SOEXT); /* save so_name */ - plugin_data.so_name= my_strdup(line, MYF(MY_WME|MY_ZEROFILL)); + plugin_data.so_name= my_strdup(PSI_NOT_INSTRUMENTED, line, MYF(MY_WME|MY_ZEROFILL)); i++; } else { if (strlen(line) > 0) { - plugin_data.components[i]= my_strdup(line, MYF(MY_WME)); + plugin_data.components[i]= my_strdup(PSI_NOT_INSTRUMENTED, line, MYF(MY_WME)); i++; } else @@ -739,21 +739,21 @@ static int check_options(int argc, char **argv, char *operation) else if ((strncasecmp(argv[i], basedir_prefix, basedir_len) == 0) && !opt_basedir) { - opt_basedir= my_strndup(argv[i]+basedir_len, + opt_basedir= my_strndup(PSI_NOT_INSTRUMENTED, argv[i]+basedir_len, strlen(argv[i])-basedir_len, MYF(MY_FAE)); num_found++; } else if ((strncasecmp(argv[i], datadir_prefix, datadir_len) == 0) && !opt_datadir) { - opt_datadir= my_strndup(argv[i]+datadir_len, + opt_datadir= my_strndup(PSI_NOT_INSTRUMENTED, argv[i]+datadir_len, strlen(argv[i])-datadir_len, MYF(MY_FAE)); num_found++; } else if ((strncasecmp(argv[i], plugin_dir_prefix, plugin_dir_len) == 0) && !opt_plugin_dir) { - opt_plugin_dir= my_strndup(argv[i]+plugin_dir_len, + opt_plugin_dir= my_strndup(PSI_NOT_INSTRUMENTED, argv[i]+plugin_dir_len, strlen(argv[i])-plugin_dir_len, MYF(MY_FAE)); num_found++; } @@ -866,7 +866,7 @@ static int process_options(int argc, char *argv[], char *operation) #endif buff[sizeof(buff) - 1]= 0; my_free(opt_basedir); - opt_basedir= my_strdup(buff, MYF(MY_FAE)); + opt_basedir= my_strdup(PSI_NOT_INSTRUMENTED, buff, MYF(MY_FAE)); } } diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index bc1403b283a..1a128e61533 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -254,7 +254,7 @@ get_one_option(const struct my_option *opt, char *argument, const char *) { char *start=argument; my_free(opt_password); - opt_password=my_strdup(argument,MYF(MY_FAE)); + opt_password=my_strdup(PSI_NOT_INSTRUMENTED, argument,MYF(MY_FAE)); while (*argument) *argument++= 'x'; /* Destroy argument */ if (*start) start[1]=0; /* Cut length of argument */ @@ -1357,11 +1357,11 @@ static char **mask_password(int argc, char ***argv) if (!argc) return NULL; - temp_argv= (char **)(my_malloc(sizeof(char *) * argc, MYF(MY_WME))); + temp_argv= (char **)(my_malloc(PSI_NOT_INSTRUMENTED, sizeof(char *) * argc, MYF(MY_WME))); argc--; while (argc > 0) { - temp_argv[argc]= my_strdup((*argv)[argc], MYF(MY_FAE)); + temp_argv[argc]= my_strdup(PSI_NOT_INSTRUMENTED, (*argv)[argc], MYF(MY_FAE)); if (find_type((*argv)[argc - 1],&command_typelib, FIND_TYPE_BASIC) == ADMIN_PASSWORD || find_type((*argv)[argc - 1],&command_typelib, FIND_TYPE_BASIC) == ADMIN_OLD_PASSWORD) { @@ -1374,7 +1374,7 @@ static char **mask_password(int argc, char ***argv) } argc--; } - temp_argv[argc]= my_strdup((*argv)[argc], MYF(MY_FAE)); + temp_argv[argc]= my_strdup(PSI_NOT_INSTRUMENTED, (*argv)[argc], MYF(MY_FAE)); return(temp_argv); } diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 47a7f9e01b2..309743723cc 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -61,6 +61,9 @@ extern "C" unsigned char *mysql_net_store_length(unsigned char *packet, size_t length); #define net_store_length mysql_net_store_length +#define key_memory_TABLE_RULE_ENT 0 +#define key_memory_rpl_filter 0 + Rpl_filter *binlog_filter= 0; #define BIN_LOG_HEADER_SIZE 4 @@ -196,7 +199,7 @@ Log_event* read_remote_annotate_event(uchar* net_buf, ulong event_len, uchar *event_buf; Log_event* event; - if (!(event_buf= (uchar*) my_malloc(event_len + 1, MYF(MY_WME)))) + if (!(event_buf= (uchar*) my_malloc(PSI_NOT_INSTRUMENTED, event_len + 1, MYF(MY_WME)))) { error("Out of memory"); return 0; @@ -308,7 +311,7 @@ public: int init() { - return my_init_dynamic_array(&file_names, sizeof(File_name_record), + return my_init_dynamic_array(&file_names, PSI_NOT_INSTRUMENTED, sizeof(File_name_record), 100, 100, MYF(0)); } @@ -543,7 +546,7 @@ Exit_status Load_log_processor::process_first_event(const char *bname, File_name_record rec; DBUG_ENTER("Load_log_processor::process_first_event"); - if (!(fname= (char*) my_malloc(full_len,MYF(MY_WME)))) + if (!(fname= (char*) my_malloc(PSI_NOT_INSTRUMENTED, full_len,MYF(MY_WME)))) { error("Out of memory."); delete ce; @@ -1958,7 +1961,7 @@ get_one_option(const struct my_option *opt, char *argument, const char *) { my_free(pass); char *start=argument; - pass= my_strdup(argument,MYF(MY_FAE)); + pass= my_strdup(PSI_NOT_INSTRUMENTED, argument,MYF(MY_FAE)); while (*argument) *argument++= 'x'; /* Destroy argument */ if (*start) start[1]=0; /* Cut length of argument */ @@ -3044,9 +3047,9 @@ int main(int argc, char** argv) if (opt_flashback) { - my_init_dynamic_array(&binlog_events, sizeof(LEX_STRING), 1024, 1024, + my_init_dynamic_array(&binlog_events, PSI_NOT_INSTRUMENTED, sizeof(LEX_STRING), 1024, 1024, MYF(0)); - my_init_dynamic_array(&events_in_stmt, sizeof(Rows_log_event*), 1024, 1024, + my_init_dynamic_array(&events_in_stmt, PSI_NOT_INSTRUMENTED, sizeof(Rows_log_event*), 1024, 1024, MYF(0)); } if (opt_stop_never) @@ -3095,7 +3098,7 @@ int main(int argc, char** argv) retval= ERROR_STOP; goto err; } - dirname_for_local_load= my_strdup(my_tmpdir(&tmpdir), MY_WME); + dirname_for_local_load= my_strdup(PSI_NOT_INSTRUMENTED, my_tmpdir(&tmpdir), MY_WME); } if (load_processor.init()) diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index e949c8059bf..a8dc25163c6 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -326,7 +326,7 @@ get_one_option(const struct my_option *opt, { char *start = argument; my_free(opt_password); - opt_password = my_strdup(argument, MYF(MY_FAE)); + opt_password = my_strdup(PSI_NOT_INSTRUMENTED, argument, MYF(MY_FAE)); while (*argument) *argument++= 'x'; /* Destroy argument */ if (*start) start[1] = 0; /* Cut length of argument */ @@ -567,7 +567,7 @@ static int process_selected_tables(char *db, char **table_names, int tables) tot_length+= fixed_name_length(*(table_names + i)) + 2; if (!(table_names_comma_sep = (char *) - my_malloc((sizeof(char) * tot_length) + 4, MYF(MY_WME)))) + my_malloc(PSI_NOT_INSTRUMENTED, tot_length + 4, MYF(MY_WME)))) DBUG_RETURN(1); for (end = table_names_comma_sep + 1; tables > 0; @@ -678,12 +678,12 @@ static int process_all_tables_in_db(char *database) } mysql_data_seek(res, 0); - if (!(tables=(char *) my_malloc(sizeof(char)*tot_length+4, MYF(MY_WME)))) + if (!(tables=(char *) my_malloc(PSI_NOT_INSTRUMENTED, tot_length+4, MYF(MY_WME)))) { mysql_free_result(res); DBUG_RETURN(1); } - if (!(views=(char *) my_malloc(sizeof(char)*tot_views_length+4, MYF(MY_WME)))) + if (!(views=(char *) my_malloc(PSI_NOT_INSTRUMENTED, tot_views_length+4, MYF(MY_WME)))) { my_free(tables); mysql_free_result(res); @@ -799,8 +799,7 @@ static int rebuild_table(char *name) int rc= 0; DBUG_ENTER("rebuild_table"); - query= (char*)my_malloc(sizeof(char) * (12 + strlen(name) + 6 + 1), - MYF(MY_WME)); + query= (char*)my_malloc(PSI_NOT_INSTRUMENTED, 12+strlen(name)+6+1, MYF(MY_WME)); if (!query) DBUG_RETURN(1); ptr= strxmov(query, "ALTER TABLE ", name, " FORCE", NullS); @@ -938,7 +937,7 @@ static int handle_request_for_tables(char *tables, size_t length, DBUG_RETURN(fix_table_storage_name(tables)); } - if (!(query =(char *) my_malloc(query_size, MYF(MY_WME)))) + if (!(query =(char *) my_malloc(PSI_NOT_INSTRUMENTED, query_size, MYF(MY_WME)))) DBUG_RETURN(1); if (dont_quote) { @@ -1195,14 +1194,14 @@ int main(int argc, char **argv) } if (opt_auto_repair && - (my_init_dynamic_array(&tables4repair, sizeof(char)*(NAME_LEN*2+2),16, - 64, MYF(0)) || - my_init_dynamic_array(&views4repair, sizeof(char)*(NAME_LEN*2+2),16, - 64, MYF(0)) || - my_init_dynamic_array(&tables4rebuild, sizeof(char)*(NAME_LEN*2+2),16, - 64, MYF(0)) || - my_init_dynamic_array(&alter_table_cmds, MAX_ALTER_STR_SIZE, 0, 1, - MYF(0)))) + (my_init_dynamic_array(&tables4repair, PSI_NOT_INSTRUMENTED, + NAME_LEN*2+2, 16, 64, MYF(0)) || + my_init_dynamic_array(&views4repair, PSI_NOT_INSTRUMENTED, + NAME_LEN*2+2, 16, 64, MYF(0)) || + my_init_dynamic_array(&tables4rebuild, PSI_NOT_INSTRUMENTED, + NAME_LEN*2+2, 16, 64, MYF(0)) || + my_init_dynamic_array(&alter_table_cmds, PSI_NOT_INSTRUMENTED, + MAX_ALTER_STR_SIZE, 0, 1, MYF(0)))) goto end; if (opt_alldbs) diff --git a/client/mysqldump.c b/client/mysqldump.c index f932420aef0..26866b6cb14 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -826,7 +826,7 @@ get_one_option(const struct my_option *opt, { char *start=argument; my_free(opt_password); - opt_password=my_strdup(argument,MYF(MY_FAE)); + opt_password= my_strdup(PSI_NOT_INSTRUMENTED, argument, MYF(MY_FAE)); while (*argument) *argument++= 'x'; /* Destroy argument */ if (*start) start[1]=0; /* Cut length of argument */ @@ -908,7 +908,8 @@ get_one_option(const struct my_option *opt, opt_databases=0; break; case (int) OPT_IGNORE_DATABASE: - if (my_hash_insert(&ignore_database, (uchar*) my_strdup(argument, MYF(0)))) + if (my_hash_insert(&ignore_database, + (uchar*) my_strdup(PSI_NOT_INSTRUMENTED, argument, MYF(0)))) exit(EX_EOM); break; case (int) OPT_IGNORE_TABLE: @@ -918,7 +919,8 @@ get_one_option(const struct my_option *opt, fprintf(stderr, "Illegal use of option --ignore-table=<database>.<table>\n"); exit(1); } - if (my_hash_insert(&ignore_table, (uchar*)my_strdup(argument, MYF(0)))) + if (my_hash_insert(&ignore_table, + (uchar*)my_strdup(PSI_NOT_INSTRUMENTED, argument, MYF(0)))) exit(EX_EOM); break; } @@ -1000,22 +1002,22 @@ static int get_options(int *argc, char ***argv) defaults_argv= *argv; if (my_hash_init(&ignore_database, charset_info, 16, 0, 0, - (my_hash_get_key) get_table_key, my_free, 0)) + (my_hash_get_key) get_table_key, my_free, 0, PSI_NOT_INSTRUMENTED)) return(EX_EOM); if (my_hash_init(&ignore_table, charset_info, 16, 0, 0, - (my_hash_get_key) get_table_key, my_free, 0)) + (my_hash_get_key) get_table_key, my_free, 0, PSI_NOT_INSTRUMENTED)) return(EX_EOM); /* Don't copy internal log tables */ - if (my_hash_insert(&ignore_table, - (uchar*) my_strdup("mysql.apply_status", MYF(MY_WME))) || - my_hash_insert(&ignore_table, - (uchar*) my_strdup("mysql.schema", MYF(MY_WME))) || - my_hash_insert(&ignore_table, - (uchar*) my_strdup("mysql.general_log", MYF(MY_WME))) || - my_hash_insert(&ignore_table, - (uchar*) my_strdup("mysql.slow_log", MYF(MY_WME))) || - my_hash_insert(&ignore_table, - (uchar*) my_strdup("mysql.transaction_registry", MYF(MY_WME)))) + if (my_hash_insert(&ignore_table, (uchar*) my_strdup(PSI_NOT_INSTRUMENTED, + "mysql.apply_status", MYF(MY_WME))) || + my_hash_insert(&ignore_table, (uchar*) my_strdup(PSI_NOT_INSTRUMENTED, + "mysql.schema", MYF(MY_WME))) || + my_hash_insert(&ignore_table, (uchar*) my_strdup(PSI_NOT_INSTRUMENTED, + "mysql.general_log", MYF(MY_WME))) || + my_hash_insert(&ignore_table, (uchar*) my_strdup(PSI_NOT_INSTRUMENTED, + "mysql.slow_log", MYF(MY_WME))) || + my_hash_insert(&ignore_table, (uchar*) my_strdup(PSI_NOT_INSTRUMENTED, + "mysql.transaction_registry", MYF(MY_WME)))) return(EX_EOM); if ((ho_error= handle_options(argc, argv, my_long_options, get_one_option))) @@ -1793,7 +1795,7 @@ static void unescape(FILE *file,char *pos, size_t length) { char *tmp; DBUG_ENTER("unescape"); - if (!(tmp=(char*) my_malloc(length*2+1, MYF(MY_WME)))) + if (!(tmp=(char*) my_malloc(PSI_NOT_INSTRUMENTED, length*2+1, MYF(MY_WME)))) die(EX_MYSQLERR, "Couldn't allocate memory"); mysql_real_escape_string(&mysql_connection, tmp, pos, (ulong)length); @@ -2876,7 +2878,7 @@ static uint get_table_structure(char *table, char *db, char *table_type, /* save "show create" statement for later */ if ((row= mysql_fetch_row(result)) && (scv_buff=row[1])) - scv_buff= my_strdup(scv_buff, MYF(0)); + scv_buff= my_strdup(PSI_NOT_INSTRUMENTED, scv_buff, MYF(0)); mysql_free_result(result); @@ -3677,7 +3679,7 @@ static char *alloc_query_str(size_t size) { char *query; - if (!(query= (char*) my_malloc(size, MYF(MY_WME)))) + if (!(query= (char*) my_malloc(PSI_NOT_INSTRUMENTED, size, MYF(MY_WME)))) die(EX_MYSQLERR, "Couldn't allocate a query string."); return query; @@ -5067,7 +5069,7 @@ static int dump_selected_tables(char *db, char **table_names, int tables) if (init_dumping(db, init_dumping_tables)) DBUG_RETURN(1); - init_alloc_root(&glob_root, "glob_root", 8192, 0, MYF(0)); + init_alloc_root(PSI_NOT_INSTRUMENTED, &glob_root, 8192, 0, MYF(0)); if (!(dump_tables= pos= (char**) alloc_root(&glob_root, tables * sizeof(char *)))) die(EX_EOM, "alloc_root failure."); @@ -5819,7 +5821,7 @@ static char *primary_key_fields(const char *table_name) { char *end; /* result (terminating \0 is already in result_length) */ - result= my_malloc(result_length + 10, MYF(MY_WME)); + result= my_malloc(PSI_NOT_INSTRUMENTED, result_length + 10, MYF(MY_WME)); if (!result) { fprintf(stderr, "Error: Not enough memory to store ORDER BY clause\n"); diff --git a/client/mysqlimport.c b/client/mysqlimport.c index 76923e036b5..9e197e4e199 100644 --- a/client/mysqlimport.c +++ b/client/mysqlimport.c @@ -232,7 +232,7 @@ get_one_option(const struct my_option *opt, char *argument, { char *start=argument; my_free(opt_password); - opt_password=my_strdup(argument,MYF(MY_FAE)); + opt_password=my_strdup(PSI_NOT_INSTRUMENTED, argument,MYF(MY_FAE)); while (*argument) *argument++= 'x'; /* Destroy argument */ if (*start) start[1]=0; /* Cut length of argument */ @@ -672,9 +672,8 @@ int main(int argc, char **argv) table_count++; argv= save_argv; - if (!(worker_threads= (pthread_t*) my_malloc(table_count * - sizeof(*worker_threads), - MYF(0)))) + if (!(worker_threads= (pthread_t*) my_malloc(PSI_NOT_INSTRUMENTED, + table_count * sizeof(*worker_threads), MYF(0)))) return -2; for (; *argv != NULL; argv++) /* Loop through tables */ diff --git a/client/mysqlshow.c b/client/mysqlshow.c index d71a8aa5132..2b0cae6dc98 100644 --- a/client/mysqlshow.c +++ b/client/mysqlshow.c @@ -303,7 +303,7 @@ get_one_option(const struct my_option *opt, char *argument, { char *start=argument; my_free(opt_password); - opt_password=my_strdup(argument,MYF(MY_FAE)); + opt_password=my_strdup(PSI_NOT_INSTRUMENTED, argument, MYF(MY_FAE)); while (*argument) *argument++= 'x'; /* Destroy argument */ if (*start) start[1]=0; /* Cut length of argument */ diff --git a/client/mysqlslap.c b/client/mysqlslap.c index 996f9bb79c6..7d3c5747b18 100644 --- a/client/mysqlslap.c +++ b/client/mysqlslap.c @@ -433,8 +433,8 @@ void concurrency_loop(MYSQL *mysql, uint current, option_string *eptr) unsigned long long client_limit; int sysret; - head_sptr= (stats *)my_malloc(sizeof(stats) * iterations, - MYF(MY_ZEROFILL|MY_FAE|MY_WME)); + head_sptr= (stats *)my_malloc(PSI_NOT_INSTRUMENTED, + sizeof(stats) * iterations, MYF(MY_ZEROFILL|MY_FAE|MY_WME)); bzero(&conclusion, sizeof(conclusions)); @@ -741,7 +741,7 @@ get_one_option(const struct my_option *opt, char *argument, { char *start= argument; my_free(opt_password); - opt_password= my_strdup(argument,MYF(MY_FAE)); + opt_password= my_strdup(PSI_NOT_INSTRUMENTED, argument,MYF(MY_FAE)); while (*argument) *argument++= 'x'; /* Destroy argument */ if (*start) start[1]= 0; /* Cut length of argument */ @@ -918,9 +918,9 @@ build_table_string(void) } dynstr_append(&table_string, ")"); - ptr= (statement *)my_malloc(sizeof(statement), + ptr= (statement *)my_malloc(PSI_NOT_INSTRUMENTED, sizeof(statement), MYF(MY_ZEROFILL|MY_FAE|MY_WME)); - ptr->string = (char *)my_malloc(table_string.length+1, + ptr->string = (char *)my_malloc(PSI_NOT_INSTRUMENTED, table_string.length+1, MYF(MY_ZEROFILL|MY_FAE|MY_WME)); ptr->length= table_string.length+1; ptr->type= CREATE_TABLE_TYPE; @@ -986,10 +986,10 @@ build_update_string(void) dynstr_append(&update_string, " WHERE id = "); - ptr= (statement *)my_malloc(sizeof(statement), + ptr= (statement *)my_malloc(PSI_NOT_INSTRUMENTED, sizeof(statement), MYF(MY_ZEROFILL|MY_FAE|MY_WME)); - ptr->string= (char *)my_malloc(update_string.length + 1, + ptr->string= (char *)my_malloc(PSI_NOT_INSTRUMENTED, update_string.length + 1, MYF(MY_ZEROFILL|MY_FAE|MY_WME)); ptr->length= update_string.length+1; if (auto_generate_sql_autoincrement || auto_generate_sql_guid_primary) @@ -1082,9 +1082,9 @@ build_insert_string(void) dynstr_append_mem(&insert_string, ")", 1); - ptr= (statement *)my_malloc(sizeof(statement), + ptr= (statement *)my_malloc(PSI_NOT_INSTRUMENTED, sizeof(statement), MYF(MY_ZEROFILL|MY_FAE|MY_WME)); - ptr->string= (char *)my_malloc(insert_string.length + 1, + ptr->string= (char *)my_malloc(PSI_NOT_INSTRUMENTED, insert_string.length + 1, MYF(MY_ZEROFILL|MY_FAE|MY_WME)); ptr->length= insert_string.length+1; ptr->type= INSERT_TYPE; @@ -1146,9 +1146,9 @@ build_select_string(my_bool key) (auto_generate_sql_autoincrement || auto_generate_sql_guid_primary)) dynstr_append(&query_string, " WHERE id = "); - ptr= (statement *)my_malloc(sizeof(statement), + ptr= (statement *)my_malloc(PSI_NOT_INSTRUMENTED, sizeof(statement), MYF(MY_ZEROFILL|MY_FAE|MY_WME)); - ptr->string= (char *)my_malloc(query_string.length + 1, + ptr->string= (char *)my_malloc(PSI_NOT_INSTRUMENTED, query_string.length + 1, MYF(MY_ZEROFILL|MY_FAE|MY_WME)); ptr->length= query_string.length+1; if ((key) && @@ -1405,7 +1405,7 @@ get_options(int *argc,char ***argv) fprintf(stderr,"%s: Could not open create file\n", my_progname); exit(1); } - tmp_string= (char *)my_malloc((size_t)sbuf.st_size + 1, + tmp_string= (char *)my_malloc(PSI_NOT_INSTRUMENTED, (size_t)sbuf.st_size + 1, MYF(MY_ZEROFILL|MY_FAE|MY_WME)); my_read(data_file, (uchar*) tmp_string, (size_t)sbuf.st_size, MYF(0)); tmp_string[sbuf.st_size]= '\0'; @@ -1432,7 +1432,7 @@ get_options(int *argc,char ***argv) fprintf(stderr,"%s: Could not open query supplied file\n", my_progname); exit(1); } - tmp_string= (char *)my_malloc((size_t)sbuf.st_size + 1, + tmp_string= (char *)my_malloc(PSI_NOT_INSTRUMENTED, (size_t)sbuf.st_size + 1, MYF(MY_ZEROFILL|MY_FAE|MY_WME)); my_read(data_file, (uchar*) tmp_string, (size_t)sbuf.st_size, MYF(0)); tmp_string[sbuf.st_size]= '\0'; @@ -1463,7 +1463,7 @@ get_options(int *argc,char ***argv) fprintf(stderr,"%s: Could not open query supplied file\n", my_progname); exit(1); } - tmp_string= (char *)my_malloc((size_t)sbuf.st_size + 1, + tmp_string= (char *)my_malloc(PSI_NOT_INSTRUMENTED, (size_t)sbuf.st_size + 1, MYF(MY_ZEROFILL|MY_FAE|MY_WME)); my_read(data_file, (uchar*) tmp_string, (size_t)sbuf.st_size, MYF(0)); tmp_string[sbuf.st_size]= '\0'; @@ -1494,7 +1494,7 @@ get_options(int *argc,char ***argv) fprintf(stderr,"%s: Could not open query supplied file\n", my_progname); exit(1); } - tmp_string= (char *)my_malloc((size_t)sbuf.st_size + 1, + tmp_string= (char *)my_malloc(PSI_NOT_INSTRUMENTED, (size_t)sbuf.st_size + 1, MYF(MY_ZEROFILL|MY_FAE|MY_WME)); my_read(data_file, (uchar*) tmp_string, (size_t)sbuf.st_size, MYF(0)); tmp_string[sbuf.st_size]= '\0'; @@ -1560,11 +1560,11 @@ generate_primary_key_list(MYSQL *mysql, option_string *engine_stmt) strstr(engine_stmt->string, "blackhole"))) { primary_keys_number_of= 1; - primary_keys= (char **)my_malloc((uint)(sizeof(char *) * - primary_keys_number_of), - MYF(MY_ZEROFILL|MY_FAE|MY_WME)); + primary_keys= (char **)my_malloc(PSI_NOT_INSTRUMENTED, + (size_t)(sizeof(char *) * primary_keys_number_of), + MYF(MY_ZEROFILL|MY_FAE|MY_WME)); /* Yes, we strdup a const string to simplify the interface */ - primary_keys[0]= my_strdup("796c4422-1d94-102a-9d6d-00e0812d", MYF(0)); + primary_keys[0]= my_strdup(PSI_NOT_INSTRUMENTED, "796c4422-1d94-102a-9d6d-00e0812d", MYF(0)); } else { @@ -1589,13 +1589,13 @@ generate_primary_key_list(MYSQL *mysql, option_string *engine_stmt) /* We create the structure and loop and create the items. */ - primary_keys= (char **)my_malloc((uint)(sizeof(char *) * - primary_keys_number_of), - MYF(MY_ZEROFILL|MY_FAE|MY_WME)); + primary_keys= (char **)my_malloc(PSI_NOT_INSTRUMENTED, + (size_t)(sizeof(char *) * primary_keys_number_of), + MYF(MY_ZEROFILL|MY_FAE|MY_WME)); row= mysql_fetch_row(result); for (counter= 0; counter < primary_keys_number_of; counter++, row= mysql_fetch_row(result)) - primary_keys[counter]= my_strdup(row[0], MYF(0)); + primary_keys[counter]= my_strdup(PSI_NOT_INSTRUMENTED, row[0], MYF(0)); } mysql_free_result(result); @@ -2006,10 +2006,10 @@ parse_option(const char *origin, option_string **stmt, char delm) size_t length= strlen(origin); uint count= 0; /* We know that there is always one */ - for (tmp= *sptr= (option_string *)my_malloc(sizeof(option_string), + for (tmp= *sptr= (option_string *)my_malloc(PSI_NOT_INSTRUMENTED, sizeof(option_string), MYF(MY_ZEROFILL|MY_FAE|MY_WME)); (retstr= strchr(ptr, delm)); - tmp->next= (option_string *)my_malloc(sizeof(option_string), + tmp->next= (option_string *)my_malloc(PSI_NOT_INSTRUMENTED, sizeof(option_string), MYF(MY_ZEROFILL|MY_FAE|MY_WME)), tmp= tmp->next) { @@ -2040,18 +2040,18 @@ parse_option(const char *origin, option_string **stmt, char delm) char *option_ptr; tmp->length= (size_t)(buffer_ptr - buffer); - tmp->string= my_strndup(ptr, (uint)tmp->length, MYF(MY_FAE)); + tmp->string= my_strndup(PSI_NOT_INSTRUMENTED, ptr, (uint)tmp->length, MYF(MY_FAE)); option_ptr= ptr + 1 + tmp->length; /* Move past the : and the first string */ tmp->option_length= (size_t)(retstr - option_ptr); - tmp->option= my_strndup(option_ptr, (uint)tmp->option_length, + tmp->option= my_strndup(PSI_NOT_INSTRUMENTED, option_ptr, (uint)tmp->option_length, MYF(MY_FAE)); } else { - tmp->string= my_strndup(ptr, (size_t)(retstr - ptr), MYF(MY_FAE)); + tmp->string= my_strndup(PSI_NOT_INSTRUMENTED, ptr, (size_t)(retstr - ptr), MYF(MY_FAE)); tmp->length= (size_t)(retstr - ptr); } @@ -2079,19 +2079,19 @@ parse_option(const char *origin, option_string **stmt, char delm) char *option_ptr; tmp->length= (size_t)(origin_ptr - ptr); - tmp->string= my_strndup(ptr, tmp->length, MYF(MY_FAE)); + tmp->string= my_strndup(PSI_NOT_INSTRUMENTED, ptr, tmp->length, MYF(MY_FAE)); option_ptr= (char *)ptr + 1 + tmp->length; /* Move past the : and the first string */ tmp->option_length= strlen(option_ptr); - tmp->option= my_strndup(option_ptr, tmp->option_length, + tmp->option= my_strndup(PSI_NOT_INSTRUMENTED, option_ptr, tmp->option_length, MYF(MY_FAE)); } else { tmp->length= strlen(ptr); - tmp->string= my_strndup(ptr, tmp->length, MYF(MY_FAE)); + tmp->string= my_strndup(PSI_NOT_INSTRUMENTED, ptr, tmp->length, MYF(MY_FAE)); } count++; @@ -2111,15 +2111,15 @@ parse_delimiter(const char *script, statement **stmt, char delm) size_t length= strlen(script); uint count= 0; /* We know that there is always one */ - for (tmp= *sptr= (statement *)my_malloc(sizeof(statement), + for (tmp= *sptr= (statement *)my_malloc(PSI_NOT_INSTRUMENTED, sizeof(statement), MYF(MY_ZEROFILL|MY_FAE|MY_WME)); (retstr= strchr(ptr, delm)); - tmp->next= (statement *)my_malloc(sizeof(statement), + tmp->next= (statement *)my_malloc(PSI_NOT_INSTRUMENTED, sizeof(statement), MYF(MY_ZEROFILL|MY_FAE|MY_WME)), tmp= tmp->next) { count++; - tmp->string= my_strndup(ptr, (uint)(retstr - ptr), MYF(MY_FAE)); + tmp->string= my_strndup(PSI_NOT_INSTRUMENTED, ptr, (uint)(retstr - ptr), MYF(MY_FAE)); tmp->length= (size_t)(retstr - ptr); ptr+= retstr - ptr + 1; if (isspace(*ptr)) @@ -2128,7 +2128,7 @@ parse_delimiter(const char *script, statement **stmt, char delm) if (ptr != script+length) { - tmp->string= my_strndup(ptr, (uint)((script + length) - ptr), + tmp->string= my_strndup(PSI_NOT_INSTRUMENTED, ptr, (uint)((script + length) - ptr), MYF(MY_FAE)); tmp->length= (size_t)((script + length) - ptr); count++; @@ -2150,7 +2150,7 @@ parse_comma(const char *string, uint **range) if (*ptr == ',') count++; /* One extra spot for the NULL */ - nptr= *range= (uint *)my_malloc(sizeof(uint) * (count + 1), + nptr= *range= (uint *)my_malloc(PSI_NOT_INSTRUMENTED, sizeof(uint) * (count + 1), MYF(MY_ZEROFILL|MY_FAE|MY_WME)); ptr= (char *)string; diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 910db0f714e..8e88aefb6ac 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -1770,7 +1770,7 @@ int cat_file(DYNAMIC_STRING* ds, const char* filename) len= (size_t) my_seek(fd, 0, SEEK_END, MYF(0)); my_seek(fd, 0, SEEK_SET, MYF(0)); if (len == (size_t)MY_FILEPOS_ERROR || - !(buff= (char*)my_malloc(len + 1, MYF(0)))) + !(buff= (char*)my_malloc(PSI_NOT_INSTRUMENTED, len + 1, MYF(0)))) { my_close(fd, MYF(0)); return 1; @@ -2428,7 +2428,7 @@ VAR *var_init(VAR *v, const char *name, size_t name_len, const char *val, size_t if (!val) val_len= 0; val_alloc_len = val_len + 16; /* room to grow */ - if (!(tmp_var=v) && !(tmp_var = (VAR*)my_malloc(sizeof(*tmp_var) + if (!(tmp_var=v) && !(tmp_var = (VAR*)my_malloc(PSI_NOT_INSTRUMENTED, sizeof(*tmp_var) + name_len+2, MYF(MY_WME)))) die("Out of memory"); @@ -2443,7 +2443,7 @@ VAR *var_init(VAR *v, const char *name, size_t name_len, const char *val, size_t tmp_var->alloced = (v == 0); - if (!(tmp_var->str_val = (char*)my_malloc(val_alloc_len+1, MYF(MY_WME)))) + if (!(tmp_var->str_val = (char*)my_malloc(PSI_NOT_INSTRUMENTED, val_alloc_len+1, MYF(MY_WME)))) die("Out of memory"); if (val) @@ -2991,8 +2991,8 @@ void var_copy(VAR *dest, VAR *src) /* Alloc/realloc data for str_val in dest */ if (dest->alloced_len < src->alloced_len && !(dest->str_val= dest->str_val - ? (char*)my_realloc(dest->str_val, src->alloced_len, MYF(MY_WME)) - : (char*)my_malloc(src->alloced_len, MYF(MY_WME)))) + ? (char*)my_realloc(PSI_NOT_INSTRUMENTED, dest->str_val, src->alloced_len, MYF(MY_WME)) + : (char*)my_malloc(PSI_NOT_INSTRUMENTED, src->alloced_len, MYF(MY_WME)))) die("Out of memory"); else dest->alloced_len= src->alloced_len; @@ -3069,8 +3069,8 @@ void eval_expr(VAR *v, const char *p, const char **p_end, MIN_VAR_ALLOC : new_val_len + 1; if (!(v->str_val = v->str_val ? - (char*)my_realloc(v->str_val, v->alloced_len+1, MYF(MY_WME)) : - (char*)my_malloc(v->alloced_len+1, MYF(MY_WME)))) + (char*)my_realloc(PSI_NOT_INSTRUMENTED, v->str_val, v->alloced_len+1, MYF(MY_WME)) : + (char*)my_malloc(PSI_NOT_INSTRUMENTED, v->alloced_len+1, MYF(MY_WME)))) die("Out of memory"); } v->str_val_len = new_val_len; @@ -3091,7 +3091,7 @@ bool open_and_set_current(const char *name) cur_file++; cur_file->file= opened; - cur_file->file_name= my_strdup(name, MYF(MY_FAE)); + cur_file->file_name= my_strdup(PSI_NOT_INSTRUMENTED, name, MYF(MY_FAE)); cur_file->lineno=1; return true; } @@ -4846,7 +4846,7 @@ void do_sync_with_master(struct st_command *command) p++; while (*p && my_isspace(charset_info, *p)) p++; - start= buff= (char*)my_malloc(strlen(p)+1,MYF(MY_WME | MY_FAE)); + start= buff= (char*)my_malloc(PSI_NOT_INSTRUMENTED, strlen(p)+1,MYF(MY_WME | MY_FAE)); get_string(&buff, &p, command); } command->last_argument= p; @@ -5651,7 +5651,7 @@ void do_close_connection(struct st_command *command) When the connection is closed set name to "-closed_connection-" to make it possible to reuse the connection name. */ - if (!(con->name = my_strdup("-closed_connection-", MYF(MY_WME)))) + if (!(con->name = my_strdup(PSI_NOT_INSTRUMENTED, "-closed_connection-", MYF(MY_WME)))) die("Out of memory"); if (con == cur_con) @@ -6122,7 +6122,7 @@ void do_connect(struct st_command *command) { DBUG_PRINT("info", ("Inserting connection %s in connection pool", ds_connection_name.str)); - if (!(con_slot->name= my_strdup(ds_connection_name.str, MYF(MY_WME)))) + if (!(con_slot->name= my_strdup(PSI_NOT_INSTRUMENTED, ds_connection_name.str, MYF(MY_WME)))) die("Out of memory"); con_slot->name_len= strlen(con_slot->name); set_current_connection(con_slot); @@ -6573,7 +6573,7 @@ int read_line() if (p >= buf_end) { my_ptrdiff_t off= p - read_command_buf; - read_command_buf= (char*)my_realloc(read_command_buf, + read_command_buf= (char*)my_realloc(PSI_NOT_INSTRUMENTED, read_command_buf, read_command_buflen*2, MYF(MY_FAE)); p= read_command_buf + off; read_command_buflen*= 2; @@ -6920,7 +6920,7 @@ int read_command(struct st_command** command_ptr) DBUG_RETURN(0); } if (!(*command_ptr= command= - (struct st_command*) my_malloc(sizeof(*command), + (struct st_command*) my_malloc(PSI_NOT_INSTRUMENTED, sizeof(*command), MYF(MY_WME|MY_ZEROFILL))) || insert_dynamic(&q_lines, &command)) die("Out of memory"); @@ -6955,7 +6955,7 @@ int read_command(struct st_command** command_ptr) while (*p && my_isspace(charset_info, *p)) p++; - if (!(command->query_buf= command->query= my_strdup(p, MYF(MY_WME)))) + if (!(command->query_buf= command->query= my_strdup(PSI_NOT_INSTRUMENTED, p, MYF(MY_WME)))) die("Out of memory"); /* @@ -7168,7 +7168,7 @@ void read_embedded_server_arguments(const char *name) { *(strend(str)-1)=0; /* Remove end newline */ if (!(embedded_server_args[embedded_server_arg_count]= - my_strdup(str, MYF(MY_WME)))) + my_strdup(PSI_NOT_INSTRUMENTED, str, MYF(MY_WME)))) { my_fclose(file,MYF(0)); die("Out of memory"); @@ -7211,7 +7211,7 @@ get_one_option(const struct my_option *opt, char *argument, const char *) if (!(cur_file->file= fopen(buff, "rb"))) die("Could not open '%s' for reading, errno: %d", buff, errno); - cur_file->file_name= my_strdup(buff, MYF(MY_FAE)); + cur_file->file_name= my_strdup(PSI_NOT_INSTRUMENTED, buff, MYF(MY_FAE)); cur_file->lineno= 1; break; } @@ -7234,7 +7234,7 @@ get_one_option(const struct my_option *opt, char *argument, const char *) if (argument) { my_free(opt_pass); - opt_pass= my_strdup(argument, MYF(MY_FAE)); + opt_pass= my_strdup(PSI_NOT_INSTRUMENTED, argument, MYF(MY_FAE)); while (*argument) *argument++= 'x'; /* Destroy argument */ tty_password= 0; } @@ -7253,7 +7253,7 @@ get_one_option(const struct my_option *opt, char *argument, const char *) } if (embedded_server_arg_count == MAX_EMBEDDED_SERVER_ARGS-1 || !(embedded_server_args[embedded_server_arg_count++]= - my_strdup(argument, MYF(MY_FAE)))) + my_strdup(PSI_NOT_INSTRUMENTED, argument, MYF(MY_FAE)))) { die("Can't use server argument"); } @@ -7427,7 +7427,7 @@ void init_win_path_patterns() DBUG_ENTER("init_win_path_patterns"); - my_init_dynamic_array(&patterns, sizeof(const char*), 16, 16, MYF(0)); + my_init_dynamic_array(&patterns, PSI_NOT_INSTRUMENTED, sizeof(const char*), 16, 16, MYF(0)); /* Loop through all paths in the array */ for (i= 0; i < num_paths; i++) @@ -7436,10 +7436,10 @@ void init_win_path_patterns() if (*(paths[i]) == '$') { v= var_get(paths[i], 0, 0, 0); - p= my_strdup(v->str_val, MYF(MY_FAE)); + p= my_strdup(PSI_NOT_INSTRUMENTED, v->str_val, MYF(MY_FAE)); } else - p= my_strdup(paths[i], MYF(MY_FAE)); + p= my_strdup(PSI_NOT_INSTRUMENTED, paths[i], MYF(MY_FAE)); /* Don't insert zero length strings in patterns array */ if (strlen(p) == 0) @@ -7623,11 +7623,11 @@ void append_stmt_result(DYNAMIC_STRING *ds, MYSQL_STMT *stmt, int error; /* Allocate array with bind structs, lengths and NULL flags */ - my_bind= (MYSQL_BIND*) my_malloc(num_fields * sizeof(MYSQL_BIND), + my_bind= (MYSQL_BIND*) my_malloc(PSI_NOT_INSTRUMENTED, num_fields * sizeof(MYSQL_BIND), MYF(MY_WME | MY_FAE | MY_ZEROFILL)); - length= (ulong*) my_malloc(num_fields * sizeof(ulong), + length= (ulong*) my_malloc(PSI_NOT_INSTRUMENTED, num_fields * sizeof(ulong), MYF(MY_WME | MY_FAE)); - is_null= (my_bool*) my_malloc(num_fields * sizeof(my_bool), + is_null= (my_bool*) my_malloc(PSI_NOT_INSTRUMENTED, num_fields * sizeof(my_bool), MYF(MY_WME | MY_FAE)); /* Allocate data for the result of each field */ @@ -7635,7 +7635,7 @@ void append_stmt_result(DYNAMIC_STRING *ds, MYSQL_STMT *stmt, { uint max_length= fields[i].max_length + 1; my_bind[i].buffer_type= MYSQL_TYPE_STRING; - my_bind[i].buffer= my_malloc(max_length, MYF(MY_WME | MY_FAE)); + my_bind[i].buffer= my_malloc(PSI_NOT_INSTRUMENTED, max_length, MYF(MY_WME | MY_FAE)); my_bind[i].buffer_length= max_length; my_bind[i].is_null= &is_null[i]; my_bind[i].length= &length[i]; @@ -9185,10 +9185,10 @@ int main(int argc, char **argv) cur_block->ok= TRUE; /* Outer block should always be executed */ cur_block->cmd= cmd_none; - my_init_dynamic_array(&q_lines, sizeof(struct st_command*), 1024, 1024, MYF(0)); + my_init_dynamic_array(&q_lines, PSI_NOT_INSTRUMENTED, sizeof(struct st_command*), 1024, 1024, MYF(0)); if (my_hash_init2(&var_hash, 64, charset_info, - 128, 0, 0, get_var_key, 0, var_free, MYF(0))) + 128, 0, 0, get_var_key, 0, var_free, MYF(0), PSI_NOT_INSTRUMENTED)) die("Variable hash initialization failed"); { @@ -9218,10 +9218,10 @@ int main(int argc, char **argv) init_win_path_patterns(); #endif - read_command_buf= (char*)my_malloc(read_command_buflen= 65536, MYF(MY_FAE)); + read_command_buf= (char*)my_malloc(PSI_NOT_INSTRUMENTED, read_command_buflen= 65536, MYF(MY_FAE)); init_dynamic_string(&ds_res, "", 2048, 2048); - init_alloc_root(&require_file_root, "require_file", 1024, 1024, MYF(0)); + init_alloc_root(PSI_NOT_INSTRUMENTED, &require_file_root, 1024, 1024, MYF(0)); parse_args(argc, argv); @@ -9235,7 +9235,7 @@ int main(int argc, char **argv) /* Init connections, allocate 1 extra as buffer + 1 for default */ connections= (struct st_connection*) - my_malloc((opt_max_connections+2) * sizeof(struct st_connection), + my_malloc(PSI_NOT_INSTRUMENTED, (opt_max_connections+2) * sizeof(struct st_connection), MYF(MY_WME | MY_ZEROFILL)); connections_end= connections + opt_max_connections +1; next_con= connections + 1; @@ -9266,7 +9266,7 @@ int main(int argc, char **argv) if (cur_file == file_stack && cur_file->file == 0) { cur_file->file= stdin; - cur_file->file_name= my_strdup("<stdin>", MYF(MY_WME)); + cur_file->file_name= my_strdup(PSI_NOT_INSTRUMENTED, "<stdin>", MYF(MY_WME)); cur_file->lineno= 1; } var_set_string("MYSQLTEST_FILE", cur_file->file_name); @@ -9319,7 +9319,7 @@ int main(int argc, char **argv) } #endif - if (!(con->name = my_strdup("default", MYF(MY_WME)))) + if (!(con->name = my_strdup(PSI_NOT_INSTRUMENTED, "default", MYF(MY_WME)))) die("Out of memory"); mysql_options(con->mysql, MYSQL_OPT_NONBLOCK, 0); @@ -9915,7 +9915,7 @@ void do_get_replace_column(struct st_command *command) die("Missing argument in %s", command->query); /* Allocate a buffer for results */ - start= buff= (char*)my_malloc(strlen(from)+1,MYF(MY_WME | MY_FAE)); + start= buff= (char*)my_malloc(PSI_NOT_INSTRUMENTED, strlen(from)+1,MYF(MY_WME | MY_FAE)); while (*from) { char *to; @@ -9928,7 +9928,7 @@ void do_get_replace_column(struct st_command *command) command->query); to= get_string(&buff, &from, command); my_free(replace_column[column_number-1]); - replace_column[column_number-1]= my_strdup(to, MYF(MY_WME | MY_FAE)); + replace_column[column_number-1]= my_strdup(PSI_NOT_INSTRUMENTED, to, MYF(MY_WME | MY_FAE)); set_if_bigger(max_replace_column, column_number); } my_free(start); @@ -9995,7 +9995,7 @@ void do_get_replace(struct st_command *command) bzero(&from_array,sizeof(from_array)); if (!*from) die("Missing argument in %s", command->query); - start= buff= (char*)my_malloc(strlen(from)+1,MYF(MY_WME | MY_FAE)); + start= buff= (char*)my_malloc(PSI_NOT_INSTRUMENTED, strlen(from)+1,MYF(MY_WME | MY_FAE)); while (*from) { char *to= buff; @@ -10157,17 +10157,17 @@ struct st_replace_regex* init_replace_regex(char* expr) size_t expr_len= strlen(expr); /* my_malloc() will die on fail with MY_FAE */ - res=(struct st_replace_regex*)my_malloc( + res=(struct st_replace_regex*)my_malloc(PSI_NOT_INSTRUMENTED, sizeof(*res)+8192 ,MYF(MY_FAE+MY_WME)); - my_init_dynamic_array(&res->regex_arr,sizeof(struct st_regex), 128, 128, MYF(0)); + my_init_dynamic_array(&res->regex_arr,PSI_NOT_INSTRUMENTED, sizeof(struct st_regex), 128, 128, MYF(0)); expr_end= expr + expr_len; buf_p= (char*)res + sizeof(*res); append_replace_regex(expr, expr_end, res, &buf_p); res->odd_buf_len= res->even_buf_len= 8192; - res->even_buf= (char*)my_malloc(res->even_buf_len,MYF(MY_WME+MY_FAE)); - res->odd_buf= (char*)my_malloc(res->odd_buf_len,MYF(MY_WME+MY_FAE)); + res->even_buf= (char*)my_malloc(PSI_NOT_INSTRUMENTED, res->even_buf_len,MYF(MY_WME+MY_FAE)); + res->odd_buf= (char*)my_malloc(PSI_NOT_INSTRUMENTED, res->odd_buf_len,MYF(MY_WME+MY_FAE)); res->buf= res->even_buf; return res; @@ -10350,7 +10350,7 @@ void free_replace_regex() #define SECURE_REG_BUF if (buf_len < need_buf_len) \ { \ ssize_t off= res_p - buf; \ - buf= (char*)my_realloc(buf,need_buf_len,MYF(MY_WME+MY_FAE)); \ + buf= (char*)my_realloc(PSI_NOT_INSTRUMENTED, buf,need_buf_len,MYF(MY_WME+MY_FAE)); \ res_p= buf + off; \ buf_len= need_buf_len; \ } \ @@ -10403,7 +10403,7 @@ int reg_replace(char** buf_p, int* buf_len_p, char *pattern, return 1; } - subs= (regmatch_t*)my_malloc(sizeof(regmatch_t) * (r.re_nsub+1), + subs= (regmatch_t*)my_malloc(PSI_NOT_INSTRUMENTED, sizeof(regmatch_t) * (r.re_nsub+1), MYF(MY_WME+MY_FAE)); *res_p= 0; @@ -10651,7 +10651,7 @@ REPLACE *init_replace(char * *from, char * *to,uint count, if (init_sets(&sets,states)) DBUG_RETURN(0); found_sets=0; - if (!(found_set= (FOUND_SET*) my_malloc(sizeof(FOUND_SET)*max_length*count, + if (!(found_set= (FOUND_SET*) my_malloc(PSI_NOT_INSTRUMENTED, sizeof(FOUND_SET)*max_length*count, MYF(MY_WME)))) { free_sets(&sets); @@ -10662,7 +10662,7 @@ REPLACE *init_replace(char * *from, char * *to,uint count, used_sets=-1; word_states=make_new_set(&sets); /* Start of new word */ start_states=make_new_set(&sets); /* This is first state */ - if (!(follow=(FOLLOWS*) my_malloc((states+2)*sizeof(FOLLOWS),MYF(MY_WME)))) + if (!(follow=(FOLLOWS*) my_malloc(PSI_NOT_INSTRUMENTED, (states+2)*sizeof(FOLLOWS),MYF(MY_WME)))) { free_sets(&sets); my_free(found_set); @@ -10826,7 +10826,7 @@ REPLACE *init_replace(char * *from, char * *to,uint count, /* Alloc replace structure for the replace-state-machine */ - if ((replace=(REPLACE*) my_malloc(sizeof(REPLACE)*(sets.count)+ + if ((replace=(REPLACE*) my_malloc(PSI_NOT_INSTRUMENTED, sizeof(REPLACE)*(sets.count)+ sizeof(REPLACE_STRING)*(found_sets+1)+ sizeof(char *)*count+result_len, MYF(MY_WME | MY_ZEROFILL)))) @@ -10871,10 +10871,10 @@ int init_sets(REP_SETS *sets,uint states) { bzero(sets, sizeof(*sets)); sets->size_of_bits=((states+7)/8); - if (!(sets->set_buffer=(REP_SET*) my_malloc(sizeof(REP_SET)*SET_MALLOC_HUNC, + if (!(sets->set_buffer=(REP_SET*) my_malloc(PSI_NOT_INSTRUMENTED, sizeof(REP_SET)*SET_MALLOC_HUNC, MYF(MY_WME)))) return 1; - if (!(sets->bit_buffer=(uint*) my_malloc(sizeof(uint)*sets->size_of_bits* + if (!(sets->bit_buffer=(uint*) my_malloc(PSI_NOT_INSTRUMENTED, sizeof(uint)*sets->size_of_bits* SET_MALLOC_HUNC,MYF(MY_WME)))) { my_free(sets->set); @@ -10909,12 +10909,12 @@ REP_SET *make_new_set(REP_SETS *sets) return set; } count=sets->count+sets->invisible+SET_MALLOC_HUNC; - if (!(set=(REP_SET*) my_realloc(sets->set_buffer, sizeof(REP_SET)*count, + if (!(set=(REP_SET*) my_realloc(PSI_NOT_INSTRUMENTED, sets->set_buffer, sizeof(REP_SET)*count, MYF(MY_WME)))) return 0; sets->set_buffer=set; sets->set=set+sets->invisible; - if (!(bit_buffer=(uint*) my_realloc(sets->bit_buffer, + if (!(bit_buffer=(uint*) my_realloc(PSI_NOT_INSTRUMENTED, sets->bit_buffer, (sizeof(uint)*sets->size_of_bits)*count, MYF(MY_WME)))) return 0; @@ -11069,11 +11069,11 @@ int insert_pointer_name(POINTER_ARRAY *pa,char * name) if (! pa->typelib.count) { if (!(pa->typelib.type_names=(const char **) - my_malloc(((PC_MALLOC-MALLOC_OVERHEAD)/ + my_malloc(PSI_NOT_INSTRUMENTED, ((PC_MALLOC-MALLOC_OVERHEAD)/ (sizeof(char *)+sizeof(*pa->flag))* (sizeof(char *)+sizeof(*pa->flag))),MYF(MY_WME)))) DBUG_RETURN(-1); - if (!(pa->str= (uchar*) my_malloc(PS_MALLOC - MALLOC_OVERHEAD, + if (!(pa->str= (uchar*) my_malloc(PSI_NOT_INSTRUMENTED, PS_MALLOC - MALLOC_OVERHEAD, MYF(MY_WME)))) { my_free(pa->typelib.type_names); @@ -11089,7 +11089,7 @@ int insert_pointer_name(POINTER_ARRAY *pa,char * name) length=(uint) strlen(name)+1; if (pa->length+length >= pa->max_length) { - if (!(new_pos= (uchar*) my_realloc(pa->str, pa->length + length + PS_MALLOC, + if (!(new_pos= (uchar*) my_realloc(PSI_NOT_INSTRUMENTED, pa->str, pa->length + length + PS_MALLOC, MYF(MY_WME)))) DBUG_RETURN(1); if (new_pos != pa->str) @@ -11107,7 +11107,7 @@ int insert_pointer_name(POINTER_ARRAY *pa,char * name) int len; pa->array_allocs++; len=(PC_MALLOC*pa->array_allocs - MALLOC_OVERHEAD); - if (!(new_array=(const char **) my_realloc(pa->typelib.type_names, + if (!(new_array=(const char **) my_realloc(PSI_NOT_INSTRUMENTED, pa->typelib.type_names, len/ (sizeof(uchar*)+sizeof(*pa->flag))* (sizeof(uchar*)+sizeof(*pa->flag)), @@ -11230,7 +11230,7 @@ void dynstr_append_sorted(DYNAMIC_STRING* ds, DYNAMIC_STRING *ds_input, if (!*start) DBUG_VOID_RETURN; /* No input */ - my_init_dynamic_array(&lines, sizeof(const char*), 32, 32, MYF(0)); + my_init_dynamic_array(&lines, PSI_NOT_INSTRUMENTED, sizeof(const char*), 32, 32, MYF(0)); if (keep_header) { diff --git a/client/readline.cc b/client/readline.cc index 12df8b312ad..8d3d97b8585 100644 --- a/client/readline.cc +++ b/client/readline.cc @@ -43,7 +43,8 @@ LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file) #endif if (!(line_buff=(LINE_BUFFER*) - my_malloc(sizeof(*line_buff),MYF(MY_WME | MY_ZEROFILL)))) + my_malloc(PSI_NOT_INSTRUMENTED, sizeof(*line_buff), + MYF(MY_WME | MY_ZEROFILL)))) return 0; if (init_line_buffer(line_buff,my_fileno(file),IO_SIZE,max_size)) { @@ -93,7 +94,8 @@ LINE_BUFFER *batch_readline_command(LINE_BUFFER *line_buff, char * str) { if (!line_buff) if (!(line_buff=(LINE_BUFFER*) - my_malloc(sizeof(*line_buff),MYF(MY_WME | MY_ZEROFILL)))) + my_malloc(PSI_NOT_INSTRUMENTED, sizeof(*line_buff), + MYF(MY_WME | MY_ZEROFILL)))) return 0; if (init_line_buffer_from_string(line_buff,str)) { @@ -114,8 +116,8 @@ init_line_buffer(LINE_BUFFER *buffer,File file,ulong size,ulong max_buffer) buffer->file=file; buffer->bufread=size; buffer->max_size=max_buffer; - if (!(buffer->buffer = (char*) my_malloc(buffer->bufread+1, - MYF(MY_WME | MY_FAE)))) + if (!(buffer->buffer = (char*) my_malloc(PSI_NOT_INSTRUMENTED, + buffer->bufread+1, MYF(MY_WME | MY_FAE)))) return 1; buffer->end_of_line=buffer->end=buffer->buffer; buffer->buffer[0]=0; /* For easy start test */ @@ -132,8 +134,8 @@ static bool init_line_buffer_from_string(LINE_BUFFER *buffer,char * str) uint old_length=(uint)(buffer->end - buffer->buffer); uint length= (uint) strlen(str); if (!(buffer->buffer= buffer->start_of_line= buffer->end_of_line= - (char*) my_realloc((uchar*) buffer->buffer, old_length+length+2, - MYF(MY_FAE|MY_ALLOW_ZERO_PTR)))) + (char*) my_realloc(PSI_NOT_INSTRUMENTED, buffer->buffer, + old_length+length+2, MYF(MY_FAE|MY_ALLOW_ZERO_PTR)))) return 1; buffer->end= buffer->buffer + old_length; if (old_length) @@ -179,8 +181,8 @@ static size_t fill_buffer(LINE_BUFFER *buffer) return 0; } buffer->bufread *= 2; - if (!(buffer->buffer = (char*) my_realloc(buffer->buffer, - buffer->bufread+1, + if (!(buffer->buffer = (char*) my_realloc(PSI_NOT_INSTRUMENTED, + buffer->buffer, buffer->bufread+1, MYF(MY_WME | MY_FAE)))) { buffer->error= my_errno; |