| 1 |
# This file can be used to save the @@global.auto_increment_offset value at |
| 2 |
# the beginning of any test that intends to restart any of the participating |
| 3 |
# nodes. This is required as the node may get auto-assigned a different |
| 4 |
# auto_increment_offset value on restart, which could cause MTR's internal |
| 5 |
# post-check to fail. auto_increment_offset_restore.inc can be used at the |
| 6 |
# end of the test to restore these saved values. |
| 7 |
|
| 8 |
# Parameters |
| 9 |
# ---------- |
| 10 |
# $node_1 |
| 11 |
# Connection handle for 1st node |
| 12 |
# $node_2 |
| 13 |
# Connection handle for 2nd node |
| 14 |
# $node_3 (optional) |
| 15 |
# Connection handle for 3rd node |
| 16 |
# $node_4 (optional) |
| 17 |
# Connection handle for 4th node |
| 18 |
|
| 19 |
if (!$node_1) |
| 20 |
{ |
| 21 |
--die ERROR IN TEST: $node_1 must be set before sourcing auto_increment_offset_save.inc |
| 22 |
} |
| 23 |
|
| 24 |
if (!$node_2) |
| 25 |
{ |
| 26 |
--die ERROR IN TEST: $node_2 must be set before sourcing auto_increment_offset_save.inc |
| 27 |
} |
| 28 |
|
| 29 |
--connection $node_1 |
| 30 |
let $auto_increment_offset_node_1 = `SELECT @@global.auto_increment_offset`; |
| 31 |
--connection $node_2 |
| 32 |
let $auto_increment_offset_node_2 = `SELECT @@global.auto_increment_offset`; |
| 33 |
|
| 34 |
if ($node_3) |
| 35 |
{ |
| 36 |
--connection $node_3 |
| 37 |
let $auto_increment_offset_node_3 = `SELECT @@global.auto_increment_offset`; |
| 38 |
} |
| 39 |
|
| 40 |
if ($node_4) |
| 41 |
{ |
| 42 |
--connection $node_4 |
| 43 |
let $auto_increment_offset_node_4 = `SELECT @@global.auto_increment_offset`; |
| 44 |
} |