diff options
Diffstat (limited to 'client/mysqltest.cc')
-rw-r--r-- | client/mysqltest.cc | 106 |
1 files changed, 53 insertions, 53 deletions
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) { |