diff options
-rw-r--r-- | mysql-test/suite/sys_vars/r/innodb_ft_user_stopword_table_basic.result | 1 | ||||
-rw-r--r-- | mysql-test/suite/sys_vars/t/innodb_ft_user_stopword_table_basic.test | 1 | ||||
-rw-r--r-- | sql/sql_plugin.cc | 9 |
3 files changed, 8 insertions, 3 deletions
diff --git a/mysql-test/suite/sys_vars/r/innodb_ft_user_stopword_table_basic.result b/mysql-test/suite/sys_vars/r/innodb_ft_user_stopword_table_basic.result index 73d665da530..66298481693 100644 --- a/mysql-test/suite/sys_vars/r/innodb_ft_user_stopword_table_basic.result +++ b/mysql-test/suite/sys_vars/r/innodb_ft_user_stopword_table_basic.result @@ -27,3 +27,4 @@ set global innodb_ft_user_stopword_table=1e1; ERROR 42000: Incorrect argument type to variable 'innodb_ft_user_stopword_table' set global innodb_ft_user_stopword_table='Salmon'; ERROR 42000: Variable 'innodb_ft_user_stopword_table' can't be set to the value of 'Salmon' +SET @@session.innodb_ft_user_stopword_table=@start_global_value; diff --git a/mysql-test/suite/sys_vars/t/innodb_ft_user_stopword_table_basic.test b/mysql-test/suite/sys_vars/t/innodb_ft_user_stopword_table_basic.test index 3e872404706..159e570b3ce 100644 --- a/mysql-test/suite/sys_vars/t/innodb_ft_user_stopword_table_basic.test +++ b/mysql-test/suite/sys_vars/t/innodb_ft_user_stopword_table_basic.test @@ -35,3 +35,4 @@ set global innodb_ft_user_stopword_table=1e1; --error ER_WRONG_VALUE_FOR_VAR set global innodb_ft_user_stopword_table='Salmon'; +SET @@session.innodb_ft_user_stopword_table=@start_global_value; diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index e89054ac849..941587150f3 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -2700,13 +2700,16 @@ static void update_func_longlong(THD *thd, struct st_mysql_sys_var *var, static void update_func_str(THD *thd, struct st_mysql_sys_var *var, void *tgt, const void *save) { - char *old= *(char **) tgt; - *(char **)tgt= *(char **) save; + char *value= *(char**) save; if (var->flags & PLUGIN_VAR_MEMALLOC) { - *(char **)tgt= my_strdup(*(char **) save, MYF(0)); + char *old= *(char**) tgt; + if (value) + *(char**) tgt= my_strdup(value, MYF(0)); my_free(old); } + else + *(char**) tgt= value; } |