| 1 |
############################################################################### |
| 2 |
# |
| 3 |
# When changing to single primary mode the auto increment values |
| 4 |
# of the server shall return to the base values if no user set value |
| 5 |
# is present. |
| 6 |
# |
| 7 |
# auto_increment_increment should be 1 on single primary and 7 on multi primary |
| 8 |
# auto_increment_offset should be equal to server id, for example on server1 is 1 |
| 9 |
# |
| 10 |
# Test: |
| 11 |
# 0. This test requires one server |
| 12 |
# 1. Confirm value of auto_increment_increment is 1 and |
| 13 |
# auto_increment_offset is 1 with server stopped |
| 14 |
# 2. Start server and bootstrap group |
| 15 |
# 3. On Multi primary the default value of auto_increment_increment is 7 |
| 16 |
# and the value of auto_increment_offset is 1 |
| 17 |
# 4. Change to single primary mode and confirm that value of |
| 18 |
# auto_increment_increment is 1 and auto_increment_offset is 1 |
| 19 |
# 5. Stop server and confirm value of auto_increment_increment is 1 and |
| 20 |
# auto_increment_offset is 1 |
| 21 |
# 6. Clean up |
| 22 |
# |
| 23 |
############################################################################### |
| 24 |
|
| 25 |
--source include/have_group_replication_plugin.inc |
| 26 |
--let $rpl_skip_group_replication_start= 1 |
| 27 |
--source include/group_replication.inc |
| 28 |
|
| 29 |
--echo |
| 30 |
--echo # 1. Confirm value of auto_increment_increment is 1 and |
| 31 |
--echo # auto_increment_offset is 1 with server stopped |
| 32 |
|
| 33 |
--let $assert_text= The default value of auto_increment_increment for single primary should be 1 |
| 34 |
--let $assert_cond= [SELECT @@GLOBAL.auto_increment_increment] = 1 |
| 35 |
--source include/assert.inc |
| 36 |
|
| 37 |
--let $assert_text= The default value of auto_increment_offset for single primary should be 1 |
| 38 |
--let $assert_cond= [SELECT @@GLOBAL.auto_increment_offset] = 1 |
| 39 |
--source include/assert.inc |
| 40 |
|
| 41 |
--echo |
| 42 |
--echo # 2. Start server and bootstrap group |
| 43 |
|
| 44 |
--source include/start_and_bootstrap_group_replication.inc |
| 45 |
|
| 46 |
--echo |
| 47 |
--echo # 3. On Multi primary the default value of auto_increment_increment is 7 |
| 48 |
--echo # and the value of auto_increment_offset is 1 |
| 49 |
|
| 50 |
--let $assert_text= The default value of auto_increment_increment for single primary should be 7 |
| 51 |
--let $assert_cond= [SELECT @@GLOBAL.auto_increment_increment] = 7 |
| 52 |
--source include/assert.inc |
| 53 |
|
| 54 |
--let $assert_text= The default value of auto_increment_offset for single primary should be 1 |
| 55 |
--let $assert_cond= [SELECT @@GLOBAL.auto_increment_offset] = 1 |
| 56 |
--source include/assert.inc |
| 57 |
|
| 58 |
--echo |
| 59 |
--echo # 4. Change to single primary mode and confirm that value of |
| 60 |
--echo # auto_increment_increment is 1 and auto_increment_offset is 1 |
| 61 |
|
| 62 |
SELECT group_replication_switch_to_single_primary_mode(); |
| 63 |
|
| 64 |
--let $assert_text= The default value of auto_increment_increment for single primary should be 1 |
| 65 |
--let $assert_cond= [SELECT @@GLOBAL.auto_increment_increment] = 1 |
| 66 |
--source include/assert.inc |
| 67 |
|
| 68 |
--let $assert_text= The default value of auto_increment_offset for single primary should be 1 |
| 69 |
--let $assert_cond= [SELECT @@GLOBAL.auto_increment_offset] = 1 |
| 70 |
--source include/assert.inc |
| 71 |
|
| 72 |
--source include/stop_group_replication.inc |
| 73 |
|
| 74 |
--echo |
| 75 |
--echo # 5. Stop server and confirm value of auto_increment_increment is 1 and |
| 76 |
--echo # auto_increment_offset is 1 |
| 77 |
|
| 78 |
--let $assert_text= The default value of auto_increment_increment for single primary should be 1 |
| 79 |
--let $assert_cond= [SELECT @@GLOBAL.auto_increment_increment] = 1 |
| 80 |
--source include/assert.inc |
| 81 |
|
| 82 |
--let $assert_text= The default value of auto_increment_offset for single primary should be 1 |
| 83 |
--let $assert_cond= [SELECT @@GLOBAL.auto_increment_offset] = 1 |
| 84 |
--source include/assert.inc |
| 85 |
|
| 86 |
|
| 87 |
--echo |
| 88 |
--echo # 6. Clean up |
| 89 |
|
| 90 |
--let $rpl_group_replication_single_primary_mode= 1 |
| 91 |
--let $rpl_group_replication_reset_persistent_vars=1 |
| 92 |
--source include/group_replication_end.inc |