Skip to content

Commit

Permalink
MDEV-6819 st_mysql_show_var::value should be void* not char*
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed Mar 7, 2015
1 parent 20cacb0 commit 18feb62
Show file tree
Hide file tree
Showing 8 changed files with 185 additions and 182 deletions.
4 changes: 2 additions & 2 deletions include/mysql/plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,12 @@ enum enum_var_type

struct st_mysql_show_var {
const char *name;
char *value;
void *value;
enum enum_mysql_show_type type;
};

#define SHOW_VAR_FUNC_BUFF_SIZE (256 * sizeof(void*))
typedef int (*mysql_show_var_func)(MYSQL_THD, struct st_mysql_show_var*, char *, enum enum_var_type);
typedef int (*mysql_show_var_func)(MYSQL_THD, struct st_mysql_show_var*, void *, enum enum_var_type);


/*
Expand Down
4 changes: 2 additions & 2 deletions include/mysql/plugin_audit.h.pp
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,10 @@
};
struct st_mysql_show_var {
const char *name;
char *value;
void *value;
enum enum_mysql_show_type type;
};
typedef int (*mysql_show_var_func)(void*, struct st_mysql_show_var*, char *, enum enum_var_type);
typedef int (*mysql_show_var_func)(void*, struct st_mysql_show_var*, void *, enum enum_var_type);
struct st_mysql_sys_var;
struct st_mysql_value;
typedef int (*mysql_var_check_func)(void* thd,
Expand Down
4 changes: 2 additions & 2 deletions include/mysql/plugin_auth.h.pp
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,10 @@
};
struct st_mysql_show_var {
const char *name;
char *value;
void *value;
enum enum_mysql_show_type type;
};
typedef int (*mysql_show_var_func)(void*, struct st_mysql_show_var*, char *, enum enum_var_type);
typedef int (*mysql_show_var_func)(void*, struct st_mysql_show_var*, void *, enum enum_var_type);
struct st_mysql_sys_var;
struct st_mysql_value;
typedef int (*mysql_var_check_func)(void* thd,
Expand Down
4 changes: 2 additions & 2 deletions include/mysql/plugin_encryption_key_management.h.pp
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,10 @@
};
struct st_mysql_show_var {
const char *name;
char *value;
void *value;
enum enum_mysql_show_type type;
};
typedef int (*mysql_show_var_func)(void*, struct st_mysql_show_var*, char *, enum enum_var_type);
typedef int (*mysql_show_var_func)(void*, struct st_mysql_show_var*, void *, enum enum_var_type);
struct st_mysql_sys_var;
struct st_mysql_value;
typedef int (*mysql_var_check_func)(void* thd,
Expand Down
4 changes: 2 additions & 2 deletions include/mysql/plugin_ftparser.h.pp
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,10 @@
};
struct st_mysql_show_var {
const char *name;
char *value;
void *value;
enum enum_mysql_show_type type;
};
typedef int (*mysql_show_var_func)(void*, struct st_mysql_show_var*, char *, enum enum_var_type);
typedef int (*mysql_show_var_func)(void*, struct st_mysql_show_var*, void *, enum enum_var_type);
struct st_mysql_sys_var;
struct st_mysql_value;
typedef int (*mysql_var_check_func)(void* thd,
Expand Down
4 changes: 2 additions & 2 deletions include/mysql/plugin_password_validation.h.pp
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,10 @@
};
struct st_mysql_show_var {
const char *name;
char *value;
void *value;
enum enum_mysql_show_type type;
};
typedef int (*mysql_show_var_func)(void*, struct st_mysql_show_var*, char *, enum enum_var_type);
typedef int (*mysql_show_var_func)(void*, struct st_mysql_show_var*, void *, enum enum_var_type);
struct st_mysql_sys_var;
struct st_mysql_value;
typedef int (*mysql_var_check_func)(void* thd,
Expand Down
335 changes: 169 additions & 166 deletions sql/mysqld.cc

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions sql/sql_show.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3132,15 +3132,15 @@ static bool show_status_array(THD *thd, const char *wild,
name_buffer, wild))) &&
(!cond || cond->val_int()))
{
char *value=var->value;
void *value=var->value;
const char *pos, *end; // We assign a lot of const's

if (show_type == SHOW_SYS)
{
sys_var *var= ((sys_var *) value);
sys_var *var= (sys_var *) value;
show_type= var->show_type();
mysql_mutex_lock(&LOCK_global_system_variables);
value= (char*) var->value_ptr(thd, scope, &null_lex_str);
value= var->value_ptr(thd, scope, &null_lex_str);
charset= var->charset(thd);
}

Expand Down Expand Up @@ -3200,7 +3200,7 @@ static bool show_status_array(THD *thd, const char *wild,
}
case SHOW_CHAR:
{
if (!(pos= value))
if (!(pos= (char*)value))
pos= "";
end= strend(pos);
break;
Expand Down

0 comments on commit 18feb62

Please sign in to comment.