mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
MDEV-8719 - Obsolete sql_memdup() in favor of THD::memdup() and thd_memdup()
This commit is contained in:
parent
55e67c3e34
commit
13af8650a8
6 changed files with 6 additions and 17 deletions
|
@ -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 */
|
||||
/*
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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; }
|
||||
}
|
||||
;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue