Commit bb2e125d authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.5 into 10.6

This excludes commit 040069f4
because it is specific to innodb_sync_debug, which had been removed
in commit ff5d306e.
parents e459ce83 0ad52e4d
...@@ -70,7 +70,6 @@ IndentPPDirectives: None ...@@ -70,7 +70,6 @@ IndentPPDirectives: None
IndentWidth: 2 IndentWidth: 2
IndentWrappedFunctionNames: false IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: true KeepEmptyLinesAtTheStartOfBlocks: true
Language: Cpp
MacroBlockBegin: '' MacroBlockBegin: ''
MacroBlockEnd: '' MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1 MaxEmptyLinesToKeep: 1
......
...@@ -397,7 +397,7 @@ enum enum_commands { ...@@ -397,7 +397,7 @@ enum enum_commands {
Q_IF, Q_IF,
Q_DISABLE_PARSING, Q_ENABLE_PARSING, Q_DISABLE_PARSING, Q_ENABLE_PARSING,
Q_REPLACE_REGEX, Q_REMOVE_FILE, Q_FILE_EXIST, Q_REPLACE_REGEX, Q_REMOVE_FILE, Q_FILE_EXIST,
Q_WRITE_FILE, Q_COPY_FILE, Q_PERL, Q_DIE, Q_EXIT, Q_SKIP, Q_WRITE_FILE, Q_WRITE_LINE, Q_COPY_FILE, Q_PERL, Q_DIE, Q_EXIT, Q_SKIP,
Q_CHMOD_FILE, Q_APPEND_FILE, Q_CAT_FILE, Q_DIFF_FILES, Q_CHMOD_FILE, Q_APPEND_FILE, Q_CAT_FILE, Q_DIFF_FILES,
Q_SEND_QUIT, Q_CHANGE_USER, Q_MKDIR, Q_RMDIR, Q_SEND_QUIT, Q_CHANGE_USER, Q_MKDIR, Q_RMDIR,
Q_LIST_FILES, Q_LIST_FILES_WRITE_FILE, Q_LIST_FILES_APPEND_FILE, Q_LIST_FILES, Q_LIST_FILES_WRITE_FILE, Q_LIST_FILES_APPEND_FILE,
...@@ -500,6 +500,7 @@ const char *command_names[]= ...@@ -500,6 +500,7 @@ const char *command_names[]=
"remove_file", "remove_file",
"file_exists", "file_exists",
"write_file", "write_file",
"write_line",
"copy_file", "copy_file",
"perl", "perl",
"die", "die",
...@@ -4318,6 +4319,49 @@ void do_write_file(struct st_command *command) ...@@ -4318,6 +4319,49 @@ void do_write_file(struct st_command *command)
do_write_file_command(command, FALSE); do_write_file_command(command, FALSE);
} }
/**
Write a line to the start of the file.
Truncates existing file, creates new one if it doesn't exist.
Usage
write_line <line> <filename>;
Example
--write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
@note Both the file and the line parameters are evaluated
(can be variables).
@note This is a better alternative to
exec echo > file, as it doesn't depend on shell,
and can better handle sporadic file access errors caused
by antivirus or backup software on Windows.
*/
void do_write_line(struct st_command *command)
{
DYNAMIC_STRING ds_line;
DYNAMIC_STRING ds_filename;
struct command_arg write_line_args[] = {
{ "line", ARG_STRING, FALSE, &ds_line, "line to add" },
{ "filename", ARG_STRING, TRUE, &ds_filename, "File to write to" },
};
DBUG_ENTER("do_write_line");
check_command_args(command,
command->first_argument,
write_line_args,
sizeof(write_line_args)/sizeof(struct command_arg),
' ');
if (bad_path(ds_filename.str))
DBUG_VOID_RETURN;
dynstr_append_mem(&ds_line, "\n", 1);
str_to_file2(ds_filename.str, ds_line.str, ds_line.length, FALSE);
dynstr_free(&ds_filename);
dynstr_free(&ds_line);
DBUG_VOID_RETURN;
}
/* /*
SYNOPSIS SYNOPSIS
...@@ -7435,7 +7479,7 @@ void str_to_file2(const char *fname, char *str, size_t size, my_bool append) ...@@ -7435,7 +7479,7 @@ void str_to_file2(const char *fname, char *str, size_t size, my_bool append)
die("Could not open '%s' for writing, errno: %d", buff, errno); die("Could not open '%s' for writing, errno: %d", buff, errno);
if (append && my_seek(fd, 0, SEEK_END, MYF(0)) == MY_FILEPOS_ERROR) if (append && my_seek(fd, 0, SEEK_END, MYF(0)) == MY_FILEPOS_ERROR)
die("Could not find end of file '%s', errno: %d", buff, errno); die("Could not find end of file '%s', errno: %d", buff, errno);
if (my_write(fd, (uchar*)str, size, MYF(MY_WME|MY_FNABP))) if (size > 0 && my_write(fd, (uchar*)str, size, MYF(MY_WME|MY_FNABP)))
die("write failed, errno: %d", errno); die("write failed, errno: %d", errno);
my_close(fd, MYF(0)); my_close(fd, MYF(0));
} }
...@@ -10235,6 +10279,7 @@ int main(int argc, char **argv) ...@@ -10235,6 +10279,7 @@ int main(int argc, char **argv)
break; break;
case Q_FILE_EXIST: do_file_exist(command); break; case Q_FILE_EXIST: do_file_exist(command); break;
case Q_WRITE_FILE: do_write_file(command); break; case Q_WRITE_FILE: do_write_file(command); break;
case Q_WRITE_LINE: do_write_line(command); break;
case Q_APPEND_FILE: do_append_file(command); break; case Q_APPEND_FILE: do_append_file(command); break;
case Q_DIFF_FILES: do_diff_files(command); break; case Q_DIFF_FILES: do_diff_files(command); break;
case Q_SEND_QUIT: do_send_quit(command); break; case Q_SEND_QUIT: do_send_quit(command); break;
......
...@@ -379,5 +379,11 @@ FUNCTION (MAYBE_DISABLE_IPO target) ...@@ -379,5 +379,11 @@ FUNCTION (MAYBE_DISABLE_IPO target)
INTERPROCEDURAL_OPTIMIZATION_RELEASE OFF INTERPROCEDURAL_OPTIMIZATION_RELEASE OFF
INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO OFF INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO OFF
INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL OFF) INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL OFF)
IF(CMAKE_CONFIGURATION_TYPES)
FOREACH(cfg ${CMAKE_CONFIGURATION_TYPES})
STRING(TOUPPER "${cfg}" cfg_upper)
SET_TARGET_PROPERTIES(${target} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_${cfg_upper} OFF)
ENDFOREACH()
ENDIF()
ENDIF() ENDIF()
ENDFUNCTION() ENDFUNCTION()
...@@ -40,6 +40,13 @@ SET(CLIENT_PLUGIN_PVIO_SOCKET STATIC) ...@@ -40,6 +40,13 @@ SET(CLIENT_PLUGIN_PVIO_SOCKET STATIC)
MESSAGE("== Configuring MariaDB Connector/C") MESSAGE("== Configuring MariaDB Connector/C")
ADD_SUBDIRECTORY(libmariadb) ADD_SUBDIRECTORY(libmariadb)
IF(MSVC AND TARGET mariadb_obj AND TARGET mariadbclient)
# With MSVC, do not produce LTCG-compiled static client libraries.
# They are not usable by end-users, being tied to exact compiler version
MAYBE_DISABLE_IPO(mariadb_obj)
MAYBE_DISABLE_IPO(mariadbclient)
ENDIF()
IF(UNIX) IF(UNIX)
INSTALL(CODE "EXECUTE_PROCESS( INSTALL(CODE "EXECUTE_PROCESS(
COMMAND ${CMAKE_COMMAND} -E make_directory \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${INSTALL_BINDIR}) COMMAND ${CMAKE_COMMAND} -E make_directory \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${INSTALL_BINDIR})
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
--source include/not_embedded.inc --source include/not_embedded.inc
# Write file to make mysql-test-run.pl expect crash and restart # Write file to make mysql-test-run.pl expect crash and restart
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
# Setup the mysqld to crash at shutdown # Setup the mysqld to crash at shutdown
SET debug_dbug="d,crash_shutdown"; SET debug_dbug="d,crash_shutdown";
......
...@@ -2,4 +2,4 @@ ...@@ -2,4 +2,4 @@
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
# There should be a debug crash after using this .inc file # There should be a debug crash after using this .inc file
--exec echo "wait" > $_expect_file_name --write_line wait $_expect_file_name
...@@ -7,7 +7,7 @@ if (!$restart_parameters) ...@@ -7,7 +7,7 @@ if (!$restart_parameters)
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect --let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
--echo # Kill and $restart_parameters --echo # Kill and $restart_parameters
--exec echo "$restart_parameters" > $_expect_file_name --write_line "$restart_parameters" $_expect_file_name
--shutdown_server 0 --shutdown_server 0
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc
--enable_reconnect --enable_reconnect
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# Write file to make mysql-test-run.pl expect the crash, but don't start it # Write file to make mysql-test-run.pl expect the crash, but don't start it
--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` --let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
--exec echo "wait" > $_expect_file_name --write_line wait $_expect_file_name
# Kill the connected server # Kill the connected server
--disable_reconnect --disable_reconnect
......
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
--echo # Kill the server --echo # Kill the server
--exec echo "wait" > $_expect_file_name --write_line wait $_expect_file_name
--shutdown_server 0 --shutdown_server 0
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc
...@@ -49,7 +49,7 @@ if ($rpl_server_parameters) ...@@ -49,7 +49,7 @@ if ($rpl_server_parameters)
--source include/rpl_connection.inc --source include/rpl_connection.inc
# Write file to make mysql-test-run.pl start up the server again # Write file to make mysql-test-run.pl start up the server again
--exec echo "$_rpl_start_server_command" > $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect --write_line "$_rpl_start_server_command" $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect
if (!$rpl_server_error) if (!$rpl_server_error)
{ {
......
...@@ -44,7 +44,7 @@ if ($rpl_debug) ...@@ -44,7 +44,7 @@ if ($rpl_debug)
# Write file to make mysql-test-run.pl expect the "crash", but don't start # Write file to make mysql-test-run.pl expect the "crash", but don't start
# it until it's told to # it until it's told to
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect
# Send shutdown to the connected server and give # Send shutdown to the connected server and give
# it 60 seconds (of mysqltest's default) to die before zapping it # it 60 seconds (of mysqltest's default) to die before zapping it
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
# let SEARCH_FILE= $error_log; # let SEARCH_FILE= $error_log;
# # Stop the server # # Stop the server
# let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect; # let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
# --exec echo "wait" > $restart_file # --write_line wait $restart_file
# --shutdown_server # --shutdown_server
# --source include/wait_until_disconnected.inc # --source include/wait_until_disconnected.inc
# #
......
...@@ -24,7 +24,7 @@ if ($rpl_inited) ...@@ -24,7 +24,7 @@ if ($rpl_inited)
# Write file to make mysql-test-run.pl expect the "crash", but don't start it # Write file to make mysql-test-run.pl expect the "crash", but don't start it
--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` --let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
--exec echo "wait" > $_expect_file_name --write_line wait $_expect_file_name
# Avoid warnings from connection threads that does not have time to exit # Avoid warnings from connection threads that does not have time to exit
--disable_query_log --disable_query_log
......
...@@ -21,7 +21,7 @@ if ($restart_bindir) ...@@ -21,7 +21,7 @@ if ($restart_bindir)
if ($restart_parameters) if ($restart_parameters)
{ {
--exec echo "$restart_cmd: $restart_parameters" > $_expect_file_name --write_line "$restart_cmd: $restart_parameters" $_expect_file_name
if (!$restart_noprint) if (!$restart_noprint)
{ {
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
...@@ -34,7 +34,7 @@ if ($restart_parameters) ...@@ -34,7 +34,7 @@ if ($restart_parameters)
} }
if (!$restart_parameters) if (!$restart_parameters)
{ {
--exec echo "$restart_cmd" > $_expect_file_name --write_line "$restart_cmd" $_expect_file_name
if ($restart_noprint < 2) if ($restart_noprint < 2)
{ {
--exec echo "# $restart_cmd" --exec echo "# $restart_cmd"
......
...@@ -17,7 +17,7 @@ insert into t1 values(9); ...@@ -17,7 +17,7 @@ insert into t1 values(9);
SET GLOBAL debug_dbug="d,crash_commit_before"; SET GLOBAL debug_dbug="d,crash_commit_before";
# Write file to make mysql-test-run.pl expect crash and restart # Write file to make mysql-test-run.pl expect crash and restart
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
# Run the crashing query # Run the crashing query
--error 2013 --error 2013
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
# #
--source include/not_embedded.inc --source include/not_embedded.inc
create server '' foreign data wrapper w2 options (host '127.0.0.1'); create server '' foreign data wrapper w2 options (host '127.0.0.1');
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server --shutdown_server
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-- enable_reconnect -- enable_reconnect
-- source include/wait_until_connected_again.inc -- source include/wait_until_connected_again.inc
......
...@@ -43,10 +43,10 @@ select @@global.Host_Cache_Size > 0; ...@@ -43,10 +43,10 @@ select @@global.Host_Cache_Size > 0;
--echo # Restart server with Host_Cache_Size 1 --echo # Restart server with Host_Cache_Size 1
let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect; let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
--exec echo "wait" > $restart_file --write_line wait $restart_file
--shutdown_server --shutdown_server
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc
-- exec echo "restart:--host_cache_size=1 " > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line "restart:--host_cache_size=1 " $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-- enable_reconnect -- enable_reconnect
-- source include/wait_until_connected_again.inc -- source include/wait_until_connected_again.inc
...@@ -142,10 +142,10 @@ SELECT Host_Cache_Size = @@SESSION.Host_Cache_Size; ...@@ -142,10 +142,10 @@ SELECT Host_Cache_Size = @@SESSION.Host_Cache_Size;
#--remove_file $MYSQL_TMP_DIR/bind_ip #--remove_file $MYSQL_TMP_DIR/bind_ip
#let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect; #let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
#--exec echo "wait" > $restart_file #--write_line wait $restart_file
#--shutdown_server #--shutdown_server
#--source include/wait_until_disconnected.inc #--source include/wait_until_disconnected.inc
#-- exec echo "restart:--bind-address=$bind_ip " > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect #-- write_line "restart:--bind-address=$bind_ip " $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
#-- enable_reconnect #-- enable_reconnect
#-- source include/wait_until_connected_again.inc #-- source include/wait_until_connected_again.inc
......
...@@ -15,12 +15,12 @@ EOF ...@@ -15,12 +15,12 @@ EOF
--enable_reconnect --enable_reconnect
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server --shutdown_server
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc
--exec echo "restart:--init-file=$MYSQLTEST_VARDIR/init.file " > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line "restart:--init-file=$MYSQLTEST_VARDIR/init.file " $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc
select user,host,password,plugin,authentication_string from mysql.user where user='foo'; select user,host,password,plugin,authentication_string from mysql.user where user='foo';
......
...@@ -30,12 +30,12 @@ ...@@ -30,12 +30,12 @@
--echo # Case 2: Starting server with fifo file as general log file --echo # Case 2: Starting server with fifo file as general log file
--echo # and slow query log file. --echo # and slow query log file.
# Restart server with fifo file as general log file. # Restart server with fifo file as general log file.
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server --shutdown_server
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc
--enable_reconnect --enable_reconnect
# Write file to make mysql-test-run.pl start up the server again # Write file to make mysql-test-run.pl start up the server again
--exec echo "restart: --general-log-file=$gen_log_file --slow-query-log-file=$slow_query_log_file" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line "restart: --general-log-file=$gen_log_file --slow-query-log-file=$slow_query_log_file" $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc
# Error 6 is reported, because the other end is closed # Error 6 is reported, because the other end is closed
......
...@@ -16,7 +16,7 @@ let SEARCH_FILE= $MYSQLTEST_VARDIR/log/my_restart.err; ...@@ -16,7 +16,7 @@ let SEARCH_FILE= $MYSQLTEST_VARDIR/log/my_restart.err;
--remove_file $SEARCH_FILE --remove_file $SEARCH_FILE
#Shutdown the server #Shutdown the server
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server --shutdown_server
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc
...@@ -30,7 +30,7 @@ let SEARCH_PATTERN= \[ERROR\] The server option \'lower_case_table_names\' is co ...@@ -30,7 +30,7 @@ let SEARCH_PATTERN= \[ERROR\] The server option \'lower_case_table_names\' is co
--source include/search_pattern_in_file.inc --source include/search_pattern_in_file.inc
#Restart the server #Restart the server
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc
#Cleanup #Cleanup
......
...@@ -26,14 +26,14 @@ INSERT INTO t1 VALUES (1,2),(2,3),(3,4),(4,5),(5,6); ...@@ -26,14 +26,14 @@ INSERT INTO t1 VALUES (1,2),(2,3),(3,4),(4,5),(5,6);
SET SESSION debug_dbug="d,crash_before_flush_keys"; SET SESSION debug_dbug="d,crash_before_flush_keys";
--echo # Write file to make mysql-test-run.pl expect crash --echo # Write file to make mysql-test-run.pl expect crash
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--echo # Run the crashing query --echo # Run the crashing query
--error 2013 --error 2013
FLUSH TABLE t1; FLUSH TABLE t1;
--echo # Write file to make mysql-test-run.pl start the server --echo # Write file to make mysql-test-run.pl start the server
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--echo # Turn on reconnect --echo # Turn on reconnect
--enable_reconnect --enable_reconnect
......
...@@ -23,7 +23,7 @@ call mtr.add_suppression(" IP address .* could not be resolved"); ...@@ -23,7 +23,7 @@ call mtr.add_suppression(" IP address .* could not be resolved");
# server or run mysql-test-run --debug mysql_client_test and check # server or run mysql-test-run --debug mysql_client_test and check
# var/log/mysql_client_test.trace # var/log/mysql_client_test.trace
--exec echo "$MYSQL_CLIENT_TEST" > $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1 --write_line "$MYSQL_CLIENT_TEST" $MYSQLTEST_VARDIR/log/mysql_client_test.out.log
--exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M >> $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1 --exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M >> $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1
# End of 4.1 tests # End of 4.1 tests
......
...@@ -12,7 +12,7 @@ SET @old_slow_query_log= @@global.slow_query_log; ...@@ -12,7 +12,7 @@ SET @old_slow_query_log= @@global.slow_query_log;
call mtr.add_suppression(" Error reading file './client_test_db/test_frm_bug.frm'"); call mtr.add_suppression(" Error reading file './client_test_db/test_frm_bug.frm'");
call mtr.add_suppression(" IP address .* could not be resolved"); call mtr.add_suppression(" IP address .* could not be resolved");
--exec echo "$MYSQL_CLIENT_TEST" > $MYSQLTEST_VARDIR/log/mysql_client_test_comp.out.log 2>&1 --write_line "$MYSQL_CLIENT_TEST" $MYSQLTEST_VARDIR/log/mysql_client_test_comp.out.log
--exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M >> $MYSQLTEST_VARDIR/log/mysql_client_test_comp.out.log 2>&1 --exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M >> $MYSQLTEST_VARDIR/log/mysql_client_test_comp.out.log 2>&1
# End of test # End of test
......
...@@ -19,7 +19,7 @@ call mtr.add_suppression(" IP address .* could not be resolved"); ...@@ -19,7 +19,7 @@ call mtr.add_suppression(" IP address .* could not be resolved");
# server or run mysql-test-run --debug mysql_client_test and check # server or run mysql-test-run --debug mysql_client_test and check
# var/log/mysql_client_test.trace # var/log/mysql_client_test.trace
--exec echo "$MYSQL_CLIENT_TEST --non-blocking-api" > $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1 --write_line "$MYSQL_CLIENT_TEST --non-blocking-api" $MYSQLTEST_VARDIR/log/mysql_client_test.out.log
--exec $MYSQL_CLIENT_TEST --non-blocking-api --getopt-ll-test=25600M >> $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1 --exec $MYSQL_CLIENT_TEST --non-blocking-api --getopt-ll-test=25600M >> $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1
# End of 4.1 tests # End of 4.1 tests
......
...@@ -68,7 +68,7 @@ drop table t1; ...@@ -68,7 +68,7 @@ drop table t1;
# Test that we can't open connection to server if we are using # Test that we can't open connection to server if we are using
# a different cacert # a different cacert
# #
--exec echo "this query should not execute;" > $MYSQLTEST_VARDIR/tmp/test.sql --write_line "this query should not execute;" $MYSQLTEST_VARDIR/tmp/test.sql
# Handle that openssl gives different error messages from YaSSL. # Handle that openssl gives different error messages from YaSSL.
--replace_regex /2026 TLS\/SSL error.*/2026 TLS\/SSL error: xxxx/ --replace_regex /2026 TLS\/SSL error.*/2026 TLS\/SSL error: xxxx/
--error 1 --error 1
......
...@@ -13,14 +13,14 @@ FROM INFORMATION_SCHEMA.PLUGINS WHERE plugin_name = 'innodb'; ...@@ -13,14 +13,14 @@ FROM INFORMATION_SCHEMA.PLUGINS WHERE plugin_name = 'innodb';
--echo # --echo #
--echo # MDEV-6351 --plugin=force has no effect for built-in plugins --echo # MDEV-6351 --plugin=force has no effect for built-in plugins
--echo # --echo #
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server --shutdown_server
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc
--error 1 --error 1
--exec $MYSQLD_CMD --innodb=force --innodb-page-size=6000 --disable-log-error --exec $MYSQLD_CMD --innodb=force --innodb-page-size=6000 --disable-log-error
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect --enable_reconnect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc
--disable_reconnect --disable_reconnect
...@@ -20,13 +20,13 @@ drop procedure try_shutdown; ...@@ -20,13 +20,13 @@ drop procedure try_shutdown;
--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` --let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
--exec echo "wait" > $_expect_file_name --write_line wait $_expect_file_name
--send shutdown --send shutdown
--connection default --connection default
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc
--exec echo "restart" > $_expect_file_name --write_line restart $_expect_file_name
--enable_reconnect --enable_reconnect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc
......
...@@ -98,7 +98,7 @@ reset master; ...@@ -98,7 +98,7 @@ reset master;
--echo # crash_purge_before_update_index --echo # crash_purge_before_update_index
flush logs; flush logs;
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
SET SESSION debug_dbug="+d,crash_purge_before_update_index"; SET SESSION debug_dbug="+d,crash_purge_before_update_index";
--source include/wait_for_binlog_checkpoint.inc --source include/wait_for_binlog_checkpoint.inc
--error 2013 --error 2013
...@@ -119,7 +119,7 @@ SELECT @index; ...@@ -119,7 +119,7 @@ SELECT @index;
--echo # crash_purge_non_critical_after_update_index --echo # crash_purge_non_critical_after_update_index
flush logs; flush logs;
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
SET SESSION debug_dbug="+d,crash_purge_non_critical_after_update_index"; SET SESSION debug_dbug="+d,crash_purge_non_critical_after_update_index";
--source include/wait_for_binlog_checkpoint.inc --source include/wait_for_binlog_checkpoint.inc
--error 2013 --error 2013
...@@ -143,7 +143,7 @@ SELECT @index; ...@@ -143,7 +143,7 @@ SELECT @index;
--echo # crash_purge_critical_after_update_index --echo # crash_purge_critical_after_update_index
flush logs; flush logs;
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
SET SESSION debug_dbug="+d,crash_purge_critical_after_update_index"; SET SESSION debug_dbug="+d,crash_purge_critical_after_update_index";
--source include/wait_for_binlog_checkpoint.inc --source include/wait_for_binlog_checkpoint.inc
--error 2013 --error 2013
...@@ -167,7 +167,7 @@ file_exists $MYSQLD_DATADIR/master-bin.000008; ...@@ -167,7 +167,7 @@ file_exists $MYSQLD_DATADIR/master-bin.000008;
SELECT @index; SELECT @index;
--echo # crash_create_non_critical_before_update_index --echo # crash_create_non_critical_before_update_index
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
SET SESSION debug_dbug="+d,crash_create_non_critical_before_update_index"; SET SESSION debug_dbug="+d,crash_create_non_critical_before_update_index";
--error 2013 --error 2013
flush logs; flush logs;
...@@ -185,7 +185,7 @@ file_exists $MYSQLD_DATADIR/master-bin.000009; ...@@ -185,7 +185,7 @@ file_exists $MYSQLD_DATADIR/master-bin.000009;
SELECT @index; SELECT @index;
--echo # crash_create_critical_before_update_index --echo # crash_create_critical_before_update_index
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
SET SESSION debug_dbug="+d,crash_create_critical_before_update_index"; SET SESSION debug_dbug="+d,crash_create_critical_before_update_index";
--error 2013 --error 2013
flush logs; flush logs;
...@@ -205,7 +205,7 @@ file_exists $MYSQLD_DATADIR/master-bin.000011; ...@@ -205,7 +205,7 @@ file_exists $MYSQLD_DATADIR/master-bin.000011;
SELECT @index; SELECT @index;
--echo # crash_create_after_update_index --echo # crash_create_after_update_index
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
SET SESSION debug_dbug="+d,crash_create_after_update_index"; SET SESSION debug_dbug="+d,crash_create_after_update_index";
--error 2013 --error 2013
flush logs; flush logs;
......
...@@ -26,10 +26,10 @@ ...@@ -26,10 +26,10 @@
ALTER TABLE mysql.gtid_slave_pos ENGINE=innodb; ALTER TABLE mysql.gtid_slave_pos ENGINE=innodb;
--echo # Restart the server so mysqld reads the gtid_slave_pos using innodb --echo # Restart the server so mysqld reads the gtid_slave_pos using innodb
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server --shutdown_server
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect --enable_reconnect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc
......
...@@ -68,10 +68,10 @@ while ($loop_times) { ...@@ -68,10 +68,10 @@ while ($loop_times) {
# try to change the log-bin configs and restart # try to change the log-bin configs and restart
--echo # ======= now try to change the log-bin config for mysqld ======= --echo # ======= now try to change the log-bin config for mysqld =======
--let $restart_parameters="--log-bin=new_log_bin" --let $restart_parameters=--log-bin=new_log_bin
--echo #begin to restart mysqld --echo #begin to restart mysqld
--source include/restart_mysqld.inc --source include/restart_mysqld.inc
--let $restart_parameters= "" --let $restart_parameters=
--source include/show_binary_logs.inc --source include/show_binary_logs.inc
let $loop_times= 10; let $loop_times= 10;
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
--connection $_cur_con --connection $_cur_con
--enable_reconnect --enable_reconnect
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect
shutdown_server; shutdown_server;
...@@ -31,5 +31,5 @@ if ($rpl_server_parameters) ...@@ -31,5 +31,5 @@ if ($rpl_server_parameters)
{ {
--let $_rpl_start_server_command= restart:$rpl_server_parameters --let $_rpl_start_server_command= restart:$rpl_server_parameters
} }
--exec echo "$_rpl_start_server_command" > $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect --write_line "$_rpl_start_server_command" $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc
...@@ -16,7 +16,7 @@ call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* becau ...@@ -16,7 +16,7 @@ call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* becau
--let $MYSQLD_DATADIR = `SELECT @@datadir` --let $MYSQLD_DATADIR = `SELECT @@datadir`
--let SEARCH_RANGE = 10000000 --let SEARCH_RANGE = 10000000
--let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd --let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server --shutdown_server
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc
...@@ -25,7 +25,7 @@ call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* becau ...@@ -25,7 +25,7 @@ call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* becau
4;770A8A65DA156D24EE2A093277530143 4;770A8A65DA156D24EE2A093277530143
EOF EOF
--exec echo "restart:--innodb-encrypt-tables --innodb-stats-persistent --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line "restart:--innodb-encrypt-tables --innodb-stats-persistent --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect --enable_reconnect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc
...@@ -47,7 +47,7 @@ UNLOCK TABLES; ...@@ -47,7 +47,7 @@ UNLOCK TABLES;
ALTER TABLE t1 DISCARD TABLESPACE; ALTER TABLE t1 DISCARD TABLESPACE;
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server --shutdown_server
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc
...@@ -62,7 +62,7 @@ ib_discard_tablespaces("test", "t1"); ...@@ -62,7 +62,7 @@ ib_discard_tablespaces("test", "t1");
ib_restore_tablespaces("test", "t1"); ib_restore_tablespaces("test", "t1");
EOF EOF
--exec echo "restart:--innodb-encrypt-tables --innodb-stats-persistent --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys2.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line "restart:--innodb-encrypt-tables --innodb-stats-persistent --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys2.txt" $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect --enable_reconnect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc
--source include/restart_mysqld.inc --source include/restart_mysqld.inc
...@@ -80,7 +80,7 @@ SELECT * FROM t1; ...@@ -80,7 +80,7 @@ SELECT * FROM t1;
-- let SEARCH_FILE=$t1_IBD -- let SEARCH_FILE=$t1_IBD
-- source include/search_pattern_in_file.inc -- source include/search_pattern_in_file.inc
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server --shutdown_server
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc
--remove_file $MYSQLTEST_VARDIR/keys1.txt --remove_file $MYSQLTEST_VARDIR/keys1.txt
...@@ -89,7 +89,7 @@ SELECT * FROM t1; ...@@ -89,7 +89,7 @@ SELECT * FROM t1;
4;770A8A65DA156D24EE2A093277530143 4;770A8A65DA156D24EE2A093277530143
EOF EOF
--exec echo "restart:--innodb-encrypt-tables --innodb-stats-persistent --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line "restart:--innodb-encrypt-tables --innodb-stats-persistent --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect --enable_reconnect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc
DROP TABLE t1; DROP TABLE t1;
......
...@@ -21,7 +21,7 @@ CREATE TABLE t1(f1 BIGINT PRIMARY KEY, f2 int not null, ...@@ -21,7 +21,7 @@ CREATE TABLE t1(f1 BIGINT PRIMARY KEY, f2 int not null,
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
CREATE TABLE t2 (f1 int not null)engine=innodb; CREATE TABLE t2 (f1 int not null)engine=innodb;
let $restart_parameters="--debug=d,ib_log_checkpoint_avoid"; let $restart_parameters=--debug=d,ib_log_checkpoint_avoid;
--source include/restart_mysqld.inc --source include/restart_mysqld.inc
# Stop the purge # Stop the purge
......
...@@ -8,7 +8,7 @@ if (!$kill_signal) ...@@ -8,7 +8,7 @@ if (!$kill_signal)
# Write file to make mysql-test-run.pl expect the crash, but don't start it # Write file to make mysql-test-run.pl expect the crash, but don't start it
--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` --let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
--exec echo "wait" > $_expect_file_name --write_line wait $_expect_file_name
# Kill the connected server # Kill the connected server
--disable_reconnect --disable_reconnect
......
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
if ($galera_wsrep_start_position != '') { if ($galera_wsrep_start_position != '') {
--echo Using --wsrep-start-position when starting mysqld ... --echo Using --wsrep-start-position when starting mysqld ...
--exec echo "restart:$start_mysqld_params --wsrep-start-position=$galera_wsrep_start_position" > $_expect_file_name --write_line "restart:$start_mysqld_params --wsrep-start-position=$galera_wsrep_start_position" $_expect_file_name
--let $galera_wsrep_start_position = 0 --let $galera_wsrep_start_position = 0
} }
if ($galera_wsrep_start_position == '') { if ($galera_wsrep_start_position == '') {
--exec echo "restart:$start_mysqld_params" > $_expect_file_name --write_line "restart:$start_mysqld_params" $_expect_file_name
} }
--source include/galera_wait_ready.inc --source include/galera_wait_ready.inc
...@@ -37,7 +37,7 @@ UPDATE t1 SET f2 = 'c' WHERE f1 > 2; ...@@ -37,7 +37,7 @@ UPDATE t1 SET f2 = 'c' WHERE f1 > 2;
# Write file to make mysql-test-run.pl expect the crash, but don't start it # Write file to make mysql-test-run.pl expect the crash, but don't start it
--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` --let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
--exec echo "wait" > $_expect_file_name --write_line wait $_expect_file_name
--let KILL_NODE_PIDFILE = `SELECT @@pid_file` --let KILL_NODE_PIDFILE = `SELECT @@pid_file`
......
...@@ -27,8 +27,8 @@ INSERT INTO t1 VALUES (1); ...@@ -27,8 +27,8 @@ INSERT INTO t1 VALUES (1);
SELECT COUNT(*) = 1 FROM t1; SELECT COUNT(*) = 1 FROM t1;
--let $NODE_2_PIDFILE = `SELECT @@pid_file` --let $NODE_2_PIDFILE = `SELECT @@pid_file`
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
--exec kill -9 `cat $NODE_1_PIDFILE` `cat $NODE_2_PIDFILE` --exec kill -9 `cat $NODE_1_PIDFILE` `cat $NODE_2_PIDFILE`
# Perform --wsrep-recover and preserve the positions into variables by placing them in $MYSQL_TMP_DIR/galera_wsrep_start_position.inc and then --source'ing it # Perform --wsrep-recover and preserve the positions into variables by placing them in $MYSQL_TMP_DIR/galera_wsrep_start_position.inc and then --source'ing it
...@@ -66,8 +66,8 @@ if ($galera_wsrep_start_position2 == '') { ...@@ -66,8 +66,8 @@ if ($galera_wsrep_start_position2 == '') {
# Instruct MTR to perform the actual restart using --wsrep-start-position . Proper --wsrep_cluster_address is used as my.cnf only contains 'gcomm://' for node #1 # Instruct MTR to perform the actual restart using --wsrep-start-position . Proper --wsrep_cluster_address is used as my.cnf only contains 'gcomm://' for node #1
--exec echo "restart: --wsrep-start-position=$galera_wsrep_start_position1 --wsrep_cluster_address=gcomm://127.0.0.1:$NODE_GALERAPORT_1,127.0.0.1:$NODE_GALERAPORT_2" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line "restart: --wsrep-start-position=$galera_wsrep_start_position1 --wsrep_cluster_address=gcomm://127.0.0.1:$NODE_GALERAPORT_1,127.0.0.1:$NODE_GALERAPORT_2" $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--exec echo "restart: --wsrep-start-position=$galera_wsrep_start_position2 --wsrep_cluster_address=gcomm://127.0.0.1:$NODE_GALERAPORT_1,127.0.0.1:$NODE_GALERAPORT_2" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect --write_line "restart: --wsrep-start-position=$galera_wsrep_start_position2 --wsrep_cluster_address=gcomm://127.0.0.1:$NODE_GALERAPORT_1,127.0.0.1:$NODE_GALERAPORT_2" $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
--sleep 5 --sleep 5
--connection node_1 --connection node_1
......
...@@ -62,7 +62,7 @@ SELECT * FROM t1; ...@@ -62,7 +62,7 @@ SELECT * FROM t1;
--let $start_mysqld_params=--galera-unknown-option --let $start_mysqld_params=--galera-unknown-option
--echo Starting server ... --echo Starting server ...
--exec echo "try:$start_mysqld_params" > $_expect_file_name --write_line "try:$start_mysqld_params" $_expect_file_name
# Sleep to ensure that server exited... # Sleep to ensure that server exited...
...@@ -107,7 +107,7 @@ SELECT * FROM t1; ...@@ -107,7 +107,7 @@ SELECT * FROM t1;
--let $start_mysqld_params=--galera-unknown-option --let $start_mysqld_params=--galera-unknown-option
--echo Starting server ... --echo Starting server ...
--exec echo "try:$start_mysqld_params" > $_expect_file_name --write_line "try:$start_mysqld_params" $_expect_file_name
# Sleep to ensure that server exited... # Sleep to ensure that server exited...
......
...@@ -36,7 +36,7 @@ SET DEBUG_SYNC = "now WAIT_FOR sync_point_reached"; ...@@ -36,7 +36,7 @@ SET DEBUG_SYNC = "now WAIT_FOR sync_point_reached";
# Restart without waiting. The UPDATE should block FTWRL on node_1, # Restart without waiting. The UPDATE should block FTWRL on node_1,
# so the SST cannot be completed and node_2 cannot join before # so the SST cannot be completed and node_2 cannot join before
# UPDATE connection is signalled to continue. # UPDATE connection is signalled to continue.
--exec echo "restart:$start_mysqld_params" > $_expect_file_name --write_line "restart:$start_mysqld_params" $_expect_file_name
# If the bug is present, FTWRL times out on node_1 in couple of # If the bug is present, FTWRL times out on node_1 in couple of
# seconds and node_2 fails to join. # seconds and node_2 fails to join.
--sleep 10 --sleep 10
......
...@@ -17,7 +17,7 @@ SET GLOBAL debug_dbug="d,crash_last_fragment_commit_after_fragment_removal"; ...@@ -17,7 +17,7 @@ SET GLOBAL debug_dbug="d,crash_last_fragment_commit_after_fragment_removal";
--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` --let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
--exec echo "wait" > $_expect_file_name --write_line wait $_expect_file_name
CREATE TABLE t1 (f1 VARCHAR(30)) ENGINE=InnoDB; CREATE TABLE t1 (f1 VARCHAR(30)) ENGINE=InnoDB;
......
...@@ -70,7 +70,7 @@ let $orig_table_id = `SELECT table_id ...@@ -70,7 +70,7 @@ let $orig_table_id = `SELECT table_id
WHERE name = 'test/t1'`; WHERE name = 'test/t1'`;
# Write file to make mysql-test-run.pl expect crash # Write file to make mysql-test-run.pl expect crash
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--error 2013 --error 2013
ALTER TABLE t1 ADD PRIMARY KEY (f2, f1); ALTER TABLE t1 ADD PRIMARY KEY (f2, f1);
...@@ -110,7 +110,7 @@ let $orig_table_id = `SELECT table_id ...@@ -110,7 +110,7 @@ let $orig_table_id = `SELECT table_id
WHERE name = 'test/t2'`; WHERE name = 'test/t2'`;
# Write file to make mysql-test-run.pl expect crash # Write file to make mysql-test-run.pl expect crash
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--error 2013 --error 2013
ALTER TABLE t2 ADD PRIMARY KEY (f2, f1); ALTER TABLE t2 ADD PRIMARY KEY (f2, f1);
...@@ -150,7 +150,7 @@ let $orig_table_id = `select table_id from ...@@ -150,7 +150,7 @@ let $orig_table_id = `select table_id from
information_schema.innodb_sys_tables where name = 'test/t1'`; information_schema.innodb_sys_tables where name = 'test/t1'`;
# Write file to make mysql-test-run.pl expect crash # Write file to make mysql-test-run.pl expect crash
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
# #
--error 2013 --error 2013
ALTER TABLE t1 ADD INDEX (b), CHANGE c d int, ALGORITHM=INPLACE; ALTER TABLE t1 ADD INDEX (b), CHANGE c d int, ALGORITHM=INPLACE;
......
...@@ -18,7 +18,7 @@ INSERT INTO t1(b) VALUES('one'), ('two'), ('three'); ...@@ -18,7 +18,7 @@ INSERT INTO t1(b) VALUES('one'), ('two'), ('three');
--echo # --echo #
--echo # Create a file called MYSQLD_DATADIR/test/t1.ibd --echo # Create a file called MYSQLD_DATADIR/test/t1.ibd
--exec echo "This is not t1.ibd" > $MYSQLD_DATADIR/test/t1.ibd --write_line "This is not t1.ibd" $MYSQLD_DATADIR/test/t1.ibd
--echo # Directory listing of test/*.ibd --echo # Directory listing of test/*.ibd
--echo # --echo #
......
...@@ -45,7 +45,7 @@ commit work; ...@@ -45,7 +45,7 @@ commit work;
# Slow shutdown and restart to make sure ibuf merge is finished # Slow shutdown and restart to make sure ibuf merge is finished
SET GLOBAL innodb_fast_shutdown = 0; SET GLOBAL innodb_fast_shutdown = 0;
let $shutdown_timeout=; let $shutdown_timeout=;
let $restart_parameters="--debug_dbug=+d,ib_log_checkpoint_avoid_hard --innodb_flush_sync=0"; let $restart_parameters=--debug_dbug=+d,ib_log_checkpoint_avoid_hard --innodb_flush_sync=0;
--source include/restart_mysqld.inc --source include/restart_mysqld.inc
--source ../include/no_checkpoint_start.inc --source ../include/no_checkpoint_start.inc
begin; begin;
...@@ -95,7 +95,7 @@ select f1, f2 from t1; ...@@ -95,7 +95,7 @@ select f1, f2 from t1;
--echo # Test Begin: Test if recovery works if 1st page of --echo # Test Begin: Test if recovery works if 1st page of
--echo # system tablespace is corrupted and 2nd page as corrupted. --echo # system tablespace is corrupted and 2nd page as corrupted.
let $restart_parameters="--debug_dbug=+d,ib_log_checkpoint_avoid_hard --innodb_flush_sync=0"; let $restart_parameters=--debug_dbug=+d,ib_log_checkpoint_avoid_hard --innodb_flush_sync=0;
--source include/restart_mysqld.inc --source include/restart_mysqld.inc
--source ../include/no_checkpoint_start.inc --source ../include/no_checkpoint_start.inc
begin; begin;
......
...@@ -51,7 +51,7 @@ while ($numtests) ...@@ -51,7 +51,7 @@ while ($numtests)
START TRANSACTION; START TRANSACTION;
insert into t1 select * from t2; insert into t1 select * from t2;
# Write file to make mysql-test-run.pl expect crash # Write file to make mysql-test-run.pl expect crash
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
eval call setcrash($numtests); eval call setcrash($numtests);
......
...@@ -51,7 +51,7 @@ while ($numtests) ...@@ -51,7 +51,7 @@ while ($numtests)
START TRANSACTION; START TRANSACTION;
insert into t1 select * from t2; insert into t1 select * from t2;
# Write file to make mysql-test-run.pl expect crash # Write file to make mysql-test-run.pl expect crash
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
eval call setcrash($numtests); eval call setcrash($numtests);
......
...@@ -35,7 +35,7 @@ let datadir= `select @@datadir`; ...@@ -35,7 +35,7 @@ let datadir= `select @@datadir`;
CREATE TABLE t1 (f1 INT NOT NULL, f2 INT NOT NULL) ENGINE=innodb; CREATE TABLE t1 (f1 INT NOT NULL, f2 INT NOT NULL) ENGINE=innodb;
SET debug_dbug='+d,innodb_alter_commit_crash_before_commit'; SET debug_dbug='+d,innodb_alter_commit_crash_before_commit';
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--error 2013 --error 2013
ALTER TABLE t1 ADD PRIMARY KEY (f2, f1); ALTER TABLE t1 ADD PRIMARY KEY (f2, f1);
......
...@@ -23,14 +23,14 @@ alter table t1 add primary key (pk); ...@@ -23,14 +23,14 @@ alter table t1 add primary key (pk);
--echo # Stop the server, replace the frm with the old one and restart the server --echo # Stop the server, replace the frm with the old one and restart the server
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server --shutdown_server
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc
--remove_file $datadir/test/t1.frm --remove_file $datadir/test/t1.frm
--copy_file $MYSQLTEST_VARDIR/tmp/t1.frm $datadir/test/t1.frm --copy_file $MYSQLTEST_VARDIR/tmp/t1.frm $datadir/test/t1.frm
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect --enable_reconnect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc
......
...@@ -43,7 +43,7 @@ INSERT INTO t1 VALUES(1),(2),(3); ...@@ -43,7 +43,7 @@ INSERT INTO t1 VALUES(1),(2),(3);
--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` --let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
--exec echo wait > $_expect_file_name --write_line wait $_expect_file_name
SET SESSION debug_dbug="+d,ib_discard_before_commit_crash"; SET SESSION debug_dbug="+d,ib_discard_before_commit_crash";
--error 2013 --error 2013
ALTER TABLE t1 DISCARD TABLESPACE; ALTER TABLE t1 DISCARD TABLESPACE;
...@@ -57,7 +57,7 @@ SET GLOBAL innodb_file_per_table = 1; ...@@ -57,7 +57,7 @@ SET GLOBAL innodb_file_per_table = 1;
CREATE TABLE t1 (c1 INT) ENGINE = InnoDB; CREATE TABLE t1 (c1 INT) ENGINE = InnoDB;
INSERT INTO t1 VALUES(1),(2),(3); INSERT INTO t1 VALUES(1),(2),(3);
--exec echo wait > $_expect_file_name --write_line wait $_expect_file_name
SET SESSION debug_dbug="+d,ib_discard_after_commit_crash"; SET SESSION debug_dbug="+d,ib_discard_after_commit_crash";
--error 2013 --error 2013
ALTER TABLE t1 DISCARD TABLESPACE; ALTER TABLE t1 DISCARD TABLESPACE;
...@@ -101,7 +101,7 @@ EOF ...@@ -101,7 +101,7 @@ EOF
--error ER_TABLESPACE_DISCARDED --error ER_TABLESPACE_DISCARDED
SELECT * FROM t1; SELECT * FROM t1;
--exec echo wait > $_expect_file_name --write_line wait $_expect_file_name
SET SESSION debug_dbug="+d,ib_import_before_commit_crash"; SET SESSION debug_dbug="+d,ib_import_before_commit_crash";
--error 2013 --error 2013
ALTER TABLE t1 IMPORT TABLESPACE; ALTER TABLE t1 IMPORT TABLESPACE;
......
...@@ -58,7 +58,7 @@ SELECT * FROM bug_60196; ...@@ -58,7 +58,7 @@ SELECT * FROM bug_60196;
--echo # Restart server. --echo # Restart server.
# Write file to make mysql-test-run.pl start up the server again # Write file to make mysql-test-run.pl start up the server again
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
# Turn on reconnect # Turn on reconnect
--enable_reconnect --enable_reconnect
...@@ -132,7 +132,7 @@ SELECT * FROM Bug_60309; ...@@ -132,7 +132,7 @@ SELECT * FROM Bug_60309;
--echo # Restart server. --echo # Restart server.
# Write file to make mysql-test-run.pl start up the server again # Write file to make mysql-test-run.pl start up the server again
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
# Turn on reconnect # Turn on reconnect
--enable_reconnect --enable_reconnect
......
...@@ -207,7 +207,7 @@ print FILE "\0" x 16384; ...@@ -207,7 +207,7 @@ print FILE "\0" x 16384;
close(FILE); close(FILE);
EOF EOF
--exec echo "" > $MYSQLD_DATADIR/test/u2.ibd --write_line "" $MYSQLD_DATADIR/test/u2.ibd
--copy_file $MYSQLD_DATADIR/test/u6.ibd $MYSQLD_DATADIR/test/u4.ibd --copy_file $MYSQLD_DATADIR/test/u6.ibd $MYSQLD_DATADIR/test/u4.ibd
......
...@@ -135,7 +135,7 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED'); ...@@ -135,7 +135,7 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED');
# We cannot use include/restart_mysqld.inc in this particular test, # We cannot use include/restart_mysqld.inc in this particular test,
# because SHOW STATUS would fail due to unwritable (nonexistent) tmpdir. # because SHOW STATUS would fail due to unwritable (nonexistent) tmpdir.
--source include/shutdown_mysqld.inc --source include/shutdown_mysqld.inc
--exec echo "restart: --tmpdir=/dev/null/$MYSQL_TMP_DIR --skip-innodb-fast-shutdown" > $_expect_file_name --write_line "restart: --tmpdir=/dev/null/$MYSQL_TMP_DIR --skip-innodb-fast-shutdown" $_expect_file_name
--enable_reconnect --enable_reconnect
--disable_result_log --disable_result_log
--disable_query_log --disable_query_log
......
...@@ -12,7 +12,7 @@ insert into t1 values (1, 1); ...@@ -12,7 +12,7 @@ insert into t1 values (1, 1);
# Slow shutdown and restart to make sure ibuf merge is finished # Slow shutdown and restart to make sure ibuf merge is finished
SET GLOBAL innodb_fast_shutdown = 0; SET GLOBAL innodb_fast_shutdown = 0;
let $shutdown_timeout=; let $shutdown_timeout=;
let $restart_parameters="--debug_dbug=+d,ib_log_checkpoint_avoid_hard --innodb_flush_sync=0"; let $restart_parameters=--debug_dbug=+d,ib_log_checkpoint_avoid_hard --innodb_flush_sync=0;
--source include/restart_mysqld.inc --source include/restart_mysqld.inc
--source ../include/no_checkpoint_start.inc --source ../include/no_checkpoint_start.inc
......
...@@ -115,7 +115,7 @@ CREATE TABLE t1 ( ...@@ -115,7 +115,7 @@ CREATE TABLE t1 (
INSERT INTO t1(title) VALUES('database'); INSERT INTO t1(title) VALUES('database');
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
SET debug_dbug = '+d,fts_instrument_sync_debug,fts_write_node_crash'; SET debug_dbug = '+d,fts_instrument_sync_debug,fts_write_node_crash';
......
...@@ -463,7 +463,7 @@ rollback; ...@@ -463,7 +463,7 @@ rollback;
# Test partial update rollback after recovered. # Test partial update rollback after recovered.
# Crash the server in partial update. # Crash the server in partial update.
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
set session debug="+d,row_mysql_crash_if_error"; set session debug="+d,row_mysql_crash_if_error";
--error 2013 --error 2013
update t1 set a=point(5,5), b=point(5,5), c=5 where i < 3; update t1 set a=point(5,5), b=point(5,5), c=5 where i < 3;
......
...@@ -412,13 +412,13 @@ SHOW CREATE TABLE t77_restart; ...@@ -412,13 +412,13 @@ SHOW CREATE TABLE t77_restart;
--echo # Moving tablespace 't4_restart' from MYSQL_DATA_DIR to MYSQL_TMP_DIR/new_dir --echo # Moving tablespace 't4_restart' from MYSQL_DATA_DIR to MYSQL_TMP_DIR/new_dir
--copy_file $MYSQL_DATA_DIR/test/t4_restart.ibd $MYSQL_TMP_DIR/new_dir/test/t4_restart.ibd --copy_file $MYSQL_DATA_DIR/test/t4_restart.ibd $MYSQL_TMP_DIR/new_dir/test/t4_restart.ibd
--remove_file $MYSQL_DATA_DIR/test/t4_restart.ibd --remove_file $MYSQL_DATA_DIR/test/t4_restart.ibd
--exec echo $MYSQL_TMP_DIR/new_dir/test/t4_restart.ibd > $MYSQL_DATA_DIR/test/t4_restart.isl --write_line $MYSQL_TMP_DIR/new_dir/test/t4_restart.ibd $MYSQL_DATA_DIR/test/t4_restart.isl
--echo # Moving tablespace 't55_restart' from MYSQL_TMP_DIR/alt_dir to MYSQL_TMP_DIR/new_dir --echo # Moving tablespace 't55_restart' from MYSQL_TMP_DIR/alt_dir to MYSQL_TMP_DIR/new_dir
--copy_file $MYSQL_TMP_DIR/alt_dir/test/t55_restart.ibd $MYSQL_TMP_DIR/new_dir/test/t55_restart.ibd --copy_file $MYSQL_TMP_DIR/alt_dir/test/t55_restart.ibd $MYSQL_TMP_DIR/new_dir/test/t55_restart.ibd
--remove_file $MYSQL_TMP_DIR/alt_dir/test/t55_restart.ibd --remove_file $MYSQL_TMP_DIR/alt_dir/test/t55_restart.ibd
--remove_file $MYSQL_DATA_DIR/test/t55_restart.isl --remove_file $MYSQL_DATA_DIR/test/t55_restart.isl
--exec echo $MYSQL_TMP_DIR/new_dir/test/t55_restart.ibd > $MYSQL_DATA_DIR/test/t55_restart.isl --write_line $MYSQL_TMP_DIR/new_dir/test/t55_restart.ibd $MYSQL_DATA_DIR/test/t55_restart.isl
--echo # Moving tablespace 't66_restart' from MYSQL_TMP_DIR/alt_dir to MYSQL_TMP_DIR/new_dir --echo # Moving tablespace 't66_restart' from MYSQL_TMP_DIR/alt_dir to MYSQL_TMP_DIR/new_dir
--copy_file $MYSQL_TMP_DIR/alt_dir/test/t66_restart#P#p0.ibd $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p0.ibd --copy_file $MYSQL_TMP_DIR/alt_dir/test/t66_restart#P#p0.ibd $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p0.ibd
...@@ -430,9 +430,9 @@ SHOW CREATE TABLE t77_restart; ...@@ -430,9 +430,9 @@ SHOW CREATE TABLE t77_restart;
--remove_file $MYSQL_DATA_DIR/test/t66_restart#P#p0.isl --remove_file $MYSQL_DATA_DIR/test/t66_restart#P#p0.isl
--remove_file $MYSQL_DATA_DIR/test/t66_restart#P#p1.isl --remove_file $MYSQL_DATA_DIR/test/t66_restart#P#p1.isl
--remove_file $MYSQL_DATA_DIR/test/t66_restart#P#p2.isl --remove_file $MYSQL_DATA_DIR/test/t66_restart#P#p2.isl
--exec echo $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p0.ibd > $MYSQL_DATA_DIR/test/t66_restart#P#p0.isl --write_line $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p0.ibd $MYSQL_DATA_DIR/test/t66_restart#P#p0.isl
--exec echo $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p1.ibd > $MYSQL_DATA_DIR/test/t66_restart#P#p1.isl --write_line $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p1.ibd $MYSQL_DATA_DIR/test/t66_restart#P#p1.isl
--exec echo $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p2.ibd > $MYSQL_DATA_DIR/test/t66_restart#P#p2.isl --write_line $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p2.ibd $MYSQL_DATA_DIR/test/t66_restart#P#p2.isl
--echo # Moving tablespace 't77_restart' from MYSQL_TMP_DIR/alt_dir to MYSQL_TMP_DIR/new_dir --echo # Moving tablespace 't77_restart' from MYSQL_TMP_DIR/alt_dir to MYSQL_TMP_DIR/new_dir
--copy_file $MYSQL_TMP_DIR/alt_dir/test/t77_restart#P#p0#SP#s0.ibd $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p0#SP#s0.ibd --copy_file $MYSQL_TMP_DIR/alt_dir/test/t77_restart#P#p0#SP#s0.ibd $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p0#SP#s0.ibd
...@@ -447,10 +447,10 @@ SHOW CREATE TABLE t77_restart; ...@@ -447,10 +447,10 @@ SHOW CREATE TABLE t77_restart;
--remove_file $MYSQL_DATA_DIR/test/t77_restart#P#p0#SP#s1.isl --remove_file $MYSQL_DATA_DIR/test/t77_restart#P#p0#SP#s1.isl
--remove_file $MYSQL_DATA_DIR/test/t77_restart#P#p1#SP#s2.isl --remove_file $MYSQL_DATA_DIR/test/t77_restart#P#p1#SP#s2.isl
--remove_file $MYSQL_DATA_DIR/test/t77_restart#P#p1#SP#s3.isl --remove_file $MYSQL_DATA_DIR/test/t77_restart#P#p1#SP#s3.isl
--exec echo $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p0#SP#s0.ibd > $MYSQL_DATA_DIR/test/t77_restart#P#p0#SP#s0.isl --write_line $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p0#SP#s0.ibd $MYSQL_DATA_DIR/test/t77_restart#P#p0#SP#s0.isl
--exec echo $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p0#SP#s1.ibd > $MYSQL_DATA_DIR/test/t77_restart#P#p0#SP#s1.isl --write_line $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p0#SP#s1.ibd $MYSQL_DATA_DIR/test/t77_restart#P#p0#SP#s1.isl
--exec echo $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p1#SP#s2.ibd > $MYSQL_DATA_DIR/test/t77_restart#P#p1#SP#s2.isl --write_line $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p1#SP#s2.ibd $MYSQL_DATA_DIR/test/t77_restart#P#p1#SP#s2.isl
--exec echo $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p1#SP#s3.ibd > $MYSQL_DATA_DIR/test/t77_restart#P#p1#SP#s3.isl --write_line $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p1#SP#s3.ibd $MYSQL_DATA_DIR/test/t77_restart#P#p1#SP#s3.isl
--echo ---- MYSQL_DATA_DIR/test --echo ---- MYSQL_DATA_DIR/test
--list_files_write_file $MYSQLD_DATADIR.files.txt $MYSQL_DATA_DIR/test --list_files_write_file $MYSQLD_DATADIR.files.txt $MYSQL_DATA_DIR/test
......
...@@ -75,7 +75,7 @@ SET SESSION debug_dbug="+d,ib_import_before_commit_crash"; ...@@ -75,7 +75,7 @@ SET SESSION debug_dbug="+d,ib_import_before_commit_crash";
SELECT * FROM t1; SELECT * FROM t1;
# Write file to make mysql-test-run.pl start up the server again # Write file to make mysql-test-run.pl start up the server again
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
# Execute the statement that causes the crash # Execute the statement that causes the crash
--error 2013 --error 2013
...@@ -96,7 +96,7 @@ SET SESSION debug_dbug="+d,ib_import_before_checkpoint_crash"; ...@@ -96,7 +96,7 @@ SET SESSION debug_dbug="+d,ib_import_before_checkpoint_crash";
SELECT COUNT(*) FROM t1; SELECT COUNT(*) FROM t1;
# Don't start up the server right away. # Don't start up the server right away.
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
# Execute the statement that causes the crash # Execute the statement that causes the crash
--error 2013 --error 2013
...@@ -113,7 +113,7 @@ EOF ...@@ -113,7 +113,7 @@ EOF
--echo # Restart and reconnect to the server --echo # Restart and reconnect to the server
--enable_reconnect --enable_reconnect
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc
--disable_reconnect --disable_reconnect
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
--source include/have_maria.inc --source include/have_maria.inc
--source include/default_charset.inc --source include/default_charset.inc
--source include/not_embedded.inc
--source include/have_debug.inc
# Cleanup # Cleanup
--disable_warnings --disable_warnings
...@@ -13,7 +15,7 @@ DROP PROCEDURE IF EXISTS proc_insert_many; ...@@ -13,7 +15,7 @@ DROP PROCEDURE IF EXISTS proc_insert_many;
# -------- # --------
# Configure encryption # Configure encryption
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server --shutdown_server
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc
...@@ -21,7 +23,7 @@ DROP PROCEDURE IF EXISTS proc_insert_many; ...@@ -21,7 +23,7 @@ DROP PROCEDURE IF EXISTS proc_insert_many;
1;76025E3ADC78D74819927DB02AAA4C35 1;76025E3ADC78D74819927DB02AAA4C35
EOF EOF
--exec echo "restart:--aria-encrypt-tables=1 --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/key.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line "restart:--aria-encrypt-tables=1 --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/key.txt" $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect --enable_reconnect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc
...@@ -73,7 +75,7 @@ CALL proc_insert_many(); ...@@ -73,7 +75,7 @@ CALL proc_insert_many();
UNLOCK TABLES; UNLOCK TABLES;
# Crash and restart the server while it's still flushing index # Crash and restart the server while it's still flushing index
--exec echo "restart:--aria-encrypt-tables=1 --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/key.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line "restart:--aria-encrypt-tables=1 --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/key.txt" $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
SET debug_dbug="d,crash_shutdown"; SET debug_dbug="d,crash_shutdown";
--error 2013 --error 2013
shutdown; shutdown;
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# #
# Write file to make mysql-test-run.pl expect crash and restart # Write file to make mysql-test-run.pl expect crash and restart
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
create table t1 (a int primary key, b int, c int, unique key(b), key(c)) engine=aria transactional=1; create table t1 (a int primary key, b int, c int, unique key(b), key(c)) engine=aria transactional=1;
insert into t1 values (1000,1000,1000); insert into t1 values (1000,1000,1000);
......
...@@ -29,10 +29,10 @@ CREATE TABLE t1 (a INT KEY,b INT,KEY(b)) ENGINE=Aria; ...@@ -29,10 +29,10 @@ CREATE TABLE t1 (a INT KEY,b INT,KEY(b)) ENGINE=Aria;
--echo # Restart with encryption enabled --echo # Restart with encryption enabled
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server --shutdown_server
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc
--exec echo "restart:--aria-encrypt-tables=1 --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line "restart:--aria-encrypt-tables=1 --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect --enable_reconnect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc
...@@ -43,10 +43,10 @@ LOAD INDEX INTO CACHE t1; ...@@ -43,10 +43,10 @@ LOAD INDEX INTO CACHE t1;
# Restart without encryption. Above table should be unreadable # Restart without encryption. Above table should be unreadable
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server --shutdown_server
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc
--exec echo "restart:--aria-encrypt-tables=0" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line "restart:--aria-encrypt-tables=0" $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect --enable_reconnect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc
......
...@@ -9,7 +9,7 @@ call mtr.add_suppression("System key id 1 is missing"); ...@@ -9,7 +9,7 @@ call mtr.add_suppression("System key id 1 is missing");
call mtr.add_suppression("Unknown key id 1"); call mtr.add_suppression("Unknown key id 1");
call mtr.add_suppression("Initialization of encryption failed.*"); call mtr.add_suppression("Initialization of encryption failed.*");
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server --shutdown_server
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc
...@@ -17,14 +17,14 @@ call mtr.add_suppression("Initialization of encryption failed.*"); ...@@ -17,14 +17,14 @@ call mtr.add_suppression("Initialization of encryption failed.*");
1;770A8A65DA156D24EE2A093277530142 1;770A8A65DA156D24EE2A093277530142
EOF EOF
--exec echo "restart:--aria-encrypt-tables=1 --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line "restart:--aria-encrypt-tables=1 --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect --enable_reconnect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc
CREATE TABLE t1 (i INT, KEY(i)) ENGINE=Aria; CREATE TABLE t1 (i INT, KEY(i)) ENGINE=Aria;
INSERT INTO t1 VALUES (1); INSERT INTO t1 VALUES (1);
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server --shutdown_server
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc
...@@ -32,7 +32,7 @@ INSERT INTO t1 VALUES (1); ...@@ -32,7 +32,7 @@ INSERT INTO t1 VALUES (1);
2;770A8A65DA156D24EE2A093277530143 2;770A8A65DA156D24EE2A093277530143
EOF EOF
--exec echo "restart:--aria-encrypt-tables=1 --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys2.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line "restart:--aria-encrypt-tables=1 --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys2.txt" $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect --enable_reconnect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc
...@@ -43,11 +43,11 @@ repair table t1; ...@@ -43,11 +43,11 @@ repair table t1;
--error HA_ERR_NO_ENCRYPTION --error HA_ERR_NO_ENCRYPTION
INSERT INTO t1 VALUES (2); INSERT INTO t1 VALUES (2);
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server --shutdown_server
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc
--exec echo "restart:--aria-encrypt-tables=1 --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line "restart:--aria-encrypt-tables=1 --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect --enable_reconnect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
--sorted_result --sorted_result
SELECT * FROM t1; SELECT * FROM t1;
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--disable_reconnect --disable_reconnect
# CR_SERVER_LOST # CR_SERVER_LOST
--error 2013 --error 2013
...@@ -22,7 +22,7 @@ SELECT * FROM t1; ...@@ -22,7 +22,7 @@ SELECT * FROM t1;
--replace_regex /sql-exchange.*\./sql-exchange./ /sql-shadow-[0-9a-f]*-/sql-shadow-/ --replace_regex /sql-exchange.*\./sql-exchange./ /sql-shadow-[0-9a-f]*-/sql-shadow-/
--cat_file $DATADIR.files.txt --cat_file $DATADIR.files.txt
--remove_file $DATADIR.files.txt --remove_file $DATADIR.files.txt
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect --enable_reconnect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc
--echo # State after crash recovery --echo # State after crash recovery
......
...@@ -13,7 +13,7 @@ let $error_log= $MYSQLTEST_VARDIR/log/my_restart.err; ...@@ -13,7 +13,7 @@ let $error_log= $MYSQLTEST_VARDIR/log/my_restart.err;
let SEARCH_FILE= $error_log; let SEARCH_FILE= $error_log;
# Stop the server # Stop the server
let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect; let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
--exec echo "wait" > $restart_file --write_line wait $restart_file
--shutdown_server --shutdown_server
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc
--error 7 --error 7
...@@ -61,7 +61,7 @@ let SEARCH_PATTERN= Can.t change dir to .*bad_option_h_param; ...@@ -61,7 +61,7 @@ let SEARCH_PATTERN= Can.t change dir to .*bad_option_h_param;
--remove_file $error_log --remove_file $error_log
# Write file to make mysql-test-run.pl start up the server again # Write file to make mysql-test-run.pl start up the server again
--exec echo "restart" > $restart_file --write_line restart $restart_file
# Turn on reconnect # Turn on reconnect
--enable_reconnect --enable_reconnect
......
...@@ -23,7 +23,7 @@ DROP TABLE performance_schema.processlist; ...@@ -23,7 +23,7 @@ DROP TABLE performance_schema.processlist;
SHOW CREATE TABLE performance_schema.processlist; SHOW CREATE TABLE performance_schema.processlist;
let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect; let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
--exec echo "wait" > $restart_file --write_line wait $restart_file
--echo ## --echo ##
--echo ## Server shutdown --echo ## Server shutdown
--echo ## --echo ##
...@@ -93,7 +93,7 @@ SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; ...@@ -93,7 +93,7 @@ SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
--error ER_BAD_FIELD_ERROR --error ER_BAD_FIELD_ERROR
SHOW PROCESSLIST; SHOW PROCESSLIST;
--exec echo "wait" > $restart_file --write_line wait $restart_file
--echo ## --echo ##
--echo ## Server shutdown --echo ## Server shutdown
--echo ## --echo ##
...@@ -166,7 +166,7 @@ SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; ...@@ -166,7 +166,7 @@ SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
# Works and returns no data, innodb table is empty. # Works and returns no data, innodb table is empty.
SHOW PROCESSLIST; SHOW PROCESSLIST;
--exec echo "wait" > $restart_file --write_line wait $restart_file
--echo ## --echo ##
--echo ## Server shutdown --echo ## Server shutdown
--echo ## --echo ##
...@@ -231,7 +231,7 @@ SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; ...@@ -231,7 +231,7 @@ SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
# Works and returns no data, innodb table is empty. # Works and returns no data, innodb table is empty.
SHOW PROCESSLIST; SHOW PROCESSLIST;
--exec echo "wait" > $restart_file --write_line wait $restart_file
--echo ## --echo ##
--echo ## Server shutdown --echo ## Server shutdown
--echo ## --echo ##
...@@ -306,7 +306,7 @@ SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; ...@@ -306,7 +306,7 @@ SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
--replace_column 3 [HOST:PORT] 6 [TIME] --replace_column 3 [HOST:PORT] 6 [TIME]
SHOW PROCESSLIST; SHOW PROCESSLIST;
--exec echo "wait" > $restart_file --write_line wait $restart_file
--echo ## --echo ##
--echo ## Server shutdown --echo ## Server shutdown
--echo ## --echo ##
......
...@@ -69,7 +69,7 @@ SELECT * FROM performance_schema.setup_instruments ...@@ -69,7 +69,7 @@ SELECT * FROM performance_schema.setup_instruments
WHERE name like "%wait/io/table/sql/handler%"; WHERE name like "%wait/io/table/sql/handler%";
# Write file to make mysql-test-run.pl wait for the server to stop # Write file to make mysql-test-run.pl wait for the server to stop
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
# Restart the server # Restart the server
--echo # --echo #
...@@ -79,7 +79,7 @@ WHERE name like "%wait/io/table/sql/handler%"; ...@@ -79,7 +79,7 @@ WHERE name like "%wait/io/table/sql/handler%";
--echo # Restart server with wait/io/table/sql/handler disabled --echo # Restart server with wait/io/table/sql/handler disabled
--exec echo "restart:--loose-performance-schema-instrument=%wait/io/table/sql/%=off" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line "restart:--loose-performance-schema-instrument=%wait/io/table/sql/%=off" $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
# Turn on reconnect # Turn on reconnect
--echo # Enable reconnect --echo # Enable reconnect
......
...@@ -19,10 +19,10 @@ ...@@ -19,10 +19,10 @@
--source include/have_perfschema.inc --source include/have_perfschema.inc
let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect; let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
--exec echo "wait" > $restart_file --write_line wait $restart_file
--shutdown_server --shutdown_server
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc
--exec echo "restart:--performance_schema_max_program_instances=7 --performance_schema_max_statement_stack=2 --thread_stack=655360">$restart_file --write_line "restart:--performance_schema_max_program_instances=7 --performance_schema_max_statement_stack=2 --thread_stack=655360" $restart_file
--enable_reconnect --enable_reconnect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc
......
...@@ -122,6 +122,31 @@ connection slave; ...@@ -122,6 +122,31 @@ connection slave;
# Slave_skipped_errros = 5 # Slave_skipped_errros = 5
**** We cannot execute a select as there are differences in the **** We cannot execute a select as there are differences in the
**** behavior between STMT and RBR. **** behavior between STMT and RBR.
****
**** Ensure transactions which are skipped due to encountering a
**** non-deadlock error which is present in --slave-skip-errors result
**** in partially committed transactions
connection master;
CREATE TABLE t3 (a INT UNIQUE) ENGINE=InnoDB;
connection slave;
connection slave;
INSERT INTO t3 VALUES (3);
connection master;
BEGIN;
INSERT INTO t3 VALUES (1);
INSERT INTO t3 VALUES (2);
INSERT INTO t3 VALUES (3);
INSERT INTO t3 VALUES (4);
COMMIT;
connection slave;
**** Master and slave tables should have the same data, due to the
**** partially replicated transaction's data overlapping with the data
**** that pre-existed on the slave. That is, despite the transaction
**** consisting of 4 statements, the errored statement should be ignored
**** and the other 3 should commit successfully.
include/diff_tables.inc [master:t3,slave:t3]
connection master;
DROP TABLE t3;
==== Clean Up ==== ==== Clean Up ====
connection master; connection master;
DROP TABLE t1; DROP TABLE t1;
......
include/master-slave.inc
[connection master]
call mtr.add_suppression("Deadlock found when trying to get lock; try restarting transaction");
*** Provoke a deadlock on the slave, check that transaction retry succeeds. ***
connection master;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
CREATE TABLE t2 (a INT) ENGINE=InnoDB;
INSERT INTO t1(a) VALUES (1), (2), (3), (4), (5);
connection slave;
SELECT * FROM t1 ORDER BY a;
a b
1 NULL
2 NULL
3 NULL
4 NULL
5 NULL
SET sql_log_bin=0;
ALTER TABLE t2 ENGINE=MyISAM;
SET sql_log_bin=1;
connect con_temp1,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
connection con_temp1;
BEGIN;
UPDATE t1 SET b=2 WHERE a=4;
INSERT INTO t2 VALUES (2);
DELETE FROM t2 WHERE a=2;
connection master;
BEGIN;
UPDATE t1 SET b=1 WHERE a=2;
INSERT INTO t2 VALUES (1);
UPDATE t1 SET b=1 WHERE a=4;
COMMIT;
connection slave;
connection con_temp1;
UPDATE t1 SET b=2 WHERE a=2;
SELECT * FROM t1 WHERE a<10 ORDER BY a;
a b
1 NULL
2 2
3 NULL
4 2
5 NULL
ROLLBACK;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
connection slave;
SELECT * FROM t1 ORDER BY a;
a b
1 NULL
2 NULL
3 NULL
4 NULL
5 NULL
* There will be one row in t2 because the ignored deadlock does not retry.
SELECT * FROM t2 ORDER BY a;
a
1
retries
0
Last_SQL_Errno = '0'
Last_SQL_Error = ''
connection master;
DROP TABLE t1;
DROP TABLE t2;
include/rpl_end.inc
...@@ -42,7 +42,7 @@ insert into ti set a=null; ...@@ -42,7 +42,7 @@ insert into ti set a=null;
insert into tm set a=null; insert into tm set a=null;
set @@global.debug_dbug="+d,crash_before_send_xid"; set @@global.debug_dbug="+d,crash_before_send_xid";
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
connection slave; connection slave;
let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1); let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
...@@ -64,7 +64,7 @@ connection master; ...@@ -64,7 +64,7 @@ connection master;
--enable_reconnect --enable_reconnect
--let $rpl_server_number=1 --let $rpl_server_number=1
--source include/rpl_start_server.inc --source include/rpl_start_server.inc
#--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect #--write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc
--echo # Master has restarted successfully --echo # Master has restarted successfully
save_master_pos; save_master_pos;
......
...@@ -47,7 +47,7 @@ RESET SLAVE; ...@@ -47,7 +47,7 @@ RESET SLAVE;
--echo # --echo #
--let $datadir = `select @@datadir` --let $datadir = `select @@datadir`
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect --write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
--shutdown_server 10 --shutdown_server 10
--source include/wait_until_disconnected.inc --source include/wait_until_disconnected.inc
...@@ -64,7 +64,7 @@ RESET SLAVE; ...@@ -64,7 +64,7 @@ RESET SLAVE;
--echo # Restart slave server --echo # Restart slave server
--echo # --echo #
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
--enable_reconnect --enable_reconnect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc
SET @save_slave_parallel_threads= @@GLOBAL.slave_parallel_threads; SET @save_slave_parallel_threads= @@GLOBAL.slave_parallel_threads;
......
...@@ -3,7 +3,11 @@ ...@@ -3,7 +3,11 @@
# Verify that --slave-skip-errors works correctly. The error messages # Verify that --slave-skip-errors works correctly. The error messages
# specified by --slave-skip-errors on slave should be ignored. If # specified by --slave-skip-errors on slave should be ignored. If
# such errors occur, they should not be reported and not cause the # such errors occur, they should not be reported and not cause the
# slave to stop. # slave to stop. If a skipped-due-to-error statement is a part of a
# larger transaction, and the error is not a deadlock error, the rest
# of the transaction should still commit, with just the errored statement
# ignored (note transactions which are skipped due to deadlocks are
# rolled back fully, see rpl_temporary_error2_skip_all.test).
# #
# ==== Method ==== # ==== Method ====
# #
...@@ -164,6 +168,42 @@ let $current_skipped_error= query_get_value(show global status like "Slave_skipp ...@@ -164,6 +168,42 @@ let $current_skipped_error= query_get_value(show global status like "Slave_skipp
--echo **** We cannot execute a select as there are differences in the --echo **** We cannot execute a select as there are differences in the
--echo **** behavior between STMT and RBR. --echo **** behavior between STMT and RBR.
--echo ****
--echo **** Ensure transactions which are skipped due to encountering a
--echo **** non-deadlock error which is present in --slave-skip-errors result
--echo **** in partially committed transactions
# Slave will insert 3 first, and master will insert 3 within a larger trx
--let $value_preexisting_on_slave= 3
--connection master
CREATE TABLE t3 (a INT UNIQUE) ENGINE=InnoDB;
--sync_slave_with_master
--connection slave
--eval INSERT INTO t3 VALUES ($value_preexisting_on_slave)
--connection master
BEGIN;
INSERT INTO t3 VALUES (1);
INSERT INTO t3 VALUES (2);
--eval INSERT INTO t3 VALUES ($value_preexisting_on_slave)
INSERT INTO t3 VALUES (4);
COMMIT;
--sync_slave_with_master
--echo **** Master and slave tables should have the same data, due to the
--echo **** partially replicated transaction's data overlapping with the data
--echo **** that pre-existed on the slave. That is, despite the transaction
--echo **** consisting of 4 statements, the errored statement should be ignored
--echo **** and the other 3 should commit successfully.
let $diff_tables=master:t3,slave:t3;
source include/diff_tables.inc;
--connection master
DROP TABLE t3;
--echo ==== Clean Up ==== --echo ==== Clean Up ====
connection master; connection master;
......
...@@ -82,7 +82,7 @@ print FILE "failure"; ...@@ -82,7 +82,7 @@ print FILE "failure";
close ($file); close ($file);
EOF EOF
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
SET SESSION debug_dbug="d,crash_before_rotate_relaylog"; SET SESSION debug_dbug="d,crash_before_rotate_relaylog";
--error 2013 --error 2013
FLUSH LOGS; FLUSH LOGS;
...@@ -130,7 +130,7 @@ print FILE @content; ...@@ -130,7 +130,7 @@ print FILE @content;
close FILE; close FILE;
EOF EOF
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect --write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
SET SESSION debug_dbug="d,crash_before_rotate_relaylog"; SET SESSION debug_dbug="d,crash_before_rotate_relaylog";
--error 2013 --error 2013
FLUSH LOGS; FLUSH LOGS;
......
...@@ -64,7 +64,14 @@ ROLLBACK; ...@@ -64,7 +64,14 @@ ROLLBACK;
--connection slave --connection slave
--sync_with_master --sync_with_master
SELECT * FROM t1 ORDER BY a; SELECT * FROM t1 ORDER BY a;
--echo * There will be two rows in t2 due to the retry. if (!$ignored_db_deadlock)
{
--echo * There will be two rows in t2 due to the retry.
}
if ($ignored_db_deadlock)
{
--echo * There will be one row in t2 because the ignored deadlock does not retry.
}
SELECT * FROM t2 ORDER BY a; SELECT * FROM t2 ORDER BY a;
let $new_retry= query_get_value(SHOW STATUS LIKE 'Slave_retried_transactions', Value, 1); let $new_retry= query_get_value(SHOW STATUS LIKE 'Slave_retried_transactions', Value, 1);
--disable_query_log --disable_query_log
......
--source include/have_binlog_format_row.inc
--let $ignored_db_deadlock= 1
--source rpl_temporary_error2.test
...@@ -5991,11 +5991,13 @@ static int rows_event_stmt_cleanup(rpl_group_info *rgi, THD * thd) ...@@ -5991,11 +5991,13 @@ static int rows_event_stmt_cleanup(rpl_group_info *rgi, THD * thd)
Xid_log_event will come next which will, if some transactional engines Xid_log_event will come next which will, if some transactional engines
are involved, commit the transaction and flush the pending event to the are involved, commit the transaction and flush the pending event to the
binlog. binlog.
If there was a deadlock the transaction should have been rolled back We check for thd->transaction_rollback_request because it is possible
already. So there should be no need to rollback the transaction. there was a deadlock that was ignored by slave-skip-errors. Normally, the
deadlock would have been rolled back already.
*/ */
DBUG_ASSERT(! thd->transaction_rollback_request); error|= (int) ((error || thd->transaction_rollback_request)
error|= (int)(error ? trans_rollback_stmt(thd) : trans_commit_stmt(thd)); ? trans_rollback_stmt(thd)
: trans_commit_stmt(thd));
/* /*
Now what if this is not a transactional engine? we still need to Now what if this is not a transactional engine? we still need to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment