From 4ffccff45dfb8e1856c5582913d31c7e18c2f788 Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Tue, 9 Sep 2014 13:43:01 -0400 Subject: MDEV-6717 : wsrep_data_home_dir should default to @@datadir Used mysql_real_data_home as wsrep_data_home_dir's default. Added a test case. --- .../sys_vars/r/wsrep_data_home_dir_basic.result | 53 +++++++++++++--------- .../sys_vars/t/wsrep_data_home_dir_basic.test | 22 ++++++--- 2 files changed, 47 insertions(+), 28 deletions(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/sys_vars/r/wsrep_data_home_dir_basic.result b/mysql-test/suite/sys_vars/r/wsrep_data_home_dir_basic.result index 044ef8bf3bc..e0f4b478c90 100644 --- a/mysql-test/suite/sys_vars/r/wsrep_data_home_dir_basic.result +++ b/mysql-test/suite/sys_vars/r/wsrep_data_home_dir_basic.result @@ -2,47 +2,58 @@ # wsrep_data_home_dir (readonly) # # default -SELECT @@global.wsrep_data_home_dir; -@@global.wsrep_data_home_dir - +SELECT COUNT(@@global.wsrep_data_home_dir); +COUNT(@@global.wsrep_data_home_dir) +1 # scope SELECT @@session.wsrep_data_home_dir; ERROR HY000: Variable 'wsrep_data_home_dir' is a GLOBAL variable SET @@global.wsrep_data_home_dir='/tmp/data'; ERROR HY000: Variable 'wsrep_data_home_dir' is a read only variable -SELECT @@global.wsrep_data_home_dir; -@@global.wsrep_data_home_dir - +SELECT COUNT(@@global.wsrep_data_home_dir); +COUNT(@@global.wsrep_data_home_dir) +1 # valid values SET @@global.wsrep_data_home_dir='/tmp/data'; ERROR HY000: Variable 'wsrep_data_home_dir' is a read only variable -SELECT @@global.wsrep_data_home_dir; -@@global.wsrep_data_home_dir - +SELECT COUNT(@@global.wsrep_data_home_dir); +COUNT(@@global.wsrep_data_home_dir) +1 SET @@global.wsrep_data_home_dir=junk-dir; ERROR HY000: Variable 'wsrep_data_home_dir' is a read only variable -SELECT @@global.wsrep_data_home_dir; -@@global.wsrep_data_home_dir - +SELECT COUNT(@@global.wsrep_data_home_dir); +COUNT(@@global.wsrep_data_home_dir) +1 SET @@global.wsrep_data_home_dir=junk/dir; ERROR HY000: Variable 'wsrep_data_home_dir' is a read only variable -SELECT @@global.wsrep_data_home_dir; -@@global.wsrep_data_home_dir - +SELECT COUNT(@@global.wsrep_data_home_dir); +COUNT(@@global.wsrep_data_home_dir) +1 SET @@global.wsrep_data_home_dir=OFF; ERROR HY000: Variable 'wsrep_data_home_dir' is a read only variable -SELECT @@global.wsrep_data_home_dir; -@@global.wsrep_data_home_dir - +SELECT COUNT(@@global.wsrep_data_home_dir); +COUNT(@@global.wsrep_data_home_dir) +1 SET @@global.wsrep_data_home_dir=default; ERROR HY000: Variable 'wsrep_data_home_dir' is a read only variable -SELECT @@global.wsrep_data_home_dir; -@@global.wsrep_data_home_dir - +SELECT COUNT(@@global.wsrep_data_home_dir); +COUNT(@@global.wsrep_data_home_dir) +1 # invalid values SET @@global.wsrep_data_home_dir=NULL; ERROR HY000: Variable 'wsrep_data_home_dir' is a read only variable +# +# MDEV-6717 : wsrep_data_home_dir should default to @@datadir +# +SELECT @@GLOBAL.wsrep_data_home_dir = VARIABLE_VALUE FROM +INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='datadir'; +@@GLOBAL.wsrep_data_home_dir = VARIABLE_VALUE +1 +SELECT @@GLOBAL.wsrep_data_home_dir = VARIABLE_VALUE FROM +INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='wsrep_data_home_dir'; +@@GLOBAL.wsrep_data_home_dir = VARIABLE_VALUE +1 # End of test diff --git a/mysql-test/suite/sys_vars/t/wsrep_data_home_dir_basic.test b/mysql-test/suite/sys_vars/t/wsrep_data_home_dir_basic.test index 41f97cfdaf6..cd50fbc389e 100644 --- a/mysql-test/suite/sys_vars/t/wsrep_data_home_dir_basic.test +++ b/mysql-test/suite/sys_vars/t/wsrep_data_home_dir_basic.test @@ -5,7 +5,7 @@ --echo # --echo # default -SELECT @@global.wsrep_data_home_dir; +SELECT COUNT(@@global.wsrep_data_home_dir); --echo --echo # scope @@ -13,29 +13,37 @@ SELECT @@global.wsrep_data_home_dir; SELECT @@session.wsrep_data_home_dir; --error ER_INCORRECT_GLOBAL_LOCAL_VAR SET @@global.wsrep_data_home_dir='/tmp/data'; -SELECT @@global.wsrep_data_home_dir; +SELECT COUNT(@@global.wsrep_data_home_dir); --echo --echo # valid values --error ER_INCORRECT_GLOBAL_LOCAL_VAR SET @@global.wsrep_data_home_dir='/tmp/data'; -SELECT @@global.wsrep_data_home_dir; +SELECT COUNT(@@global.wsrep_data_home_dir); --error ER_INCORRECT_GLOBAL_LOCAL_VAR SET @@global.wsrep_data_home_dir=junk-dir; -SELECT @@global.wsrep_data_home_dir; +SELECT COUNT(@@global.wsrep_data_home_dir); --error ER_INCORRECT_GLOBAL_LOCAL_VAR SET @@global.wsrep_data_home_dir=junk/dir; -SELECT @@global.wsrep_data_home_dir; +SELECT COUNT(@@global.wsrep_data_home_dir); --error ER_INCORRECT_GLOBAL_LOCAL_VAR SET @@global.wsrep_data_home_dir=OFF; -SELECT @@global.wsrep_data_home_dir; +SELECT COUNT(@@global.wsrep_data_home_dir); --error ER_INCORRECT_GLOBAL_LOCAL_VAR SET @@global.wsrep_data_home_dir=default; -SELECT @@global.wsrep_data_home_dir; +SELECT COUNT(@@global.wsrep_data_home_dir); --echo --echo # invalid values --error ER_INCORRECT_GLOBAL_LOCAL_VAR SET @@global.wsrep_data_home_dir=NULL; +--echo # +--echo # MDEV-6717 : wsrep_data_home_dir should default to @@datadir +--echo # +SELECT @@GLOBAL.wsrep_data_home_dir = VARIABLE_VALUE FROM +INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='datadir'; +SELECT @@GLOBAL.wsrep_data_home_dir = VARIABLE_VALUE FROM +INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='wsrep_data_home_dir'; + --echo # End of test -- cgit v1.2.1