Commit 72345f2b authored by unknown's avatar unknown

Better error messages for mysql-test-run

Added option --host to mysqlhotcopy


mysql-test/mysql-test-run.sh:
  Added error message if the server doesn't start.
  Increase connect timeout a bit (for running under purify).
mysql-test/t/rpl000001.test:
  Longer sleep time (for running under purify)
scripts/mysqlhotcopy.sh:
  Added option --host for usage with TCP/IP connections
sql/gen_lex_hash.cc:
  Fixed typo
parent 4c1712e4
...@@ -344,7 +344,11 @@ SLAVE_MYSQLD=$MYSQLD #this can be changed later if we are doing gcov ...@@ -344,7 +344,11 @@ SLAVE_MYSQLD=$MYSQLD #this can be changed later if we are doing gcov
#-- #--
wait_for_server_start () wait_for_server_start ()
{ {
$MYSQLADMIN --no-defaults -u $DBUSER --silent -O connect_timeout=10 -w2 --host=$hostname --port=$1 ping >/dev/null 2>&1 $MYSQLADMIN --no-defaults -u $DBUSER --silent -O connect_timeout=10 -w3 --host=$hostname --port=$1 ping >/dev/null 2>&1
exit_code=$?
if [ $exit_code != 0 ]; then
echo "Error: Could not start $2, exit code $exit_code";
fi
} }
prompt_user () prompt_user ()
...@@ -553,7 +557,7 @@ start_master() ...@@ -553,7 +557,7 @@ start_master()
else else
$MYSQLD $master_args >> $MASTER_MYERR 2>&1 & $MYSQLD $master_args >> $MASTER_MYERR 2>&1 &
fi fi
wait_for_server_start $MASTER_MYPORT wait_for_server_start $MASTER_MYPORT master
MASTER_RUNNING=1 MASTER_RUNNING=1
} }
...@@ -610,7 +614,7 @@ start_slave() ...@@ -610,7 +614,7 @@ start_slave()
else else
$SLAVE_MYSQLD $slave_args >> $SLAVE_MYERR 2>&1 & $SLAVE_MYSQLD $slave_args >> $SLAVE_MYERR 2>&1 &
fi fi
wait_for_server_start $SLAVE_MYPORT wait_for_server_start $SLAVE_MYPORT slave
SLAVE_RUNNING=1 SLAVE_RUNNING=1
} }
......
...@@ -57,7 +57,7 @@ reap; ...@@ -57,7 +57,7 @@ reap;
connection slave; connection slave;
sync_with_master ; sync_with_master ;
#give the slave a chance to exit #give the slave a chance to exit
sleep 0.5; sleep 2;
# The following test can't be done because the result of Pos will differ # The following test can't be done because the result of Pos will differ
# on different computers # on different computers
......
...@@ -50,7 +50,8 @@ Usage: $0 db_name[./table_regex/] [new_db_name | directory] ...@@ -50,7 +50,8 @@ Usage: $0 db_name[./table_regex/] [new_db_name | directory]
-?, --help display this helpscreen and exit -?, --help display this helpscreen and exit
-u, --user=# user for database login if not current user -u, --user=# user for database login if not current user
-p, --password=# password to use when connecting to server -p, --password=# password to use when connecting to server
-P, --port=# port to use when connecting to local server -h, --host=# Hostname for local server when connecting over TCP/IP
-P, --port=# port to use when connecting to local server with TCP/IP
-S, --socket=# socket to use when connecting to local server -S, --socket=# socket to use when connecting to local server
--allowold don\'t abort if target already exists (rename it _old) --allowold don\'t abort if target already exists (rename it _old)
...@@ -155,8 +156,8 @@ $opt{quiet} = 0 if $opt{debug}; ...@@ -155,8 +156,8 @@ $opt{quiet} = 0 if $opt{debug};
$opt{allowold} = 1 if $opt{keepold}; $opt{allowold} = 1 if $opt{keepold};
# --- connect to the database --- # --- connect to the database ---
my $dsn = ";host=localhost"; my $dsn;
$dsn = ";host=127.0.0.1" if $opt{port}; # use TCP/IP if port was given $dsn = ";host=" . (defined($opt{host}) ? $opt{host} : "localhost");
$dsn .= ";port=$opt{port}" if $opt{port}; $dsn .= ";port=$opt{port}" if $opt{port};
$dsn .= ";mysql_socket=$opt{socket}" if $opt{socket}; $dsn .= ";mysql_socket=$opt{socket}" if $opt{socket};
...@@ -891,9 +892,15 @@ user for database login if not current user ...@@ -891,9 +892,15 @@ user for database login if not current user
password to use when connecting to server password to use when connecting to server
=item -h, -h, --host=#
Hostname for local server when connecting over TCP/IP. By specifying this
different from 'localhost' will trigger mysqlhotcopy to use TCP/IP connection.
=item -P, --port=# =item -P, --port=#
port to use when connecting to local server port to use when connecting to MySQL server with TCP/IP. This is only used
when using the --host option.
=item -S, --socket=# =item -S, --socket=#
......
...@@ -26,7 +26,8 @@ ...@@ -26,7 +26,8 @@
#include "mysql_version.h" #include "mysql_version.h"
#include "lex.h" #include "lex.h"
bool opt_search=0,opt_verbose=0; bool opt_search=0;
uint opt_verbose=0;
ulong opt_count=100000; ulong opt_count=100000;
#define max_allowed_array 8000 // Don't generate bigger arrays than this #define max_allowed_array 8000 // Don't generate bigger arrays than this
...@@ -526,8 +527,7 @@ int main(int argc,char **argv) ...@@ -526,8 +527,7 @@ int main(int argc,char **argv)
best_functype); best_functype);
} }
if (opt_verbose && (i % 20000) == 0) if (opt_verbose && (i % 20000) == 0)
printf("\nstart_value=%ldL; best_t1=%ldL; best_t2=%ldL; best_type=%d; printf("\nstart_value=%ldL; best_t1=%ldL; best_t2=%ldL; best_type=%d; /* mode=%d add=%d type: %d */\n",
/* mode=%d add=%d type: %d */\n",
best_start_value,best_t1,best_t2,best_type,best_mod,best_add, best_start_value,best_t1,best_t2,best_type,best_mod,best_add,
best_functype); best_functype);
} }
......
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