Skip to content
Permalink
Browse files
MDEV-22524 SIGABRT in safe_mutex_unlock with
session_track_system_variables and max_relay_log_size.

lock LOCK_global_system_variables around the get_one_variable() call
in the Session_sysvars_tracker::store_variable().
  • Loading branch information
Alexey Botchkov committed Oct 27, 2020
1 parent bc540b8 commit 8761571
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
@@ -159,6 +159,8 @@ SELECT @@session.session_track_system_variables;
@@session.session_track_system_variables


# MDEV-22524 SIGABRT in safe_mutex_unlock with session_track_system_variables and max_relay_log_size.
SET SESSION session_track_system_variables="sql_slave_skip_counter", sql_slave_skip_counter= 0;
# Restoring the original values.
SET @@global.session_track_system_variables = @global_saved_tmp;
# End of tests.
@@ -122,6 +122,8 @@ SELECT @@global.session_track_system_variables;
SELECT @@session.session_track_system_variables;
--echo

--echo # MDEV-22524 SIGABRT in safe_mutex_unlock with session_track_system_variables and max_relay_log_size.
SET SESSION session_track_system_variables="sql_slave_skip_counter", sql_slave_skip_counter= 0;

--echo # Restoring the original values.
SET @@global.session_track_system_variables = @global_saved_tmp;
@@ -772,8 +772,11 @@ my_bool Session_sysvars_tracker::store_variable(void *ptr, void *data_ptr)
show.name= svar->name.str;
show.value= (char *) svar;

mysql_mutex_lock(&LOCK_global_system_variables);
const char *value= get_one_variable(thd, &show, OPT_SESSION, SHOW_SYS, NULL,
&charset, val_buf, &val_length);
mysql_mutex_unlock(&LOCK_global_system_variables);

if (is_plugin)
mysql_mutex_unlock(&LOCK_plugin);

0 comments on commit 8761571

Please sign in to comment.