summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/sys_vars/t/wsrep_node_name_basic.test
blob: 7bc9bec8b957d2ada0c71b00f32e950e1c7176c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
--source include/have_wsrep.inc

--echo #
--echo # wsrep_node_name
--echo #

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 (expect 1)
SELECT COUNT(@@global.wsrep_node_name);

--echo
--echo # scope
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.wsrep_node_name;
SET @@global.wsrep_node_name='node_name';
SELECT @@global.wsrep_node_name;

--echo
--echo # valid values
SET @@global.wsrep_node_name='my_node';
SELECT @@global.wsrep_node_name;
SET @@global.wsrep_node_name='hyphenated-node-name';
SELECT @@global.wsrep_node_name;
SET @@global.wsrep_node_name=default;
--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 COUNT(@@global.wsrep_node_name);
--error ER_WRONG_TYPE_FOR_VAR
SET @@global.wsrep_node_name=1;
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
SET @@global.wsrep_node_name = @wsrep_node_name_global_saved;

--echo # End of test