Merge 5864313741
into 3ad6a1775c
commit
4488c8d354
|
@ -346,6 +346,9 @@ static inline void yajl_add_obj( yajl_gen gen, const char *db,const char* ptype
|
||||||
//will return a pointer to the query and set len with the length of the query
|
//will return a pointer to the query and set len with the length of the query
|
||||||
//starting with MySQL version 5.1.41 thd_query_string is added
|
//starting with MySQL version 5.1.41 thd_query_string is added
|
||||||
#if MYSQL_VERSION_ID > 50140
|
#if MYSQL_VERSION_ID > 50140
|
||||||
|
extern "C" {
|
||||||
|
MYSQL_LEX_STRING *thd_query_string(MYSQL_THD thd);
|
||||||
|
}
|
||||||
static const char * thd_query_str(THD * thd, size_t * len)
|
static const char * thd_query_str(THD * thd, size_t * len)
|
||||||
{
|
{
|
||||||
MYSQL_LEX_STRING * str = thd_query_string(thd);
|
MYSQL_LEX_STRING * str = thd_query_string(thd);
|
||||||
|
|
|
@ -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