| 1 |
--replace_result $TEST_SERVICES_HOST_APPLICATION_SIGNAL_PLUGIN TEST_SERVICES_HOST_APPLICATION_SIGNAL_PLUGIN |
| 2 |
eval INSTALL PLUGIN test_services_host_application_signal SONAME "$TEST_SERVICES_HOST_APPLICATION_SIGNAL_PLUGIN"; |
| 3 |
|
| 4 |
let $log_error_= `SELECT @@GLOBAL.log_error`; |
| 5 |
if($log_error_ == "stderr") |
| 6 |
{ |
| 7 |
let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.1.err; |
| 8 |
} |
| 9 |
let SEARCH_FILE=$log_error_; |
| 10 |
let BASEDIR= `select @@basedir`; |
| 11 |
let $MYSQLD_DATADIR= `SELECT @@datadir`; |
| 12 |
let $MYSQL_BASEDIR= `SELECT @@basedir`; |
| 13 |
let $MYSQL_SOCKET= `SELECT @@socket`; |
| 14 |
let $MYSQL_TIMEZONE= `SELECT @@time_zone`; |
| 15 |
let $MYSQL_PIDFILE= `SELECT @@pid_file`; |
| 16 |
let $MYSQL_PORT= `SELECT @@port`; |
| 17 |
let $MYSQL_MESSAGESDIR= `SELECT @@lc_messages_dir`; |
| 18 |
let extra_opts=--defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group-suffix=".1" --console; |
| 19 |
|
| 20 |
--echo # Test for bad service id |
| 21 |
SELECT test_shutdown_signal_udf(2); |
| 22 |
|
| 23 |
|
| 24 |
--echo # shutdown the server from mtr. |
| 25 |
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 26 |
--shutdown_server |
| 27 |
--source include/wait_until_disconnected.inc |
| 28 |
|
| 29 |
--echo # restart the server. |
| 30 |
--exec echo "restart:" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 31 |
--enable_reconnect |
| 32 |
--source include/wait_until_connected_again.inc |
| 33 |
|
| 34 |
--echo # start the sql client and test the shutdown UDF with 0 |
| 35 |
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 36 |
--exec $MYSQL -e "SELECT test_shutdown_signal_udf(0);" 2>&1 |
| 37 |
--source include/wait_until_disconnected.inc |
| 38 |
|
| 39 |
--echo # Search for the message in the log |
| 40 |
let SEARCH_PATTERN=Received SHUTDOWN from user .internal signal component service; |
| 41 |
--source include/search_pattern.inc |
| 42 |
|
| 43 |
--echo # restart the server |
| 44 |
--exec echo "restart:" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 45 |
--enable_reconnect |
| 46 |
--source include/wait_until_connected_again.inc |
| 47 |
|
| 48 |
--echo # start the sql client and test the shutdown UDF with 1 |
| 49 |
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 50 |
--exec $MYSQL -e "SELECT test_shutdown_signal_udf(1);" 2>&1 |
| 51 |
--source include/wait_until_disconnected.inc |
| 52 |
|
| 53 |
--echo # Search for the message in the log |
| 54 |
let SEARCH_PATTERN=Received SHUTDOWN from user .internal signal component service; |
| 55 |
--source include/search_pattern.inc |
| 56 |
|
| 57 |
--echo # restart server. |
| 58 |
--exec echo "restart:" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 59 |
--enable_reconnect |
| 60 |
--source include/wait_until_connected_again.inc |
| 61 |
|
| 62 |
--echo # Stop DB server which was created by MTR default |
| 63 |
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 64 |
--source include/shutdown_mysqld.inc |
| 65 |
|
| 66 |
--echo # Trying the shutdown at init option |
| 67 |
--exec $MYSQLD $extra_opts $TEST_SERVICES_HOST_APPLICATION_SIGNAL_PLUGIN_OPT --test_services_host_application_signal_shutdown_at_init=1 |
| 68 |
|
| 69 |
--echo # Search for the message in the log |
| 70 |
let SEARCH_PATTERN=Received SHUTDOWN from user .internal signal component service; |
| 71 |
--source include/search_pattern.inc |
| 72 |
|
| 73 |
--echo # restart server. |
| 74 |
--exec echo "restart:" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 75 |
--enable_reconnect |
| 76 |
--source include/wait_until_connected_again.inc |
| 77 |
|
| 78 |
UNINSTALL PLUGIN test_services_host_application_signal; |