Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
40983a32
Commit
40983a32
authored
Aug 16, 2006
by
msvensson@shellback.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal:/home/bk/mysql-5.1-new-maint
into shellback.(none):/home/msvensson/mysql/mysql-5.1-new-maint
parents
8d83366b
0c41fd3a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
317 additions
and
226 deletions
+317
-226
mysql-test/lib/mtr_process.pl
mysql-test/lib/mtr_process.pl
+4
-1
mysql-test/mysql-test-run.pl
mysql-test/mysql-test-run.pl
+313
-225
No files found.
mysql-test/lib/mtr_process.pl
View file @
40983a32
...
@@ -633,7 +633,7 @@ sub mtr_check_stop_servers ($) {
...
@@ -633,7 +633,7 @@ sub mtr_check_stop_servers ($) {
}
}
else
else
{
{
mtr_verbose
("
All ports w
h
ere free, continuing
");
mtr_verbose
("
All ports were free, continuing
");
}
}
}
}
}
}
...
@@ -896,6 +896,7 @@ sub check_expected_crash_and_restart($)
...
@@ -896,6 +896,7 @@ sub check_expected_crash_and_restart($)
sub
mtr_record_dead_children
()
{
sub
mtr_record_dead_children
()
{
my
$process_died
=
0
;
my
$ret_pid
;
my
$ret_pid
;
# Wait without blockinng to see if any processes had died
# Wait without blockinng to see if any processes had died
...
@@ -904,7 +905,9 @@ sub mtr_record_dead_children () {
...
@@ -904,7 +905,9 @@ sub mtr_record_dead_children () {
{
{
mtr_warning
("
mtr_record_dead_children:
$ret_pid
");
mtr_warning
("
mtr_record_dead_children:
$ret_pid
");
mark_process_dead
(
$ret_pid
);
mark_process_dead
(
$ret_pid
);
$process_died
=
1
;
}
}
return
$process_died
;
}
}
sub
start_reap_all
{
sub
start_reap_all
{
...
...
mysql-test/mysql-test-run.pl
View file @
40983a32
...
@@ -358,7 +358,7 @@ sub initialize_servers ();
...
@@ -358,7 +358,7 @@ sub initialize_servers ();
sub
mysql_install_db
();
sub
mysql_install_db
();
sub
install_db
($$);
sub
install_db
($$);
sub
run_testcase
($);
sub
run_testcase
($);
sub
run_testcase_stop_servers
($);
sub
run_testcase_stop_servers
($
$$
);
sub
run_testcase_start_servers
($);
sub
run_testcase_start_servers
($);
sub
report_failure_and_restart
($);
sub
report_failure_and_restart
($);
sub
do_before_start_master
($$);
sub
do_before_start_master
($$);
...
@@ -1310,9 +1310,19 @@ sub executable_setup () {
...
@@ -1310,9 +1310,19 @@ sub executable_setup () {
}
}
sub
generate_cmdline_mysqldump
($)
{
my
(
$mysqld
)
=
@_
;
return
"
$exe_mysqldump
--no-defaults -uroot
"
.
"
--port=
$mysqld
->{'port'}
"
.
"
--socket=
$mysqld
->{'path_sock'} --password=
";
}
##############################################################################
##############################################################################
#
#
# Set environment to be used by childs of this process
# Set environment to be used by childs of this process for
# things that are constant duting the whole lifetime of mysql-test-run.pl
#
#
##############################################################################
##############################################################################
...
@@ -1337,18 +1347,11 @@ sub environment_setup () {
...
@@ -1337,18 +1347,11 @@ sub environment_setup () {
(
$ENV
{'
DYLD_LIBRARY_PATH
'}
?
"
:
$ENV
{'DYLD_LIBRARY_PATH'}
"
:
"");
(
$ENV
{'
DYLD_LIBRARY_PATH
'}
?
"
:
$ENV
{'DYLD_LIBRARY_PATH'}
"
:
"");
}
}
# --------------------------------------------------------------------------
# Add the path where mysqld will find udf_example.so
# --------------------------------------------------------------------------
$ENV
{'
LD_LIBRARY_PATH
'}
=
(
$lib_udf_example
?
dirname
(
$lib_udf_example
)
:
"")
.
(
$ENV
{'
LD_LIBRARY_PATH
'}
?
"
:
$ENV
{'LD_LIBRARY_PATH'}
"
:
"");
# --------------------------------------------------------------------------
# --------------------------------------------------------------------------
# Also command lines in .opt files may contain env vars
# Also command lines in .opt files may contain env vars
# --------------------------------------------------------------------------
# --------------------------------------------------------------------------
$ENV
{'
CHARSETSDIR
'}
=
$path_charsetsdir
;
$ENV
{'
UMASK
'}
=
"
0660
";
# The octal *string*
$ENV
{'
UMASK
'}
=
"
0660
";
# The octal *string*
$ENV
{'
UMASK_DIR
'}
=
"
0770
";
# The octal *string*
$ENV
{'
UMASK_DIR
'}
=
"
0770
";
# The octal *string*
$ENV
{'
LC_COLLATE
'}
=
"
C
";
$ENV
{'
LC_COLLATE
'}
=
"
C
";
...
@@ -1366,10 +1369,30 @@ sub environment_setup () {
...
@@ -1366,10 +1369,30 @@ sub environment_setup () {
# $ENV{'MYSQL_TCP_PORT'}= '@MYSQL_TCP_PORT@'; # FIXME
# $ENV{'MYSQL_TCP_PORT'}= '@MYSQL_TCP_PORT@'; # FIXME
$ENV
{'
MYSQL_TCP_PORT
'}
=
3306
;
$ENV
{'
MYSQL_TCP_PORT
'}
=
3306
;
$ENV
{'
NDBCLUSTER_PORT
'}
=
$opt_ndbcluster_port
;
$ENV
{
MTR_BUILD_THREAD
}
=
0
unless
$ENV
{
MTR_BUILD_THREAD
};
# Set if not set
$ENV
{'
NDBCLUSTER_PORT_SLAVE
'}
=
$opt_ndbcluster_port_slave
;
$ENV
{'
NDB_STATUS_OK
'}
=
"
YES
";
# ----------------------------------------------------
# Setup env for NDB
# ----------------------------------------------------
$ENV
{'
NDB_MGM
'}
=
$exe_ndb_mgm
;
$ENV
{'
NDBCLUSTER_PORT
'}
=
$opt_ndbcluster_port
;
$ENV
{'
NDBCLUSTER_PORT_SLAVE
'}
=
$opt_ndbcluster_port_slave
;
$ENV
{'
NDB_STATUS_OK
'}
=
$clusters
->
[
0
]
->
{'
installed_ok
'};
$ENV
{'
NDB_SLAVE_STATUS_OK
'}
=
$clusters
->
[
0
]
->
{'
installed_ok
'};;
$ENV
{'
NDB_EXTRA_TEST
'}
=
$opt_ndb_extra_test
;
$ENV
{'
NDB_BACKUP_DIR
'}
=
$clusters
->
[
0
]
->
{'
data_dir
'};
$ENV
{'
NDB_DATA_DIR
'}
=
$clusters
->
[
0
]
->
{'
data_dir
'};
$ENV
{'
NDB_TOOLS_DIR
'}
=
$path_ndb_tools_dir
;
$ENV
{'
NDB_TOOLS_OUTPUT
'}
=
$file_ndb_testrun_log
;
$ENV
{'
NDB_CONNECTSTRING
'}
=
$opt_ndbconnectstring
;
# ----------------------------------------------------
# Setup env for IM
# ----------------------------------------------------
$ENV
{'
IM_EXE
'}
=
$exe_im
;
$ENV
{'
IM_EXE
'}
=
$exe_im
;
$ENV
{'
IM_PATH_PID
'}
=
$instance_manager
->
{
path_pid
};
$ENV
{'
IM_PATH_PID
'}
=
$instance_manager
->
{
path_pid
};
$ENV
{'
IM_PATH_ANGEL_PID
'}
=
$instance_manager
->
{
path_angel_pid
};
$ENV
{'
IM_PATH_ANGEL_PID
'}
=
$instance_manager
->
{
path_angel_pid
};
...
@@ -1384,9 +1407,174 @@ sub environment_setup () {
...
@@ -1384,9 +1407,174 @@ sub environment_setup () {
$ENV
{'
IM_MYSQLD2_PORT
'}
=
$instance_manager
->
{
instances
}
->
[
1
]
->
{
port
};
$ENV
{'
IM_MYSQLD2_PORT
'}
=
$instance_manager
->
{
instances
}
->
[
1
]
->
{
port
};
$ENV
{'
IM_MYSQLD2_PATH_PID
'}
=
$instance_manager
->
{
instances
}
->
[
1
]
->
{
path_pid
};
$ENV
{'
IM_MYSQLD2_PATH_PID
'}
=
$instance_manager
->
{
instances
}
->
[
1
]
->
{
path_pid
};
$ENV
{
MTR_BUILD_THREAD
}
=
0
unless
$ENV
{
MTR_BUILD_THREAD
};
# Set if not set
# ----------------------------------------------------
# Setup env so childs can execute mysqlcheck
# ----------------------------------------------------
my
$cmdline_mysqlcheck
=
"
$exe_mysqlcheck
--no-defaults -uroot
"
.
"
--port=
$master
->[0]->{'port'}
"
.
"
--socket=
$master
->[0]->{'path_sock'} --password=
";
if
(
$opt_debug
)
{
$cmdline_mysqlcheck
.=
"
--debug=d:t:A,
$opt_vardir_trace
/log/mysqlcheck.trace
";
}
$ENV
{'
MYSQL_CHECK
'}
=
$cmdline_mysqlcheck
;
# ----------------------------------------------------
# Setup env to childs can execute myqldump
# ----------------------------------------------------
my
$cmdline_mysqldump
=
generate_cmdline_mysqldump
(
$master
->
[
0
]);
my
$cmdline_mysqldumpslave
=
generate_cmdline_mysqldump
(
$slave
->
[
0
]);
if
(
$opt_debug
)
{
$cmdline_mysqldump
.=
"
--debug=d:t:A,
$opt_vardir_trace
/log/mysqldump-master.trace
";
$cmdline_mysqldumpslave
.=
"
--debug=d:t:A,
$opt_vardir_trace
/log/mysqldump-slave.trace
";
}
$ENV
{'
MYSQL_DUMP
'}
=
$cmdline_mysqldump
;
$ENV
{'
MYSQL_DUMP_SLAVE
'}
=
$cmdline_mysqldumpslave
;
# ----------------------------------------------------
# Setup env so childs can execute mysqlslap
# ----------------------------------------------------
unless
(
$glob_win32
)
{
my
$cmdline_mysqlslap
=
"
$exe_mysqlslap
-uroot
"
.
"
--port=
$master
->[0]->{'port'}
"
.
"
--socket=
$master
->[0]->{'path_sock'} --password=
"
.
"
--lock-directory=
$opt_tmpdir
";
if
(
$opt_debug
)
{
$cmdline_mysqlslap
.=
"
--debug=d:t:A,
$opt_vardir_trace
/log/mysqlslap.trace
";
}
$ENV
{'
MYSQL_SLAP
'}
=
$cmdline_mysqlslap
;
}
# ----------------------------------------------------
# Setup env so childs can execute mysqlimport
# ----------------------------------------------------
my
$cmdline_mysqlimport
=
"
$exe_mysqlimport
-uroot
"
.
"
--port=
$master
->[0]->{'port'}
"
.
"
--socket=
$master
->[0]->{'path_sock'} --password=
";
if
(
$opt_debug
)
{
$cmdline_mysqlimport
.=
"
--debug=d:t:A,
$opt_vardir_trace
/log/mysqlimport.trace
";
}
$ENV
{'
MYSQL_IMPORT
'}
=
$cmdline_mysqlimport
;
# ----------------------------------------------------
# Setup env so childs can execute mysqlshow
# ----------------------------------------------------
my
$cmdline_mysqlshow
=
"
$exe_mysqlshow
-uroot
"
.
"
--port=
$master
->[0]->{'port'}
"
.
"
--socket=
$master
->[0]->{'path_sock'} --password=
";
if
(
$opt_debug
)
{
$cmdline_mysqlshow
.=
"
--debug=d:t:A,
$opt_vardir_trace
/log/mysqlshow.trace
";
}
$ENV
{'
MYSQL_SHOW
'}
=
$cmdline_mysqlshow
;
# ----------------------------------------------------
# Setup env so childs can execute mysqlbinlog
# ----------------------------------------------------
my
$cmdline_mysqlbinlog
=
"
$exe_mysqlbinlog
"
.
"
--no-defaults --local-load=
$opt_tmpdir
"
.
"
--character-sets-dir=
$path_charsetsdir
";
if
(
$opt_debug
)
{
$cmdline_mysqlbinlog
.=
"
--debug=d:t:A,
$opt_vardir_trace
/log/mysqlbinlog.trace
";
}
$ENV
{'
MYSQL_BINLOG
'}
=
$cmdline_mysqlbinlog
;
# ----------------------------------------------------
# Setup env so childs can execute mysql
# ----------------------------------------------------
my
$cmdline_mysql
=
"
$exe_mysql
--no-defaults --host=localhost --user=root --password=
"
.
"
--port=
$master
->[0]->{'port'}
"
.
"
--socket=
$master
->[0]->{'path_sock'}
";
$ENV
{'
MYSQL
'}
=
$cmdline_mysql
;
# ----------------------------------------------------
# Setup env so childs can execute mysql_client_test
# ----------------------------------------------------
my
$cmdline_mysql_client_test
=
"
$exe_mysql_client_test
--no-defaults --testcase --user=root --silent
"
.
"
--port=
$master
->[0]->{'port'}
"
.
"
--vardir=
$opt_vardir
"
.
"
--socket=
$master
->[0]->{'path_sock'}
";
if
(
$opt_debug
)
{
$cmdline_mysql_client_test
.=
"
--debug=d:t:A,
$opt_vardir_trace
/log/mysql_client_test.trace
";
}
if
(
$glob_use_embedded_server
)
{
$cmdline_mysql_client_test
.=
"
-A --language=
$path_language
"
.
"
-A --datadir=
$slave
->[0]->{'path_myddir'}
"
.
"
-A --character-sets-dir=
$path_charsetsdir
";
}
$ENV
{'
MYSQL_CLIENT_TEST
'}
=
$cmdline_mysql_client_test
;
# ----------------------------------------------------
# Setup env so childs can execute mysql_fix_system_tables
# ----------------------------------------------------
my
$cmdline_mysql_fix_system_tables
=
"
$exe_mysql_fix_system_tables
--no-defaults --host=localhost --user=root --password=
"
.
"
--basedir=
$glob_basedir
--bindir=
$path_client_bindir
--verbose
"
.
"
--port=
$master
->[0]->{'port'}
"
.
"
--socket=
$master
->[0]->{'path_sock'}
";
$ENV
{'
MYSQL_FIX_SYSTEM_TABLES
'}
=
$cmdline_mysql_fix_system_tables
;
# ----------------------------------------------------
# Setup env so childs can execute my_print_defaults
# ----------------------------------------------------
$ENV
{'
MYSQL_MY_PRINT_DEFAULTS
'}
=
$exe_my_print_defaults
;
# ----------------------------------------------------
# Setup env so childs can execute perror
# ----------------------------------------------------
$ENV
{'
MY_PERROR
'}
=
$exe_perror
;
# ----------------------------------------------------
# Add the path where mysqld will find udf_example.so
# ----------------------------------------------------
$ENV
{'
UDF_EXAMPLE_LIB
'}
=
(
$lib_udf_example
?
basename
(
$lib_udf_example
)
:
"");
$ENV
{'
LD_LIBRARY_PATH
'}
=
(
$lib_udf_example
?
dirname
(
$lib_udf_example
)
:
"")
.
(
$ENV
{'
LD_LIBRARY_PATH
'}
?
"
:
$ENV
{'LD_LIBRARY_PATH'}
"
:
"");
# ----------------------------------------------------
# We are nice and report a bit about our settings
# We are nice and report a bit about our settings
# ----------------------------------------------------
if
(
!
$opt_extern
)
if
(
!
$opt_extern
)
{
{
print
"
Using MTR_BUILD_THREAD =
$ENV
{MTR_BUILD_THREAD}
\n
";
print
"
Using MTR_BUILD_THREAD =
$ENV
{MTR_BUILD_THREAD}
\n
";
...
@@ -2296,15 +2484,19 @@ sub run_testcase ($) {
...
@@ -2296,15 +2484,19 @@ sub run_testcase ($) {
return
;
return
;
}
}
run_testcase_stop_servers
(
$tinfo
);
my
$master_restart
=
run_testcase_need_master_restart
(
$tinfo
);
my
$slave_restart
=
run_testcase_need_slave_restart
(
$tinfo
);
if
(
$master_restart
or
$slave_restart
)
{
run_testcase_stop_servers
(
$tinfo
,
$master_restart
,
$slave_restart
);
}
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# Prepare to start masters. Even if we use embedded, we want to run
# Prepare to start masters. Even if we use embedded, we want to run
# the preparation.
# the preparation.
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
$ENV
{'
TZ
'}
=
$tinfo
->
{'
timezone
'};
mtr_tofile
(
$master
->
[
0
]
->
{'
path_myerr
'},"
CURRENT_TEST:
$tname
\n
");
mtr_tofile
(
$master
->
[
0
]
->
{'
path_myerr
'},"
CURRENT_TEST:
$tname
\n
");
if
(
$master
->
[
1
]
->
{'
pid
'}
)
if
(
$master
->
[
1
]
->
{'
pid
'}
)
{
{
...
@@ -2315,12 +2507,15 @@ sub run_testcase ($) {
...
@@ -2315,12 +2507,15 @@ sub run_testcase ($) {
# If any mysqld servers running died, we have to know
# If any mysqld servers running died, we have to know
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
mtr_record_dead_children
();
m
y
$died
=
m
tr_record_dead_children
();
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# Start masters needed by the testcase
# Start masters needed by the testcase
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
run_testcase_start_servers
(
$tinfo
);
if
(
$died
or
$master_restart
or
$slave_restart
)
{
run_testcase_start_servers
(
$tinfo
);
}
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# If --start-and-exit or --start-dirty given, stop here to let user manually
# If --start-and-exit or --start-dirty given, stop here to let user manually
...
@@ -2337,8 +2532,6 @@ sub run_testcase ($) {
...
@@ -2337,8 +2532,6 @@ sub run_testcase ($) {
# Run the test case
# Run the test case
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
mtr_report_test_name
(
$tinfo
);
{
{
# remove the old reject file
# remove the old reject file
if
(
$opt_suite
eq
"
main
"
)
if
(
$opt_suite
eq
"
main
"
)
...
@@ -2352,6 +2545,7 @@ sub run_testcase ($) {
...
@@ -2352,6 +2545,7 @@ sub run_testcase ($) {
unlink
(
$path_timefile
);
unlink
(
$path_timefile
);
my
$res
=
run_mysqltest
(
$tinfo
);
my
$res
=
run_mysqltest
(
$tinfo
);
mtr_report_test_name
(
$tinfo
);
if
(
$res
==
0
)
if
(
$res
==
0
)
{
{
mtr_report_test_passed
(
$tinfo
);
mtr_report_test_passed
(
$tinfo
);
...
@@ -3004,24 +3198,9 @@ sub stop_all_servers () {
...
@@ -3004,24 +3198,9 @@ sub stop_all_servers () {
}
}
# ----------------------------------------------------------------------
sub
run_testcase_need_master_restart
($)
# If not using a running servers we may need to stop and restart.
{
# We restart in the case we have initiation scripts, server options
my
(
$tinfo
)
=
@_
;
# etc to run. But we also restart again after the test first restart
# and test is run, to get back to normal server settings.
#
# To make the code a bit more clean, we actually only stop servers
# here, and mark this to be done. Then a generic "start" part will
# start up the needed servers again.
# ----------------------------------------------------------------------
sub
run_testcase_stop_servers
($)
{
my
$tinfo
=
shift
;
if
(
$glob_use_running_server
||
$glob_use_embedded_server
)
{
return
;
}
# We try to find out if we are to restart the master(s)
# We try to find out if we are to restart the master(s)
my
$do_restart
=
0
;
# Assumes we don't have to
my
$do_restart
=
0
;
# Assumes we don't have to
...
@@ -3078,6 +3257,91 @@ sub run_testcase_stop_servers($) {
...
@@ -3078,6 +3257,91 @@ sub run_testcase_stop_servers($) {
join
("
",
@
{
$master
->
[
0
]
->
{'
start_opts
'}})
.
"
'
"
);
join
("
",
@
{
$master
->
[
0
]
->
{'
start_opts
'}})
.
"
'
"
);
}
}
return
$do_restart
;
}
sub
run_testcase_need_slave_restart
($)
{
my
(
$tinfo
)
=
@_
;
# We try to find out if we are to restart the slaves
my
$do_slave_restart
=
0
;
# Assumes we don't have to
# FIXME only restart slave when necessary
$do_slave_restart
=
1
;
# if ( ! $slave->[0]->{'pid'} )
# {
# # mtr_verbose("Slave not started, no need to check slave restart");
# }
# elsif ( $do_restart )
# {
# $do_slave_restart= 1; # Always restart if master restart
# mtr_verbose("Restart slave because: Master restart");
# }
# elsif ( $tinfo->{'slave_sh'} )
# {
# $do_slave_restart= 1; # Always restart if script to run
# mtr_verbose("Restart slave because: Always restart if script to run");
# }
# elsif ( ! $opt_skip_ndbcluster_slave and
# $tinfo->{'ndb_test'} == 0 and
# $clusters->[1]->{'pid'} != 0 )
# {
# $do_slave_restart= 1; # Restart without slave cluster
# mtr_verbose("Restart slave because: Test does not need slave cluster");
# }
# elsif ( ! $opt_with_ndbcluster_slave and
# $tinfo->{'ndb_test'} == 1 and
# $clusters->[1]->{'pid'} == 0 )
# {
# $do_slave_restart= 1; # Restart with slave cluster
# mtr_verbose("Restart slave because: Test need slave cluster");
# }
# elsif ( $tinfo->{'slave_restart'} )
# {
# $do_slave_restart= 1;
# mtr_verbose("Restart slave because: slave_restart");
# }
# elsif ( $slave->[0]->{'running_slave_is_special'} )
# {
# $do_slave_restart= 1;
# mtr_verbose("Restart slave because: running_slave_is_special");
# }
# # Check that running slave was started with same options
# # as the current test requires
# elsif (! mtr_same_opts($slave->[0]->{'start_opts'},
# $tinfo->{'slave_opt'}) )
# {
# $do_slave_restart= 1;
# mtr_verbose("Restart slave because: running with different options '" .
# join(" ", @{$tinfo->{'slave_opt'}}) . "' != '" .
# join(" ", @{$slave->[0]->{'start_opts'}}) . "'" );
# }
return
$do_slave_restart
;
}
# ----------------------------------------------------------------------
# If not using a running servers we may need to stop and restart.
# We restart in the case we have initiation scripts, server options
# etc to run. But we also restart again after the test first restart
# and test is run, to get back to normal server settings.
#
# To make the code a bit more clean, we actually only stop servers
# here, and mark this to be done. Then a generic "start" part will
# start up the needed servers again.
# ----------------------------------------------------------------------
sub
run_testcase_stop_servers
($$$)
{
my
(
$tinfo
,
$do_restart
,
$do_slave_restart
)
=
@_
;
if
(
$glob_use_running_server
||
$glob_use_embedded_server
)
{
return
;
}
my
$pid
;
my
$pid
;
my
%
admin_pids
;
# hash of admin processes that requests shutdown
my
%
admin_pids
;
# hash of admin processes that requests shutdown
my
@kill_pids
;
# list of processes to shutdown/kill
my
@kill_pids
;
# list of processes to shutdown/kill
...
@@ -3135,62 +3399,7 @@ sub run_testcase_stop_servers($) {
...
@@ -3135,62 +3399,7 @@ sub run_testcase_stop_servers($) {
}
}
}
}
# We try to find out if we are to restart the slaves
if
(
$do_restart
||
$do_slave_restart
)
my
$do_slave_restart
=
0
;
# Assumes we don't have to
# FIXME only restaret when necessary
$do_slave_restart
=
1
;
# if ( ! $slave->[0]->{'pid'} )
# {
# # mtr_verbose("Slave not started, no need to check slave restart");
# }
# elsif ( $do_restart )
# {
# $do_slave_restart= 1; # Always restart if master restart
# mtr_verbose("Restart slave because: Master restart");
# }
# elsif ( $tinfo->{'slave_sh'} )
# {
# $do_slave_restart= 1; # Always restart if script to run
# mtr_verbose("Restart slave because: Always restart if script to run");
# }
# elsif ( ! $opt_skip_ndbcluster_slave and
# $tinfo->{'ndb_test'} == 0 and
# $clusters->[1]->{'pid'} != 0 )
# {
# $do_slave_restart= 1; # Restart without slave cluster
# mtr_verbose("Restart slave because: Test does not need slave cluster");
# }
# elsif ( ! $opt_with_ndbcluster_slave and
# $tinfo->{'ndb_test'} == 1 and
# $clusters->[1]->{'pid'} == 0 )
# {
# $do_slave_restart= 1; # Restart with slave cluster
# mtr_verbose("Restart slave because: Test need slave cluster");
# }
# elsif ( $tinfo->{'slave_restart'} )
# {
# $do_slave_restart= 1;
# mtr_verbose("Restart slave because: slave_restart");
# }
# elsif ( $slave->[0]->{'running_slave_is_special'} )
# {
# $do_slave_restart= 1;
# mtr_verbose("Restart slave because: running_slave_is_special");
# }
# # Check that running slave was started with same options
# # as the current test requires
# elsif (! mtr_same_opts($slave->[0]->{'start_opts'},
# $tinfo->{'slave_opt'}) )
# {
# $do_slave_restart= 1;
# mtr_verbose("Restart slave because: running with different options '" .
# join(" ", @{$tinfo->{'slave_opt'}}) . "' != '" .
# join(" ", @{$slave->[0]->{'start_opts'}}) . "'" );
# }
if
(
$do_slave_restart
)
{
{
delete
$slave
->
[
0
]
->
{'
running_slave_is_special
'};
# Forget history
delete
$slave
->
[
0
]
->
{'
running_slave_is_special
'};
# Forget history
...
@@ -3674,136 +3883,9 @@ sub run_check_testcase ($$) {
...
@@ -3674,136 +3883,9 @@ sub run_check_testcase ($$) {
}
}
sub
generate_cmdline_mysqldump
($)
{
my
(
$info
)
=
@_
;
return
"
$exe_mysqldump
--no-defaults -uroot
"
.
"
--port=
$info
->[0]->{'port'}
"
.
"
--socket=
$info
->[0]->{'path_sock'} --password=
";
}
sub
run_mysqltest
($)
{
sub
run_mysqltest
($)
{
my
$tinfo
=
shift
;
my
(
$tinfo
)
=
@_
;
my
$cmdline_mysqlcheck
=
"
$exe_mysqlcheck
--no-defaults -uroot
"
.
"
--port=
$master
->[0]->{'port'}
"
.
"
--socket=
$master
->[0]->{'path_sock'} --password=
";
if
(
$opt_debug
)
{
$cmdline_mysqlcheck
.=
"
--debug=d:t:A,
$opt_vardir_trace
/log/mysqlcheck.trace
";
}
my
$cmdline_mysqldump
=
generate_cmdline_mysqldump
$master
;
my
$cmdline_mysqldumpslave
=
generate_cmdline_mysqldump
$slave
;
if
(
$opt_debug
)
{
$cmdline_mysqldump
.=
"
--debug=d:t:A,
$opt_vardir_trace
/log/mysqldump-master.trace
";
$cmdline_mysqldumpslave
.=
"
--debug=d:t:A,
$opt_vardir_trace
/log/mysqldump-slave.trace
";
}
my
$cmdline_mysqlslap
;
unless
(
$glob_win32
)
{
$cmdline_mysqlslap
=
"
$exe_mysqlslap
-uroot
"
.
"
--port=
$master
->[0]->{'port'}
"
.
"
--socket=
$master
->[0]->{'path_sock'} --password=
"
.
"
--lock-directory=
$opt_tmpdir
";
if
(
$opt_debug
)
{
$cmdline_mysqlslap
.=
"
--debug=d:t:A,
$opt_vardir_trace
/log/mysqlslap.trace
";
}
}
my
$cmdline_mysqlimport
=
"
$exe_mysqlimport
-uroot
"
.
"
--port=
$master
->[0]->{'port'}
"
.
"
--socket=
$master
->[0]->{'path_sock'} --password=
";
if
(
$opt_debug
)
{
$cmdline_mysqlimport
.=
"
--debug=d:t:A,
$opt_vardir_trace
/log/mysqlimport.trace
";
}
my
$cmdline_mysqlshow
=
"
$exe_mysqlshow
-uroot
"
.
"
--port=
$master
->[0]->{'port'}
"
.
"
--socket=
$master
->[0]->{'path_sock'} --password=
";
if
(
$opt_debug
)
{
$cmdline_mysqlshow
.=
"
--debug=d:t:A,
$opt_vardir_trace
/log/mysqlshow.trace
";
}
my
$cmdline_mysqlbinlog
=
"
$exe_mysqlbinlog
"
.
"
--no-defaults --local-load=
$opt_tmpdir
"
.
"
--character-sets-dir=
$path_charsetsdir
";
if
(
$opt_debug
)
{
$cmdline_mysqlbinlog
.=
"
--debug=d:t:A,
$opt_vardir_trace
/log/mysqlbinlog.trace
";
}
my
$cmdline_mysql
=
"
$exe_mysql
--no-defaults --host=localhost --user=root --password=
"
.
"
--port=
$master
->[0]->{'port'}
"
.
"
--socket=
$master
->[0]->{'path_sock'}
";
my
$cmdline_mysql_client_test
=
"
$exe_mysql_client_test
--no-defaults --testcase --user=root --silent
"
.
"
--port=
$master
->[0]->{'port'}
"
.
"
--vardir=
$opt_vardir
"
.
"
--socket=
$master
->[0]->{'path_sock'}
";
if
(
$opt_debug
)
{
$cmdline_mysql_client_test
.=
"
--debug=d:t:A,
$opt_vardir_trace
/log/mysql_client_test.trace
";
}
if
(
$glob_use_embedded_server
)
{
$cmdline_mysql_client_test
.=
"
-A --language=
$path_language
"
.
"
-A --datadir=
$slave
->[0]->{'path_myddir'}
"
.
"
-A --character-sets-dir=
$path_charsetsdir
";
}
my
$cmdline_mysql_fix_system_tables
=
"
$exe_mysql_fix_system_tables
--no-defaults --host=localhost --user=root --password=
"
.
"
--basedir=
$glob_basedir
--bindir=
$path_client_bindir
--verbose
"
.
"
--port=
$master
->[0]->{'port'}
"
.
"
--socket=
$master
->[0]->{'path_sock'}
";
$ENV
{'
MYSQL
'}
=
$cmdline_mysql
;
$ENV
{'
MYSQL_CHECK
'}
=
$cmdline_mysqlcheck
;
$ENV
{'
MYSQL_DUMP
'}
=
$cmdline_mysqldump
;
$ENV
{'
MYSQL_SLAP
'}
=
$cmdline_mysqlslap
unless
$glob_win32
;
$ENV
{'
MYSQL_IMPORT
'}
=
$cmdline_mysqlimport
;
$ENV
{'
MYSQL_DUMP_SLAVE
'}
=
$cmdline_mysqldumpslave
;
$ENV
{'
MYSQL_SHOW
'}
=
$cmdline_mysqlshow
;
$ENV
{'
MYSQL_BINLOG
'}
=
$cmdline_mysqlbinlog
;
$ENV
{'
MYSQL_FIX_SYSTEM_TABLES
'}
=
$cmdline_mysql_fix_system_tables
;
$ENV
{'
MYSQL_CLIENT_TEST
'}
=
$cmdline_mysql_client_test
;
$ENV
{'
CHARSETSDIR
'}
=
$path_charsetsdir
;
$ENV
{'
MYSQL_MY_PRINT_DEFAULTS
'}
=
$exe_my_print_defaults
;
$ENV
{'
UDF_EXAMPLE_LIB
'}
=
(
$lib_udf_example
?
basename
(
$lib_udf_example
)
:
"");
$ENV
{'
MY_PERROR
'}
=
$exe_perror
;
$ENV
{'
NDB_STATUS_OK
'}
=
$clusters
->
[
0
]
->
{'
installed_ok
'};
$ENV
{'
NDB_SLAVE_STATUS_OK
'}
=
$clusters
->
[
0
]
->
{'
installed_ok
'};;
$ENV
{'
NDB_EXTRA_TEST
'}
=
$opt_ndb_extra_test
;
$ENV
{'
NDB_MGM
'}
=
$exe_ndb_mgm
;
$ENV
{'
NDB_BACKUP_DIR
'}
=
$clusters
->
[
0
]
->
{'
data_dir
'};
$ENV
{'
NDB_DATA_DIR
'}
=
$clusters
->
[
0
]
->
{'
data_dir
'};
$ENV
{'
NDB_TOOLS_DIR
'}
=
$path_ndb_tools_dir
;
$ENV
{'
NDB_TOOLS_OUTPUT
'}
=
$file_ndb_testrun_log
;
$ENV
{'
NDB_CONNECTSTRING
'}
=
$opt_ndbconnectstring
;
my
$exe
=
$exe_mysqltest
;
my
$exe
=
$exe_mysqltest
;
my
$args
;
my
$args
;
...
@@ -3882,7 +3964,8 @@ sub run_mysqltest ($) {
...
@@ -3882,7 +3964,8 @@ sub run_mysqltest ($) {
if
(
$opt_debug
)
if
(
$opt_debug
)
{
{
mtr_add_arg
(
$args
,
"
--debug=d:t:A,%s/log/mysqltest.trace
",
$opt_vardir_trace
);
mtr_add_arg
(
$args
,
"
--debug=d:t:A,%s/log/mysqltest.trace
",
$opt_vardir_trace
);
}
}
if
(
$opt_ssl_supported
)
if
(
$opt_ssl_supported
)
...
@@ -3895,9 +3978,9 @@ sub run_mysqltest ($) {
...
@@ -3895,9 +3978,9 @@ sub run_mysqltest ($) {
$glob_mysql_test_dir
);
$glob_mysql_test_dir
);
}
}
# Turn on SSL for all test cases
if
(
$opt_ssl
)
if
(
$opt_ssl
)
{
{
# Turn on SSL for _all_ test cases if option --ssl was used
mtr_add_arg
(
$args
,
"
--ssl
",
mtr_add_arg
(
$args
,
"
--ssl
",
$glob_mysql_test_dir
);
$glob_mysql_test_dir
);
}
}
...
@@ -3979,6 +4062,11 @@ sub run_mysqltest ($) {
...
@@ -3979,6 +4062,11 @@ sub run_mysqltest ($) {
}
}
}
}
# -------------------------------------------------------
# Init variables that change for each testcase
# -------------------------------------------------------
$ENV
{'
TZ
'}
=
$tinfo
->
{'
timezone
'};
my
$res
=
mtr_run_test
(
$exe
,
$args
,"","",
$path_timefile
,"");
my
$res
=
mtr_run_test
(
$exe
,
$args
,"","",
$path_timefile
,"");
if
(
$opt_check_testcases
)
if
(
$opt_check_testcases
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment