Commit 61a365e6 authored by serg@serg.mylan's avatar serg@serg.mylan

more sys_var_str fixes

parent d1f1bbef
...@@ -384,6 +384,15 @@ select @@session.key_buffer_size; ...@@ -384,6 +384,15 @@ select @@session.key_buffer_size;
ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable
set ft_boolean_syntax = @@init_connect; set ft_boolean_syntax = @@init_connect;
ERROR HY000: Variable 'ft_boolean_syntax' is a GLOBAL variable and should be set with SET GLOBAL ERROR HY000: Variable 'ft_boolean_syntax' is a GLOBAL variable and should be set with SET GLOBAL
set global ft_boolean_syntax = @@init_connect;
ERROR 42000: Variable 'ft_boolean_syntax' can't be set to the value of ''
set init_connect = NULL;
ERROR HY000: Variable 'init_connect' is a GLOBAL variable and should be set with SET GLOBAL
set global init_connect = NULL;
set ft_boolean_syntax = @@init_connect;
ERROR HY000: Variable 'ft_boolean_syntax' is a GLOBAL variable and should be set with SET GLOBAL
set global ft_boolean_syntax = @@init_connect;
ERROR 42000: Variable 'ft_boolean_syntax' can't be set to the value of ''
select @@global.max_user_connections,@@local.max_join_size; select @@global.max_user_connections,@@local.max_join_size;
@@global.max_user_connections @@session.max_join_size @@global.max_user_connections @@session.max_join_size
100 200 100 200
......
...@@ -272,6 +272,15 @@ select @@session.key_buffer_size; ...@@ -272,6 +272,15 @@ select @@session.key_buffer_size;
--error 1229 --error 1229
set ft_boolean_syntax = @@init_connect; set ft_boolean_syntax = @@init_connect;
--error 1231
set global ft_boolean_syntax = @@init_connect;
--error 1229
set init_connect = NULL;
set global init_connect = NULL;
--error 1229
set ft_boolean_syntax = @@init_connect;
--error 1231
set global ft_boolean_syntax = @@init_connect;
# #
# swap # swap
......
...@@ -835,15 +835,11 @@ bool sys_var_str::check(THD *thd, set_var *var) ...@@ -835,15 +835,11 @@ bool sys_var_str::check(THD *thd, set_var *var)
bool update_sys_var_str(sys_var_str *var_str, rw_lock_t *var_mutex, bool update_sys_var_str(sys_var_str *var_str, rw_lock_t *var_mutex,
set_var *var) set_var *var)
{ {
char *res= 0, *old_value; char *res= 0, *old_value=(char *)(var ? var->value->str_value.ptr() : 0);
uint new_length= 0; uint new_length= (var ? var->value->str_value.length() : 0);
/* If the string is "", delete old init command */ if (!old_value) old_value="";
if (var && (new_length= var->value->str_value.length())) if (!(res= my_strdup_with_length(old_value, new_length, MYF(0))))
{ return 1;
if (!(res= my_strdup_with_length((byte*) var->value->str_value.ptr(),
new_length, MYF(0))))
return 1;
}
/* /*
Replace the old value in such a way that the any thread using Replace the old value in such a way that the any thread using
the value will work. the value will work.
......
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