From 72345f2b474310bc72af7fb4e3b25c7051dfd6cd Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 6 Aug 2002 16:12:52 +0300 Subject: [PATCH] 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 --- mysql-test/mysql-test-run.sh | 10 +++++++--- mysql-test/t/rpl000001.test | 2 +- scripts/mysqlhotcopy.sh | 15 +++++++++++---- sql/gen_lex_hash.cc | 6 +++--- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 4898d9c5464..566702a7330 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -344,7 +344,11 @@ SLAVE_MYSQLD=$MYSQLD #this can be changed later if we are doing gcov #-- 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 () @@ -553,7 +557,7 @@ start_master() else $MYSQLD $master_args >> $MASTER_MYERR 2>&1 & fi - wait_for_server_start $MASTER_MYPORT + wait_for_server_start $MASTER_MYPORT master MASTER_RUNNING=1 } @@ -610,7 +614,7 @@ start_slave() else $SLAVE_MYSQLD $slave_args >> $SLAVE_MYERR 2>&1 & fi - wait_for_server_start $SLAVE_MYPORT + wait_for_server_start $SLAVE_MYPORT slave SLAVE_RUNNING=1 } diff --git a/mysql-test/t/rpl000001.test b/mysql-test/t/rpl000001.test index 113a9637dac..6a827368fa4 100644 --- a/mysql-test/t/rpl000001.test +++ b/mysql-test/t/rpl000001.test @@ -57,7 +57,7 @@ reap; connection slave; sync_with_master ; #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 # on different computers diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 707b4fc481c..1aad5c95c25 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -50,7 +50,8 @@ Usage: $0 db_name[./table_regex/] [new_db_name | directory] -?, --help display this helpscreen and exit -u, --user=# user for database login if not current user -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 --allowold don\'t abort if target already exists (rename it _old) @@ -155,8 +156,8 @@ $opt{quiet} = 0 if $opt{debug}; $opt{allowold} = 1 if $opt{keepold}; # --- connect to the database --- -my $dsn = ";host=localhost"; -$dsn = ";host=127.0.0.1" if $opt{port}; # use TCP/IP if port was given +my $dsn; +$dsn = ";host=" . (defined($opt{host}) ? $opt{host} : "localhost"); $dsn .= ";port=$opt{port}" if $opt{port}; $dsn .= ";mysql_socket=$opt{socket}" if $opt{socket}; @@ -891,9 +892,15 @@ user for database login if not current user 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=# -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=# diff --git a/sql/gen_lex_hash.cc b/sql/gen_lex_hash.cc index 22e40ff2830..f94d8dddb59 100644 --- a/sql/gen_lex_hash.cc +++ b/sql/gen_lex_hash.cc @@ -26,7 +26,8 @@ #include "mysql_version.h" #include "lex.h" -bool opt_search=0,opt_verbose=0; +bool opt_search=0; +uint opt_verbose=0; ulong opt_count=100000; #define max_allowed_array 8000 // Don't generate bigger arrays than this @@ -526,8 +527,7 @@ int main(int argc,char **argv) best_functype); } if (opt_verbose && (i % 20000) == 0) - printf("\nstart_value=%ldL; best_t1=%ldL; best_t2=%ldL; best_type=%d; -/* mode=%d add=%d type: %d */\n", + printf("\nstart_value=%ldL; best_t1=%ldL; best_t2=%ldL; best_type=%d; /* mode=%d add=%d type: %d */\n", best_start_value,best_t1,best_t2,best_type,best_mod,best_add, best_functype); }