diff options
-rw-r--r-- | sql/opt_range.h | 1 | ||||
-rw-r--r-- | sql/partition_info.cc | 6 | ||||
-rw-r--r-- | sql/partition_info.h | 2 | ||||
-rw-r--r-- | sql/sql_yacc.yy | 4 | ||||
-rw-r--r-- | sql/thr_malloc.cc | 9 | ||||
-rw-r--r-- | sql/thr_malloc.h | 1 |
6 files changed, 6 insertions, 17 deletions
diff --git a/sql/opt_range.h b/sql/opt_range.h index 0c495639db6..80f4064a529 100644 --- a/sql/opt_range.h +++ b/sql/opt_range.h @@ -24,7 +24,6 @@ #pragma interface /* gcc class implementation */ #endif -#include "thr_malloc.h" /* sql_memdup */ #include "records.h" /* READ_RECORD */ #include "queues.h" /* QUEUE */ /* diff --git a/sql/partition_info.cc b/sql/partition_info.cc index a92c7686eaf..36bb2513c9b 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -1940,11 +1940,11 @@ void partition_info::print_no_partition_found(TABLE *table_arg, myf errflag) FALSE Success */ -bool partition_info::set_part_expr(char *start_token, Item *item_ptr, +bool partition_info::set_part_expr(THD *thd, char *start_token, Item *item_ptr, char *end_token, bool is_subpart) { uint expr_len= end_token - start_token; - char *func_string= (char*) sql_memdup(start_token, expr_len); + char *func_string= (char*) thd->memdup(start_token, expr_len); if (!func_string) { @@ -3153,7 +3153,7 @@ part_column_list_val *partition_info::add_column_value(THD *thd) return NULL; } -bool partition_info::set_part_expr(char *start_token, Item *item_ptr, +bool partition_info::set_part_expr(THD *thd, char *start_token, Item *item_ptr, char *end_token, bool is_subpart) { (void)start_token; diff --git a/sql/partition_info.h b/sql/partition_info.h index df7010b2ab3..c58fa8bef55 100644 --- a/sql/partition_info.h +++ b/sql/partition_info.h @@ -332,7 +332,7 @@ public: void init_col_val(part_column_list_val *col_val, Item *item); int reorganize_into_single_field_col_val(THD *thd); part_column_list_val *add_column_value(THD *thd); - bool set_part_expr(char *start_token, Item *item_ptr, + bool set_part_expr(THD *thd, char *start_token, Item *item_ptr, char *end_token, bool is_subpart); static int compare_column_values(const void *a, const void *b); bool set_up_charset_field_preps(THD *thd); diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 6a90bcbb8f9..4db7d4d8d59 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -5055,7 +5055,7 @@ part_func: '(' remember_name part_func_expr remember_end ')' { partition_info *part_info= Lex->part_info; - if (part_info->set_part_expr($2+1, $3, $4, FALSE)) + if (part_info->set_part_expr(thd, $2 + 1, $3, $4, FALSE)) { MYSQL_YYABORT; } part_info->num_columns= 1; part_info->column_list= FALSE; @@ -5065,7 +5065,7 @@ part_func: sub_part_func: '(' remember_name part_func_expr remember_end ')' { - if (Lex->part_info->set_part_expr($2+1, $3, $4, TRUE)) + if (Lex->part_info->set_part_expr(thd, $2 + 1, $3, $4, TRUE)) { MYSQL_YYABORT; } } ; diff --git a/sql/thr_malloc.cc b/sql/thr_malloc.cc index b82d29e51f4..4468de69542 100644 --- a/sql/thr_malloc.cc +++ b/sql/thr_malloc.cc @@ -106,15 +106,6 @@ char *sql_strmake(const char *str, size_t len) } -void* sql_memdup(const void *ptr, size_t len) -{ - void *pos; - if ((pos= sql_alloc(len))) - memcpy(pos,ptr,len); - return pos; -} - - char *sql_strmake_with_convert(const char *str, size_t arg_length, CHARSET_INFO *from_cs, size_t max_res_length, diff --git a/sql/thr_malloc.h b/sql/thr_malloc.h index 0b17c5cdaf1..4c42baa70d5 100644 --- a/sql/thr_malloc.h +++ b/sql/thr_malloc.h @@ -26,7 +26,6 @@ void *sql_alloc(size_t); void *sql_calloc(size_t); char *sql_strdup(const char *str); char *sql_strmake(const char *str, size_t len); -void *sql_memdup(const void * ptr, size_t size); char *sql_strmake_with_convert(const char *str, size_t arg_length, CHARSET_INFO *from_cs, size_t max_res_length, |