1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

more sys_var_str fixes

This commit is contained in:
serg@serg.mylan
2004-03-20 17:08:01 +01:00
parent d1f1bbefab
commit 61a365e696
3 changed files with 23 additions and 9 deletions

View File

@ -384,6 +384,15 @@ select @@session.key_buffer_size;
ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable
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 ''
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;
@@global.max_user_connections @@session.max_join_size
100 200

View File

@ -272,6 +272,15 @@ select @@session.key_buffer_size;
--error 1229
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

View File

@ -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,
set_var *var)
{
char *res= 0, *old_value;
uint new_length= 0;
/* If the string is "", delete old init command */
if (var && (new_length= var->value->str_value.length()))
{
if (!(res= my_strdup_with_length((byte*) var->value->str_value.ptr(),
new_length, MYF(0))))
char *res= 0, *old_value=(char *)(var ? var->value->str_value.ptr() : 0);
uint new_length= (var ? var->value->str_value.length() : 0);
if (!old_value) old_value="";
if (!(res= my_strdup_with_length(old_value, new_length, MYF(0))))
return 1;
}
/*
Replace the old value in such a way that the any thread using
the value will work.