| 1 |
|
| 2 |
if ($rpl_inited) |
| 3 |
{ |
| 4 |
if (!$allow_rpl_inited) |
| 5 |
{ |
| 6 |
--die ERROR IN TEST: When using the replication test framework (master-slave.inc, rpl_init.inc etc), use rpl_restart_server.inc instead of restart_mysqld.inc. If you know what you are doing and you really have to use restart_mysqld.inc, set allow_rpl_inited=1 before you source restart_mysqld.inc |
| 7 |
} |
| 8 |
} |
| 9 |
|
| 10 |
if (!$restart_parameters) |
| 11 |
{ |
| 12 |
let $restart_parameters = restart; |
| 13 |
} |
| 14 |
|
| 15 |
# We use --exec echo instead of simple "--echo" because |
| 16 |
# replace_result works on --exec |
| 17 |
--exec echo "# $restart_parameters" |
| 18 |
|
| 19 |
# Write file to make mysql-test-run.pl expect the "crash", but don't start |
| 20 |
# it until it's told to |
| 21 |
--let $_server_id= `SELECT @@server_id` |
| 22 |
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect |
| 23 |
|
| 24 |
# Allow restarting different server than the one currently |
| 25 |
# connected to, actually one where suffix is not .serverid but |
| 26 |
# .serverid.clusterid |
| 27 |
if ($mysqld_name) |
| 28 |
{ |
| 29 |
let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$mysqld_name.expect; |
| 30 |
# echo expect_file_name: $_expect_file_name; |
| 31 |
} |
| 32 |
--exec echo "wait" > $_expect_file_name |
| 33 |
|
| 34 |
# Send shutdown to the connected server. |
| 35 |
--error 0,1,175 |
| 36 |
shutdown_server; |
| 37 |
|
| 38 |
--source include/wait_until_disconnected.inc |
| 39 |
|
| 40 |
# Write file to make mysql-test-run.pl start up the server again |
| 41 |
--exec echo "$restart_parameters" > $_expect_file_name |
| 42 |
|
| 43 |
# Turn on reconnect |
| 44 |
--enable_reconnect |
| 45 |
|
| 46 |
# Call script that will poll the server waiting for it to be back online again |
| 47 |
--source ../include/wait_until_connected_again_pipe.inc |
| 48 |
|
| 49 |
# Turn off reconnect again |
| 50 |
--disable_reconnect |
| 51 |
|