| 1 |
INSTALL COMPONENT "file://component_test_host_application_signal"; |
| 2 |
|
| 3 |
let $log_error_= `SELECT @@GLOBAL.log_error`; |
| 4 |
if($log_error_ == "stderr") |
| 5 |
{ |
| 6 |
let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.1.err; |
| 7 |
} |
| 8 |
let SEARCH_FILE=$log_error_; |
| 9 |
|
| 10 |
--echo # Test for bad service id |
| 11 |
SELECT test_shutdown_signal(2); |
| 12 |
|
| 13 |
--echo # shutdown the server from mtr. |
| 14 |
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 15 |
--shutdown_server |
| 16 |
--source include/wait_until_disconnected.inc |
| 17 |
|
| 18 |
--echo # restart the server. |
| 19 |
--exec echo "restart:" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 20 |
--enable_reconnect |
| 21 |
--source include/wait_until_connected_again.inc |
| 22 |
|
| 23 |
--echo # start the sql client and test the shutdown UDF with 0 |
| 24 |
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 25 |
--exec $MYSQL -e "SELECT test_shutdown_signal(0);" 2>&1 |
| 26 |
--source include/wait_until_disconnected.inc |
| 27 |
|
| 28 |
--echo # Search for the message in the log |
| 29 |
let SEARCH_PATTERN=Received SHUTDOWN from user .internal signal component service; |
| 30 |
--source include/search_pattern.inc |
| 31 |
|
| 32 |
--echo # restart the server |
| 33 |
--exec echo "restart:" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 34 |
--enable_reconnect |
| 35 |
--source include/wait_until_connected_again.inc |
| 36 |
|
| 37 |
--echo # start the sql client and test the shutdown UDF with 1 |
| 38 |
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 39 |
--exec $MYSQL -e "SELECT test_shutdown_signal(1);" 2>&1 |
| 40 |
--source include/wait_until_disconnected.inc |
| 41 |
|
| 42 |
--echo # Search for the message in the log |
| 43 |
let SEARCH_PATTERN=Received SHUTDOWN from user .internal signal component service; |
| 44 |
--source include/search_pattern.inc |
| 45 |
|
| 46 |
--echo # restart server. |
| 47 |
--exec echo "restart:" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 48 |
--enable_reconnect |
| 49 |
--source include/wait_until_connected_again.inc |
| 50 |
|
| 51 |
UNINSTALL COMPONENT "file://component_test_host_application_signal"; |