summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@skysql.com>2014-09-09 09:25:47 -0400
committerNirbhay Choubey <nirbhay@skysql.com>2014-09-09 09:25:47 -0400
commitf3e95caacdd366d2c1300a7044b05d5a91ca1ffa (patch)
treefc2e5de8952720aee6470234ddc0644e68d39c1e /mysql-test
parent47fcca0ffcc09623731f3e36d61ccc8da6b0f493 (diff)
downloadmariadb-git-f3e95caacdd366d2c1300a7044b05d5a91ca1ffa.tar.gz
MDEV-6699 : wsrep_node_name not automatically set to hostname
Fixed by using hostname (glob_hostname) as default value for wsrep_node_name system variable. Added a test case.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_node_name_basic.result39
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_node_name_basic.test20
2 files changed, 41 insertions, 18 deletions
diff --git a/mysql-test/suite/sys_vars/r/wsrep_node_name_basic.result b/mysql-test/suite/sys_vars/r/wsrep_node_name_basic.result
index 9657e6bf428..763d0612a1b 100644
--- a/mysql-test/suite/sys_vars/r/wsrep_node_name_basic.result
+++ b/mysql-test/suite/sys_vars/r/wsrep_node_name_basic.result
@@ -4,10 +4,10 @@
call mtr.add_suppression("WSREP: Failed to get provider options");
# save the initial value
SET @wsrep_node_name_global_saved = @@global.wsrep_node_name;
-# default
-SELECT @@global.wsrep_node_name;
-@@global.wsrep_node_name
-
+# default (expect 1)
+SELECT COUNT(@@global.wsrep_node_name);
+COUNT(@@global.wsrep_node_name)
+1
# scope
SELECT @@session.wsrep_node_name;
@@ -27,21 +27,34 @@ SELECT @@global.wsrep_node_name;
@@global.wsrep_node_name
hyphenated-node-name
SET @@global.wsrep_node_name=default;
-SELECT @@global.wsrep_node_name;
-@@global.wsrep_node_name
-
+# default (expect 1)
+SELECT COUNT(@@global.wsrep_node_name);
+COUNT(@@global.wsrep_node_name)
+1
# invalid values
SET @@global.wsrep_node_name=NULL;
ERROR 42000: Variable 'wsrep_node_name' can't be set to the value of 'NULL'
-SELECT @@global.wsrep_node_name;
-@@global.wsrep_node_name
-
+SELECT COUNT(@@global.wsrep_node_name);
+COUNT(@@global.wsrep_node_name)
+1
SET @@global.wsrep_node_name=1;
ERROR 42000: Incorrect argument type to variable 'wsrep_node_name'
-SELECT @@global.wsrep_node_name;
-@@global.wsrep_node_name
-
+SELECT COUNT(@@global.wsrep_node_name);
+COUNT(@@global.wsrep_node_name)
+1
+#
+# MDEV-6699 : wsrep_node_name not automaticly set to hostname
+#
+SET @@global.wsrep_node_name=default;
+SELECT @@GLOBAL.wsrep_node_name = VARIABLE_VALUE FROM
+INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='hostname';
+@@GLOBAL.wsrep_node_name = VARIABLE_VALUE
+1
+SELECT @@GLOBAL.wsrep_node_name = VARIABLE_VALUE FROM
+INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='wsrep_node_name';
+@@GLOBAL.wsrep_node_name = VARIABLE_VALUE
+1
# restore the initial value
SET @@global.wsrep_node_name = @wsrep_node_name_global_saved;
diff --git a/mysql-test/suite/sys_vars/t/wsrep_node_name_basic.test b/mysql-test/suite/sys_vars/t/wsrep_node_name_basic.test
index 1f3ccc0de2c..7bc9bec8b95 100644
--- a/mysql-test/suite/sys_vars/t/wsrep_node_name_basic.test
+++ b/mysql-test/suite/sys_vars/t/wsrep_node_name_basic.test
@@ -9,8 +9,8 @@ call mtr.add_suppression("WSREP: Failed to get provider options");
--echo # save the initial value
SET @wsrep_node_name_global_saved = @@global.wsrep_node_name;
---echo # default
-SELECT @@global.wsrep_node_name;
+--echo # default (expect 1)
+SELECT COUNT(@@global.wsrep_node_name);
--echo
--echo # scope
@@ -26,16 +26,26 @@ SELECT @@global.wsrep_node_name;
SET @@global.wsrep_node_name='hyphenated-node-name';
SELECT @@global.wsrep_node_name;
SET @@global.wsrep_node_name=default;
-SELECT @@global.wsrep_node_name;
+--echo # default (expect 1)
+SELECT COUNT(@@global.wsrep_node_name);
--echo
--echo # invalid values
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_node_name=NULL;
-SELECT @@global.wsrep_node_name;
+SELECT COUNT(@@global.wsrep_node_name);
--error ER_WRONG_TYPE_FOR_VAR
SET @@global.wsrep_node_name=1;
-SELECT @@global.wsrep_node_name;
+SELECT COUNT(@@global.wsrep_node_name);
+
+--echo #
+--echo # MDEV-6699 : wsrep_node_name not automaticly set to hostname
+--echo #
+SET @@global.wsrep_node_name=default;
+SELECT @@GLOBAL.wsrep_node_name = VARIABLE_VALUE FROM
+INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='hostname';
+SELECT @@GLOBAL.wsrep_node_name = VARIABLE_VALUE FROM
+INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='wsrep_node_name';
--echo
--echo # restore the initial value