diff options
author | Alexey Botchkov <holyfoot@askmonty.org> | 2020-10-23 12:20:17 +0400 |
---|---|---|
committer | Alexey Botchkov <holyfoot@askmonty.org> | 2020-10-23 12:20:17 +0400 |
commit | 94b493571a8ba8f30c97a5c30fc641171ca48e8a (patch) | |
tree | 982546ee8c2af558eff23fd15136dcd700103a57 | |
parent | 897ea21e57034e45bf3bc5997ba1b560eabc8221 (diff) | |
download | mariadb-git-94b493571a8ba8f30c97a5c30fc641171ca48e8a.tar.gz |
MDEV-20744 SET GLOBAL `replicate_do_db` = DEFAULT causes crash.bb-10.1-hf
DEFAULT for the replicate_do_db is the "" as our documentation states.
-rw-r--r-- | mysql-test/suite/sys_vars/r/replicate_do_db_basic.result | 4 | ||||
-rw-r--r-- | mysql-test/suite/sys_vars/t/replicate_do_db_basic.test | 3 | ||||
-rw-r--r-- | sql/sys_vars.ic | 6 |
3 files changed, 12 insertions, 1 deletions
diff --git a/mysql-test/suite/sys_vars/r/replicate_do_db_basic.result b/mysql-test/suite/sys_vars/r/replicate_do_db_basic.result index a05b85a9bfd..54adf835962 100644 --- a/mysql-test/suite/sys_vars/r/replicate_do_db_basic.result +++ b/mysql-test/suite/sys_vars/r/replicate_do_db_basic.result @@ -37,5 +37,9 @@ SET @@GLOBAL.replicate_do_db=null; SELECT @@GLOBAL.replicate_do_db; @@GLOBAL.replicate_do_db +SET @@GLOBAL.replicate_do_db=DEFAULT; +SELECT @@GLOBAL.replicate_do_db; +@@GLOBAL.replicate_do_db + # Cleanup. SET @@GLOBAL.replicate_do_db = @save_replicate_do_db; diff --git a/mysql-test/suite/sys_vars/t/replicate_do_db_basic.test b/mysql-test/suite/sys_vars/t/replicate_do_db_basic.test index 59d0176add2..b7004d1938b 100644 --- a/mysql-test/suite/sys_vars/t/replicate_do_db_basic.test +++ b/mysql-test/suite/sys_vars/t/replicate_do_db_basic.test @@ -38,5 +38,8 @@ SELECT @@GLOBAL.replicate_do_db; SET @@GLOBAL.replicate_do_db=null; SELECT @@GLOBAL.replicate_do_db; +SET @@GLOBAL.replicate_do_db=DEFAULT; +SELECT @@GLOBAL.replicate_do_db; + --echo # Cleanup. SET @@GLOBAL.replicate_do_db = @save_replicate_do_db; diff --git a/sql/sys_vars.ic b/sql/sys_vars.ic index ae4568866b7..737f9bb545c 100644 --- a/sql/sys_vars.ic +++ b/sql/sys_vars.ic @@ -614,7 +614,11 @@ public: { DBUG_ASSERT(FALSE); } void global_save_default(THD *thd, set_var *var) - { DBUG_ASSERT(FALSE); } + { + char *ptr= (char*)(intptr)option.def_value; + var->save_result.string_value.str= ptr; + var->save_result.string_value.length= ptr ? strlen(ptr) : 0; + } bool session_update(THD *thd, set_var *var) { |