fixed changing configuration cause crash with MySQL-5.1
parent
b9e947fd5f
commit
5864313741
|
@ -532,6 +532,11 @@ static const ThdOffsets thd_offsets_arr[] =
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//See here: http://bugs.mysql.com/bug.php?id=56652
|
||||||
|
#if (MYSQL_VERSION_ID < 50519) || (50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID < 50604)
|
||||||
|
# define AUDIT_NEED_FREE_STRING_MEMALLOC_PLUGIN_VAR
|
||||||
|
#endif
|
||||||
|
|
||||||
static const char * log_prefix = AUDIT_LOG_PREFIX;
|
static const char * log_prefix = AUDIT_LOG_PREFIX;
|
||||||
|
|
||||||
//possible audit handlers
|
//possible audit handlers
|
||||||
|
@ -1687,7 +1692,14 @@ static void delay_cmds_string_update(THD *thd,
|
||||||
const void *save)
|
const void *save)
|
||||||
{
|
{
|
||||||
num_delay_cmds = string_to_array(save, delay_cmds_array, SQLCOM_END + 2, MAX_COMMAND_CHAR_NUMBERS);
|
num_delay_cmds = string_to_array(save, delay_cmds_array, SQLCOM_END + 2, MAX_COMMAND_CHAR_NUMBERS);
|
||||||
delay_cmds_string = *static_cast<char* const *> (save);
|
|
||||||
|
#ifdef AUDIT_NEED_FREE_STRING_MEMALLOC_PLUGIN_VAR
|
||||||
|
my_free(delay_cmds_string, MYF(0));
|
||||||
|
delay_cmds_string = my_strdup(*static_cast<char*const*>(save), MYF(MY_WME));
|
||||||
|
#else
|
||||||
|
delay_cmds_string = *static_cast<char* const *> (save);
|
||||||
|
#endif
|
||||||
|
|
||||||
sql_print_information("%s Set num_delay_cmds: %d, delay cmds: %s", log_prefix, num_delay_cmds, delay_cmds_string);
|
sql_print_information("%s Set num_delay_cmds: %d, delay cmds: %s", log_prefix, num_delay_cmds, delay_cmds_string);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1696,7 +1708,14 @@ static void record_cmds_string_update(THD *thd,
|
||||||
const void *save)
|
const void *save)
|
||||||
{
|
{
|
||||||
num_record_cmds = string_to_array(save, record_cmds_array, SQLCOM_END + 2, MAX_COMMAND_CHAR_NUMBERS);
|
num_record_cmds = string_to_array(save, record_cmds_array, SQLCOM_END + 2, MAX_COMMAND_CHAR_NUMBERS);
|
||||||
record_cmds_string = *static_cast<char* const *> (save);
|
|
||||||
|
#ifdef AUDIT_NEED_FREE_STRING_MEMALLOC_PLUGIN_VAR
|
||||||
|
my_free(record_cmds_string, MYF(0));
|
||||||
|
record_cmds_string = my_strdup(*static_cast<char*const*>(save), MYF(MY_WME));
|
||||||
|
#else
|
||||||
|
record_cmds_string = *static_cast<char* const *> (save);
|
||||||
|
#endif
|
||||||
|
|
||||||
sql_print_information("%s Set num_record_cmds: %d record cmds: %s", log_prefix, num_record_cmds, record_cmds_string);
|
sql_print_information("%s Set num_record_cmds: %d record cmds: %s", log_prefix, num_record_cmds, record_cmds_string);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1704,8 +1723,13 @@ static void record_objs_string_update(THD *thd,
|
||||||
struct st_mysql_sys_var *var, void *tgt,
|
struct st_mysql_sys_var *var, void *tgt,
|
||||||
const void *save)
|
const void *save)
|
||||||
{
|
{
|
||||||
record_objs_string = *static_cast<char* const *> (save);
|
#ifdef AUDIT_NEED_FREE_STRING_MEMALLOC_PLUGIN_VAR
|
||||||
setup_record_objs_array();
|
my_free(record_objs_string, MYF(0));
|
||||||
|
record_objs_string = my_strdup(*static_cast<char*const*>(save), MYF(MY_WME));
|
||||||
|
#else
|
||||||
|
record_objs_string = *static_cast<char* const *> (save);
|
||||||
|
#endif
|
||||||
|
setup_record_objs_array();
|
||||||
}
|
}
|
||||||
|
|
||||||
//setup sysvars which update directly the relevant plugins
|
//setup sysvars which update directly the relevant plugins
|
||||||
|
|
Loading…
Reference in New Issue