Debian Codegraph @

mysql-test/suite/group_replication/t/gr_poll_spin_loops.test

raw
1 ################################################################################
2 # Verify that group_replication_poll_spin_loops validates its input values.
3 #
4 # Test:
5 # 0. The test requires one server.
6 # 1. Set invalid values to group_replication_poll_spin_loops. Expect error.
7 # 2. Set invalid values to group_replication_poll_spin_loops that will be
8 # truncated.
9 # 3. Set valid values to group_replication_poll_spin_loops. Expect success.
10 # 4. Clean up.
11 ################################################################################
12 --source include/have_group_replication_plugin.inc
13 --let $rpl_skip_group_replication_start= 1
14 --source include/group_replication.inc
15
16 SET @group_replication_poll_spin_loops_save= @@GLOBAL.group_replication_poll_spin_loops;
17
18
19 --echo
20 --echo ############################################################
21 --echo # 1. Set invalid values to group_replication_poll_spin_loops.
22 --error ER_WRONG_TYPE_FOR_VAR
23 SET GLOBAL group_replication_poll_spin_loops= ON;
24
25 --error ER_WRONG_TYPE_FOR_VAR
26 SET GLOBAL group_replication_poll_spin_loops= OFF;
27
28 --error ER_WRONG_TYPE_FOR_VAR
29 SET GLOBAL group_replication_poll_spin_loops= " ";
30
31 --error ER_WRONG_TYPE_FOR_VAR
32 SET GLOBAL group_replication_poll_spin_loops= "a";
33
34 --error ER_WRONG_TYPE_FOR_VAR
35 SET GLOBAL group_replication_poll_spin_loops= 1.0;
36
37
38 --echo
39 --echo ############################################################
40 --echo # 2. Set invalid values to group_replication_poll_spin_loops
41 --echo # that will be truncated.
42 SET GLOBAL group_replication_poll_spin_loops= -1;
43 --let $assert_text= group_replication_poll_spin_loops is correct
44 --let $assert_cond= [SELECT @@GLOBAL.group_replication_poll_spin_loops] = 0
45 --source include/assert.inc
46
47 # With a 64 bit mysqld:18446744073709551615, with a 32 bit mysqld: 4294967295
48 --disable_warnings
49 SET GLOBAL group_replication_poll_spin_loops= 4294967296;
50 --enable_warnings
51 SELECT @@GLOBAL.group_replication_poll_spin_loops IN (4294967296,4294967295);
52
53 --disable_warnings
54 SET GLOBAL group_replication_poll_spin_loops= 12345678901;
55 --enable_warnings
56 SELECT @@GLOBAL.group_replication_poll_spin_loops IN (12345678901,4294967295);
57
58
59 --echo
60 --echo ############################################################
61 --echo # 3. Set valid values to group_replication_poll_spin_loops.
62 SET GLOBAL group_replication_poll_spin_loops= 0;
63 --let $assert_text= group_replication_poll_spin_loops is correct
64 --let $assert_cond= [SELECT @@GLOBAL.group_replication_poll_spin_loops] = 0
65 --source include/assert.inc
66
67 SET GLOBAL group_replication_poll_spin_loops= 1;
68 --let $assert_text= group_replication_poll_spin_loops is correct
69 --let $assert_cond= [SELECT @@GLOBAL.group_replication_poll_spin_loops] = 1
70 --source include/assert.inc
71
72 SET GLOBAL group_replication_poll_spin_loops= 65535;
73 --let $assert_text= group_replication_poll_spin_loops is correct
74 --let $assert_cond= [SELECT @@GLOBAL.group_replication_poll_spin_loops] = 65535
75 --source include/assert.inc
76
77 SET GLOBAL group_replication_poll_spin_loops= 4294967295;
78 --let $assert_text= group_replication_poll_spin_loops is correct
79 --let $assert_cond= [SELECT @@GLOBAL.group_replication_poll_spin_loops] = 4294967295
80 --source include/assert.inc
81
82
83 --echo
84 --echo ############################################################
85 --echo # 4. Clean up.
86 SET GLOBAL group_replication_poll_spin_loops= @group_replication_poll_spin_loops_save;
87 --source include/group_replication_end.inc