Commit 450eab19 authored by unknown's avatar unknown

Merge shellback.(none):/home/msvensson/mysql/mysql-5.0-maint

into  shellback.(none):/home/msvensson/mysql/mysql-5.1-maint


client/mysqltest.c:
  Auto merged
mysql-test/lib/mtr_process.pl:
  Auto merged
sql-common/client.c:
  Auto merged
mysql-test/mysql-test-run.pl:
  Use remote
parents 1f816053 4d45abc5
...@@ -668,9 +668,11 @@ void close_files() ...@@ -668,9 +668,11 @@ void close_files()
DBUG_ENTER("close_files"); DBUG_ENTER("close_files");
for (; cur_file >= file_stack; cur_file--) for (; cur_file >= file_stack; cur_file--)
{ {
DBUG_PRINT("info", ("file_name: %s", cur_file->file_name));
if (cur_file->file && cur_file->file != stdin) if (cur_file->file && cur_file->file != stdin)
{
DBUG_PRINT("info", ("closing file: %s", cur_file->file_name));
my_fclose(cur_file->file, MYF(0)); my_fclose(cur_file->file, MYF(0));
}
my_free((gptr)cur_file->file_name, MYF(MY_ALLOW_ZERO_PTR)); my_free((gptr)cur_file->file_name, MYF(MY_ALLOW_ZERO_PTR));
cur_file->file_name= 0; cur_file->file_name= 0;
} }
...@@ -950,8 +952,8 @@ int dyn_string_cmp(DYNAMIC_STRING* ds, const char *fname) ...@@ -950,8 +952,8 @@ int dyn_string_cmp(DYNAMIC_STRING* ds, const char *fname)
void check_result(DYNAMIC_STRING* ds) void check_result(DYNAMIC_STRING* ds)
{ {
DBUG_ASSERT(result_file_name);
DBUG_ENTER("check_result"); DBUG_ENTER("check_result");
DBUG_ASSERT(result_file_name);
switch (dyn_string_cmp(ds, result_file_name)) switch (dyn_string_cmp(ds, result_file_name))
{ {
...@@ -1433,7 +1435,7 @@ void do_source(struct st_command *command) ...@@ -1433,7 +1435,7 @@ void do_source(struct st_command *command)
#ifdef __WIN__ #ifdef __WIN__
/* Variables used for temuprary sh files used for emulating Unix on Windows */ /* Variables used for temporary sh files used for emulating Unix on Windows */
char tmp_sh_name[64], tmp_sh_cmd[70]; char tmp_sh_name[64], tmp_sh_cmd[70];
void init_tmp_sh_file() void init_tmp_sh_file()
...@@ -2707,12 +2709,15 @@ char *get_string(char **to_ptr, char **from_ptr, ...@@ -2707,12 +2709,15 @@ char *get_string(char **to_ptr, char **from_ptr,
void set_reconnect(MYSQL* mysql, int val) void set_reconnect(MYSQL* mysql, int val)
{ {
DBUG_ENTER("set_reconnect");
DBUG_PRINT("info", ("val: %d", val));
#if MYSQL_VERSION_ID < 50000 #if MYSQL_VERSION_ID < 50000
mysql->reconnect= val; mysql->reconnect= val;
#else #else
int reconnect= val; my_bool reconnect= val;
mysql_options(mysql, MYSQL_OPT_RECONNECT, (char *)&reconnect); mysql_options(mysql, MYSQL_OPT_RECONNECT, (char *)&reconnect);
#endif #endif
DBUG_VOID_RETURN;
} }
......
...@@ -339,19 +339,6 @@ sub mtr_kill_leftovers () { ...@@ -339,19 +339,6 @@ sub mtr_kill_leftovers () {
mtr_report("Killing Possible Leftover Processes"); mtr_report("Killing Possible Leftover Processes");
mtr_debug("mtr_kill_leftovers(): started."); mtr_debug("mtr_kill_leftovers(): started.");
mkpath("$::opt_vardir/log"); # Needed for mysqladmin log
# Stop or kill Instance Manager and all its children. If we failed to do
# that, we can only abort -- there is nothing left to do.
# mtr_error("Failed to stop Instance Manager.")
# unless mtr_im_stop($::instance_manager);
# Start shutdown of masters and slaves. Don't touch IM-managed mysqld
# instances -- they should be stopped by mtr_im_stop().
mtr_debug("Shutting down mysqld-instances...");
my @kill_pids; my @kill_pids;
my %admin_pids; my %admin_pids;
......
...@@ -310,7 +310,7 @@ sub command_line_setup (); ...@@ -310,7 +310,7 @@ sub command_line_setup ();
sub datadir_setup (); sub datadir_setup ();
sub executable_setup (); sub executable_setup ();
sub environment_setup (); sub environment_setup ();
sub kill_running_server (); sub kill_running_servers ();
sub cleanup_stale_files (); sub cleanup_stale_files ();
sub check_ssl_support ($); sub check_ssl_support ($);
sub check_running_as_root(); sub check_running_as_root();
...@@ -1418,7 +1418,7 @@ sub executable_setup () { ...@@ -1418,7 +1418,7 @@ sub executable_setup () {
{ {
$exe_mysql_client_test= $exe_mysql_client_test=
mtr_exe_exists("$glob_basedir/libmysqld/examples/mysql_client_test_embedded", mtr_exe_exists("$glob_basedir/libmysqld/examples/mysql_client_test_embedded",
"$glob_basedir/tests/mysqltest_embedded"); "$path_client_bindir/mysql_client_test_embedded");
} }
else else
{ {
...@@ -1802,7 +1802,7 @@ sub handle_int_signal () { ...@@ -1802,7 +1802,7 @@ sub handle_int_signal () {
# #
############################################################################## ##############################################################################
sub kill_running_server () { sub kill_running_servers () {
if ( $opt_fast or $glob_use_embedded_server ) if ( $opt_fast or $glob_use_embedded_server )
{ {
...@@ -1820,6 +1820,13 @@ sub kill_running_server () { ...@@ -1820,6 +1820,13 @@ sub kill_running_server () {
# started from this run of the script, this is terminating # started from this run of the script, this is terminating
# leftovers from previous runs. # leftovers from previous runs.
if ( ! -d $opt_vardir )
{
# The "var" dir does not exist already
# the processes that mtr_kill_leftovers start will write
# their log files to var/log so it should be created
mkpath("$opt_vardir/log");
}
mtr_kill_leftovers(); mtr_kill_leftovers();
} }
} }
...@@ -2416,9 +2423,9 @@ sub initialize_servers () { ...@@ -2416,9 +2423,9 @@ sub initialize_servers () {
if ( ! $glob_use_running_server ) if ( ! $glob_use_running_server )
{ {
kill_running_server(); kill_running_servers();
unless ( $opt_start_dirty ) if ( ! $opt_start_dirty )
{ {
cleanup_stale_files(); cleanup_stale_files();
mysql_install_db(); mysql_install_db();
...@@ -3107,7 +3114,7 @@ sub mysqld_arguments ($$$$$) { ...@@ -3107,7 +3114,7 @@ sub mysqld_arguments ($$$$$) {
$prefix= "--server-arg="; $prefix= "--server-arg=";
} else { } else {
# We can't pass embedded server --no-defaults # We can't pass embedded server --no-defaults
mtr_add_arg($args, "%s--no-defaults", $prefix); mtr_add_arg($args, "--no-defaults");
} }
mtr_add_arg($args, "%s--console", $prefix); mtr_add_arg($args, "%s--console", $prefix);
...@@ -3529,7 +3536,12 @@ sub run_testcase_need_master_restart($) ...@@ -3529,7 +3536,12 @@ sub run_testcase_need_master_restart($)
# 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
if ( $tinfo->{'master_sh'} ) if ( $glob_use_embedded_server )
{
mtr_verbose("Never start or restart for embedded server");
return $do_restart;
}
elsif ( $tinfo->{'master_sh'} )
{ {
$do_restart= 1; # Always restart if script to run $do_restart= 1; # Always restart if script to run
mtr_verbose("Restart master: Always restart if script to run"); mtr_verbose("Restart master: Always restart if script to run");
...@@ -3591,7 +3603,12 @@ sub run_testcase_need_slave_restart($) ...@@ -3591,7 +3603,12 @@ sub run_testcase_need_slave_restart($)
# We try to find out if we are to restart the slaves # We try to find out if we are to restart the slaves
my $do_slave_restart= 0; # Assumes we don't have to my $do_slave_restart= 0; # Assumes we don't have to
if ( $max_slave_num == 0) if ( $glob_use_embedded_server )
{
mtr_verbose("Never start or restart for embedded server");
return $do_slave_restart;
}
elsif ( $max_slave_num == 0)
{ {
mtr_verbose("Skip slave restart: No testcase use slaves"); mtr_verbose("Skip slave restart: No testcase use slaves");
} }
...@@ -3772,7 +3789,7 @@ sub run_testcase_stop_servers($$$) { ...@@ -3772,7 +3789,7 @@ sub run_testcase_stop_servers($$$) {
# #
# run_testcase_start_servers # run_testcase_start_servers
# #
# Start the servers neede by this test case # Start the servers needed by this test case
# #
# RETURN # RETURN
# 0 OK # 0 OK
......
...@@ -2364,6 +2364,8 @@ my_bool mysql_reconnect(MYSQL *mysql) ...@@ -2364,6 +2364,8 @@ my_bool mysql_reconnect(MYSQL *mysql)
{ {
MYSQL tmp_mysql; MYSQL tmp_mysql;
DBUG_ENTER("mysql_reconnect"); DBUG_ENTER("mysql_reconnect");
DBUG_ASSERT(mysql);
DBUG_PRINT("enter", ("mysql->reconnect: %d", mysql->reconnect));
if (!mysql->reconnect || if (!mysql->reconnect ||
(mysql->server_status & SERVER_STATUS_IN_TRANS) || !mysql->host_info) (mysql->server_status & SERVER_STATUS_IN_TRANS) || !mysql->host_info)
......
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