summaryrefslogtreecommitdiff
path: root/mysql-test/suite
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@skysql.com>2014-09-09 13:43:01 -0400
committerNirbhay Choubey <nirbhay@skysql.com>2014-09-09 13:43:01 -0400
commit4ffccff45dfb8e1856c5582913d31c7e18c2f788 (patch)
tree0bb68482a755a0543aefb1cf562d7297f8d7ff89 /mysql-test/suite
parentf3e95caacdd366d2c1300a7044b05d5a91ca1ffa (diff)
downloadmariadb-git-4ffccff45dfb8e1856c5582913d31c7e18c2f788.tar.gz
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.
Diffstat (limited to 'mysql-test/suite')
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_data_home_dir_basic.result53
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_data_home_dir_basic.test22
2 files changed, 47 insertions, 28 deletions
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