| 1 |
################################################################################ |
| 2 |
# This test checks that the value of the group_replication_components_stop_timeout |
| 3 |
# is settable even without group replication running. |
| 4 |
# |
| 5 |
# Test: |
| 6 |
# 0. The test requires one server. |
| 7 |
# 1. Test that group_replication_components_stop_timeout variable doesn't accept |
| 8 |
# invalid inputs and truncates out of range values. |
| 9 |
# 2. Set the timeout to the value without starting group replication. This |
| 10 |
# should work without failure. |
| 11 |
# 3. Set the timeout to the value but after starting group replication. This |
| 12 |
# should work without failure. |
| 13 |
################################################################################ |
| 14 |
|
| 15 |
--let $group_replication_group_name= 2d249320-2e06-11e3-aa6e-0800200c9a66 |
| 16 |
--source include/have_group_replication_plugin.inc |
| 17 |
--let $rpl_skip_group_replication_start= 1 |
| 18 |
--source include/group_replication.inc |
| 19 |
|
| 20 |
SET @group_replication_components_stop_timeout_save = @@GLOBAL.group_replication_components_stop_timeout; |
| 21 |
|
| 22 |
--eval SET GLOBAL group_replication_group_name= "$group_replication_group_name" |
| 23 |
|
| 24 |
# Set invalid values. These should fail. |
| 25 |
--error ER_WRONG_TYPE_FOR_VAR |
| 26 |
SET GLOBAL group_replication_components_stop_timeout= NULL; |
| 27 |
|
| 28 |
--error ER_WRONG_TYPE_FOR_VAR |
| 29 |
SET GLOBAL group_replication_components_stop_timeout= "a"; |
| 30 |
|
| 31 |
--error ER_WRONG_TYPE_FOR_VAR |
| 32 |
SET GLOBAL group_replication_components_stop_timeout= 1.2; |
| 33 |
|
| 34 |
# Set out of range values. These must truncate. |
| 35 |
--disable_warnings |
| 36 |
SET GLOBAL group_replication_components_stop_timeout= -1; |
| 37 |
--enable_warnings |
| 38 |
--let $assert_text= The value for group_replication_components_stop_timeout should be 2 |
| 39 |
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_components_stop_timeout]" = 2 |
| 40 |
--source include/assert.inc |
| 41 |
|
| 42 |
--disable_warnings |
| 43 |
SET GLOBAL group_replication_components_stop_timeout= 1; |
| 44 |
--enable_warnings |
| 45 |
--let $assert_text= The value for group_replication_components_stop_timeout should be 2 |
| 46 |
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_components_stop_timeout]" = 2 |
| 47 |
--source include/assert.inc |
| 48 |
|
| 49 |
--disable_warnings |
| 50 |
SET GLOBAL group_replication_components_stop_timeout= 31536001; |
| 51 |
--enable_warnings |
| 52 |
--let $assert_text= The value for group_replication_components_stop_timeout should be 31536000 |
| 53 |
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_components_stop_timeout]" = 31536000 |
| 54 |
--source include/assert.inc |
| 55 |
|
| 56 |
# Set the timeout to the value without starting group replication. This should work without failure. |
| 57 |
SET GLOBAL group_replication_components_stop_timeout= 31536; |
| 58 |
--let $assert_text= The value for group_replication_components_stop_timeout should be 31536 |
| 59 |
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_components_stop_timeout]" = 31536 |
| 60 |
--source include/assert.inc |
| 61 |
|
| 62 |
|
| 63 |
# Set the timeout to the value but after starting group replication. This should work without failure. |
| 64 |
--source include/start_and_bootstrap_group_replication.inc |
| 65 |
|
| 66 |
SET GLOBAL group_replication_components_stop_timeout= 3153; |
| 67 |
--let $assert_text= The value for group_replication_components_stop_timeout should be 3153 |
| 68 |
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_components_stop_timeout]" = 3153 |
| 69 |
--source include/assert.inc |
| 70 |
|
| 71 |
SET GLOBAl group_replication_components_stop_timeout = @group_replication_components_stop_timeout_save; |
| 72 |
--source include/group_replication_end.inc |