Commit 0ec641ea authored by Oleksandr Byelkin's avatar Oleksandr Byelkin

MDEV-22134: handle_fatal_signal (sig=11) in __strlen_avx2 on START SLAVE |...

MDEV-22134: handle_fatal_signal (sig=11) in __strlen_avx2 on START SLAVE | Assertion `global_system_variables.session_track_system_variables' failed in Session_sysvars_tracker::init | *** buffer overflow detected *** (on optimized builds)

Prohibit assigning NULL as for other system variables.
parent c86accc7
...@@ -45,3 +45,15 @@ Warning 1681 'engine_condition_pushdown=on' is deprecated and will be removed in ...@@ -45,3 +45,15 @@ Warning 1681 'engine_condition_pushdown=on' is deprecated and will be removed in
set @@optimizer_switch=@save_optimizer_switch; set @@optimizer_switch=@save_optimizer_switch;
SET @@session.session_track_system_variables= @save_session_track_system_variables; SET @@session.session_track_system_variables= @save_session_track_system_variables;
# End of 10.2 tests # End of 10.2 tests
#
# MDEV-22134 handle_fatal_signal (sig=11) in __strlen_avx2 on START
# SLAVE | Assertion
# `global_system_variables.session_track_system_variables' failed in
# Session_sysvars_tracker::init | *** buffer overflow detected ***
# (on optimized builds)
#
SET @@GLOBAL.session_track_system_variables=NULL;
ERROR 42000: Variable 'session_track_system_variables' can't be set to the value of 'NULL'
SET SESSION session_track_system_variables=NULL;
ERROR 42000: Variable 'session_track_system_variables' can't be set to the value of 'NULL'
# End of 10.3 tests
...@@ -45,3 +45,18 @@ set @@optimizer_switch=@save_optimizer_switch; ...@@ -45,3 +45,18 @@ set @@optimizer_switch=@save_optimizer_switch;
SET @@session.session_track_system_variables= @save_session_track_system_variables; SET @@session.session_track_system_variables= @save_session_track_system_variables;
--echo # End of 10.2 tests --echo # End of 10.2 tests
--echo #
--echo # MDEV-22134 handle_fatal_signal (sig=11) in __strlen_avx2 on START
--echo # SLAVE | Assertion
--echo # `global_system_variables.session_track_system_variables' failed in
--echo # Session_sysvars_tracker::init | *** buffer overflow detected ***
--echo # (on optimized builds)
--echo #
--error ER_WRONG_VALUE_FOR_VAR
SET @@GLOBAL.session_track_system_variables=NULL;
--error ER_WRONG_VALUE_FOR_VAR
SET SESSION session_track_system_variables=NULL;
--echo # End of 10.3 tests
...@@ -110,15 +110,9 @@ autocommit,character_set_client,character_set_connection,character_set_results,t ...@@ -110,15 +110,9 @@ autocommit,character_set_client,character_set_connection,character_set_results,t
connection default; connection default;
# Testing NULL # Testing NULL
SET @@global.session_track_system_variables = NULL; SET @@global.session_track_system_variables = NULL;
ERROR 42000: Variable 'session_track_system_variables' can't be set to the value of 'NULL'
SET @@session.session_track_system_variables = NULL; SET @@session.session_track_system_variables = NULL;
# Global - expect "" instead of NULL ERROR 42000: Variable 'session_track_system_variables' can't be set to the value of 'NULL'
SELECT @@global.session_track_system_variables;
@@global.session_track_system_variables
NULL
# Session - expect "" instead of NULL
SELECT @@session.session_track_system_variables;
@@session.session_track_system_variables
# testing with duplicate entries. # testing with duplicate entries.
SET @@global.session_track_system_variables= "time_zone"; SET @@global.session_track_system_variables= "time_zone";
SET @@session.session_track_system_variables= "time_zone"; SET @@session.session_track_system_variables= "time_zone";
......
...@@ -85,14 +85,11 @@ SELECT @@session.session_track_system_variables; ...@@ -85,14 +85,11 @@ SELECT @@session.session_track_system_variables;
connection default; connection default;
--echo # Testing NULL --echo # Testing NULL
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.session_track_system_variables = NULL; SET @@global.session_track_system_variables = NULL;
--error ER_WRONG_VALUE_FOR_VAR
SET @@session.session_track_system_variables = NULL; SET @@session.session_track_system_variables = NULL;
--echo # Global - expect "" instead of NULL
SELECT @@global.session_track_system_variables;
--echo # Session - expect "" instead of NULL
SELECT @@session.session_track_system_variables;
--echo # testing with duplicate entries. --echo # testing with duplicate entries.
# Lets first set it to some valid value. # Lets first set it to some valid value.
SET @@global.session_track_system_variables= "time_zone"; SET @@global.session_track_system_variables= "time_zone";
......
...@@ -189,7 +189,13 @@ bool sysvartrack_validate_value(THD *thd, const char *str, size_t len) ...@@ -189,7 +189,13 @@ bool sysvartrack_validate_value(THD *thd, const char *str, size_t len)
char *token, *lasts= NULL; char *token, *lasts= NULL;
size_t rest= var_list.length; size_t rest= var_list.length;
if (!var_list.str || var_list.length == 0 || if (!var_list.str)
{
my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0),
"session_track_system_variables", "NULL");
return false;
}
if (var_list.length == 0 ||
!strcmp(var_list.str, "*")) !strcmp(var_list.str, "*"))
{ {
return false; return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment