57 lines
2.0 KiB
Plaintext

--source include/have_ndb.inc
--source include/have_debug.inc
# Embedded server does not support restarting
--source include/not_embedded.inc
let MYSQLD_DATADIR= `select @@datadir`;
# Setup path to server output log file
let $error_log= $MYSQLTEST_VARDIR/log/my_restart.err;
# Setup MYSQLD_CMD_11 with correct group suffix to first
# mysqld in the cluster
let $MYSQLD_CMD_11 = `select REPLACE("$MYSQLD_CMD",
"defaults-group-suffix=.1",
"defaults-group-suffix=.1.1")`;
let $args= --loose-console > $error_log 2>&1;
# Use innodb-read-only to avoid that innodb starts recovery
# threads etc. since that will only cause mystery crashes
# when the mysqld startup is aborted due to the invalid
# option tests performed below. Would have been nice to
# skip innodb for these test but that is not an option in 5.7
let $args = --innodb-read-only $args;
--echo # Stop the running server
let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.1.expect;
--exec echo "wait" > $restart_file
--shutdown_server
--source include/wait_until_disconnected.inc
--echo # Start server with provoked error in ndbcluster_init()
--echo # - the mysqld should write an error to the log and shutdown
--error 1
--exec $MYSQLD_CMD_11 --debug="+d,ndbcluster_init_fail1" $args;
--echo # Check the log file for expected error
let SEARCH_PATTERN= Failed to initialize ndbcluster;
let SEARCH_FILE= $error_log;
--source include/search_pattern_in_file.inc
--remove_file $SEARCH_FILE
--echo # Start server with another provoked error in ndbcluster_init()
--echo # - the mysqld should write an error to the log and shutdown
--error 1
--exec $MYSQLD_CMD_11 --debug="+d,ndbcluster_init_fail2" $args;
--echo # Check the log file for expected error
let SEARCH_PATTERN= Failed to initialize ndbcluster;
let SEARCH_FILE= $error_log;
--source include/search_pattern_in_file.inc
--remove_file $SEARCH_FILE
--echo # Cleanup
--enable_reconnect
--exec echo "restart" > $restart_file
--source include/wait_until_connected_again.inc