| 1 |
################################################################################ |
| 2 |
# This test verifies that auto_increment_increment and auto_increment_offset |
| 3 |
# are set to its default value of 1, when configure in single primary mode and |
| 4 |
# any change to group_replication_auto_increment_increment doesn't affect its |
| 5 |
# value. |
| 6 |
# |
| 7 |
# Test: |
| 8 |
# 0. The test requires two servers: M1 and M2. |
| 9 |
# 1. Start Group Replication on server1 |
| 10 |
# 2. Save initial value of GROUP_REPLICATION_AUTO_INCREMENT_INCREMENT for server2 |
| 11 |
# 3. Verify default values of group_replication_auto_increment_increment, |
| 12 |
# auto_increment_increment and auto_increment_offset. |
| 13 |
# 4. Start group replication on server2. |
| 14 |
# 5. Verify the values of group_replication_auto_increment_increment, |
| 15 |
# auto_increment_increment and auto_increment_offset after starting GR. |
| 16 |
# 6. Set group_replication_auto_increment_increment |
| 17 |
# and restart group replication. |
| 18 |
# 7. Verify the effects of group_replication_auto_increment_increment |
| 19 |
# on auto_increment_increment on starting GR. |
| 20 |
# 8. Verify that auto_increment_offset is still is set to default |
| 21 |
# 9. Clean up. |
| 22 |
################################################################################ |
| 23 |
--source include/big_test.inc |
| 24 |
--source include/have_group_replication_plugin.inc |
| 25 |
--let $rpl_skip_group_replication_start= 1 |
| 26 |
--let $rpl_group_replication_single_primary_mode=1 |
| 27 |
--source include/group_replication.inc |
| 28 |
|
| 29 |
|
| 30 |
--echo # |
| 31 |
--echo # 1. Start Group Replication on server1 |
| 32 |
--let $rpl_connection_name= server1 |
| 33 |
--source include/rpl_connection.inc |
| 34 |
--source include/start_and_bootstrap_group_replication.inc |
| 35 |
|
| 36 |
|
| 37 |
--echo # |
| 38 |
--echo # 2. Save initial value of GROUP_REPLICATION_AUTO_INCREMENT_INCREMENT for server2 |
| 39 |
--let $rpl_connection_name= server2 |
| 40 |
--source include/rpl_connection.inc |
| 41 |
--let $_init_auto_increment= `SELECT @@GLOBAL.GROUP_REPLICATION_AUTO_INCREMENT_INCREMENT` |
| 42 |
|
| 43 |
|
| 44 |
--echo # 3. Verify default values of group_replication_auto_increment_increment, |
| 45 |
--echo # auto_increment_increment and auto_increment_offset. |
| 46 |
|
| 47 |
--let $assert_text= The default value of group_replication_auto_increment_increment should be 7 |
| 48 |
--let $assert_cond= [SELECT @@GLOBAL.group_replication_auto_increment_increment] = 7 |
| 49 |
--source include/assert.inc |
| 50 |
|
| 51 |
--let $assert_text= The default value of auto_increment_increment should be 1 |
| 52 |
--let $assert_cond= [SELECT @@GLOBAL.auto_increment_increment] = 1 |
| 53 |
--source include/assert.inc |
| 54 |
|
| 55 |
--let $assert_text= The default value of auto_increment_offset should be 1 |
| 56 |
--let $assert_cond= [SELECT @@GLOBAL.auto_increment_offset] = 1 |
| 57 |
--source include/assert.inc |
| 58 |
|
| 59 |
|
| 60 |
--echo # 4. Start group replication on server2. |
| 61 |
--source include/start_group_replication.inc |
| 62 |
|
| 63 |
|
| 64 |
--echo # 5. Verify the values of group_replication_auto_increment_increment, |
| 65 |
--echo # auto_increment_increment and auto_increment_offset after starting GR. |
| 66 |
|
| 67 |
--let $assert_text= The value of group_replication_auto_increment_increment is still 7 |
| 68 |
--let $assert_cond= [SELECT @@GLOBAL.group_replication_auto_increment_increment] = 7 |
| 69 |
--source include/assert.inc |
| 70 |
|
| 71 |
--let $assert_text= The value of auto_increment_increment is set to 1 |
| 72 |
--let $assert_cond= [SELECT @@GLOBAL.auto_increment_increment] = 1 |
| 73 |
--source include/assert.inc |
| 74 |
|
| 75 |
--let $assert_text= The value of auto_increment_offset is set to 1 |
| 76 |
--let $assert_cond= [SELECT @@GLOBAL.auto_increment_offset] = 1 |
| 77 |
--source include/assert.inc |
| 78 |
|
| 79 |
|
| 80 |
--echo # 6. Set group_replication_auto_increment_increment |
| 81 |
--echo # and restart group replication. |
| 82 |
|
| 83 |
--source include/stop_group_replication.inc |
| 84 |
|
| 85 |
SET GLOBAL GROUP_REPLICATION_AUTO_INCREMENT_INCREMENT= 3; |
| 86 |
|
| 87 |
--source include/start_group_replication.inc |
| 88 |
|
| 89 |
|
| 90 |
--echo # 7. Verify the effects of group_replication_auto_increment_increment |
| 91 |
--echo # on auto_increment_increment on starting GR. |
| 92 |
|
| 93 |
--let $assert_text= The value of group_replication_auto_increment_increment is still 3 |
| 94 |
--let $assert_cond= [SELECT @@GLOBAL.group_replication_auto_increment_increment] = 3 |
| 95 |
--source include/assert.inc |
| 96 |
|
| 97 |
--let $assert_text= The value of auto_increment_increment is set to 1 |
| 98 |
--let $assert_cond= [SELECT @@GLOBAL.auto_increment_increment] = 1 |
| 99 |
--source include/assert.inc |
| 100 |
|
| 101 |
|
| 102 |
--echo # 8. Verify that auto_increment_offset is still is set to default |
| 103 |
--let $assert_text= The value of auto_increment_offset is set to 1 |
| 104 |
--let $assert_cond= [SELECT @@GLOBAL.auto_increment_offset] = 1 |
| 105 |
--source include/assert.inc |
| 106 |
|
| 107 |
|
| 108 |
--echo # 9. Cleanup |
| 109 |
--source include/stop_group_replication.inc |
| 110 |
--eval SET GLOBAL GROUP_REPLICATION_AUTO_INCREMENT_INCREMENT= $_init_auto_increment |
| 111 |
|
| 112 |
|
| 113 |
--source include/group_replication_end.inc |