From c98a6dc8af717444330dc18e14e029b189144861 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Nov 2006 22:45:52 +0100 Subject: [PATCH 1/5] Don't run mysqltest with both --silent and --verbose --- mysql-test/mysql-test-run.pl | 3 --- 1 file changed, 3 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 465d058f97a..3bcb735890c 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2974,7 +2974,6 @@ sub analyze_testcase_failure_sync_with_master($) mtr_add_arg($args, "--no-defaults"); mtr_add_arg($args, "--silent"); - mtr_add_arg($args, "-v"); mtr_add_arg($args, "--skip-safemalloc"); mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir); @@ -4160,7 +4159,6 @@ sub run_check_testcase ($$) { mtr_add_arg($args, "--no-defaults"); mtr_add_arg($args, "--silent"); - mtr_add_arg($args, "-v"); mtr_add_arg($args, "--skip-safemalloc"); mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir); @@ -4206,7 +4204,6 @@ sub run_mysqltest ($) { mtr_add_arg($args, "--no-defaults"); mtr_add_arg($args, "--silent"); - mtr_add_arg($args, "-v"); mtr_add_arg($args, "--skip-safemalloc"); mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir); From 427f1acaaaeb8967462ae712dc6623f0310e34a4 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Nov 2006 22:53:40 +0100 Subject: [PATCH 2/5] Pass location of charsets dir to mysqltest to avoid using the charsetdir locally installed on machine. client/mysqltest.c: Add new option --character-sets-dir to mysqltest Set MYSQL_SET_CHRSET_DIR before connecting to mysqld if the above variable is set mysql-test/mysql-test-run.pl: Pass $path_charsetsdir to mysqltest --- client/mysqltest.c | 20 +++++++++++++++----- mysql-test/mysql-test-run.pl | 3 +++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 7c1ce19283f..9ad2f3df5de 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -80,13 +80,13 @@ enum { OPT_SSL_CA, OPT_SSL_CAPATH, OPT_SSL_CIPHER, OPT_PS_PROTOCOL, OPT_SP_PROTOCOL, OPT_CURSOR_PROTOCOL, OPT_VIEW_PROTOCOL, OPT_SSL_VERIFY_SERVER_CERT, OPT_MAX_CONNECT_RETRIES, - OPT_MARK_PROGRESS + OPT_MARK_PROGRESS, OPT_CHARSETS_DIR }; static int record= 0, opt_sleep= -1; static char *db= 0, *pass= 0; const char *user= 0, *host= 0, *unix_sock= 0, *opt_basedir= "./"; -const char *opt_include= 0; +const char *opt_include= 0, *opt_charsets_dir; static int port= 0; static int opt_max_connect_retries; static my_bool opt_compress= 0, silent= 0, verbose= 0; @@ -145,7 +145,6 @@ static struct st_test_file* file_stack_end; static CHARSET_INFO *charset_info= &my_charset_latin1; /* Default charset */ -static const char *charset_name= "latin1"; /* Default character set name */ static const char *embedded_server_groups[]= { @@ -3093,7 +3092,11 @@ void do_connect(struct st_command *command) if (opt_compress || con_compress) mysql_options(&next_con->mysql, MYSQL_OPT_COMPRESS, NullS); mysql_options(&next_con->mysql, MYSQL_OPT_LOCAL_INFILE, 0); - mysql_options(&next_con->mysql, MYSQL_SET_CHARSET_NAME, charset_name); + mysql_options(&next_con->mysql, MYSQL_SET_CHARSET_NAME, + charset_info->csname); + if (opt_charsets_dir) + mysql_options(&cur_con->mysql, MYSQL_SET_CHARSET_DIR, + opt_charsets_dir); #ifdef HAVE_OPENSSL if (opt_use_ssl || con_ssl) @@ -3779,6 +3782,9 @@ static struct my_option my_long_options[] = 0, 0, 0, 0, 0, 0}, {"basedir", 'b', "Basedir for tests.", (gptr*) &opt_basedir, (gptr*) &opt_basedir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"character-sets-dir", OPT_CHARSETS_DIR, + "Directory where character sets are.", (gptr*) &opt_charsets_dir, + (gptr*) &opt_charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"compress", 'C', "Use the compressed server/client protocol.", (gptr*) &opt_compress, (gptr*) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, @@ -5511,7 +5517,11 @@ int main(int argc, char **argv) if (opt_compress) mysql_options(&cur_con->mysql,MYSQL_OPT_COMPRESS,NullS); mysql_options(&cur_con->mysql, MYSQL_OPT_LOCAL_INFILE, 0); - mysql_options(&cur_con->mysql, MYSQL_SET_CHARSET_NAME, charset_name); + mysql_options(&cur_con->mysql, MYSQL_SET_CHARSET_NAME, + charset_info->csname); + if (opt_charsets_dir) + mysql_options(&cur_con->mysql, MYSQL_SET_CHARSET_DIR, + opt_charsets_dir); #ifdef HAVE_OPENSSL diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 3bcb735890c..f1c7897e975 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2976,6 +2976,7 @@ sub analyze_testcase_failure_sync_with_master($) mtr_add_arg($args, "--silent"); mtr_add_arg($args, "--skip-safemalloc"); mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir); + mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir); mtr_add_arg($args, "--socket=%s", $master->[0]->{'path_sock'}); mtr_add_arg($args, "--port=%d", $master->[0]->{'port'}); @@ -4161,6 +4162,7 @@ sub run_check_testcase ($$) { mtr_add_arg($args, "--silent"); mtr_add_arg($args, "--skip-safemalloc"); mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir); + mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir); mtr_add_arg($args, "--socket=%s", $mysqld->{'path_sock'}); mtr_add_arg($args, "--port=%d", $mysqld->{'port'}); @@ -4206,6 +4208,7 @@ sub run_mysqltest ($) { mtr_add_arg($args, "--silent"); mtr_add_arg($args, "--skip-safemalloc"); mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir); + mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir); if ($tinfo->{'component_id'} eq 'im') { From 26e6d78845deae2392bd9b06fe8a1592c8f39669 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Nov 2006 22:56:06 +0100 Subject: [PATCH 3/5] No need to pass an additional arg to to mtr_add_arg when there is no % sign --- mysql-test/mysql-test-run.pl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index f1c7897e975..e89fa21d610 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -4293,13 +4293,11 @@ sub run_mysqltest ($) { if ( $opt_ssl ) { # Turn on SSL for _all_ test cases if option --ssl was used - mtr_add_arg($args, "--ssl", - $glob_mysql_test_dir); + mtr_add_arg($args, "--ssl"); } elsif ( $opt_ssl_supported ) { - mtr_add_arg($args, "--skip-ssl", - $glob_mysql_test_dir); + mtr_add_arg($args, "--skip-ssl"); } # ---------------------------------------------------------------------- From d3b049a6bf104c42b84d1bd9f462c3df9f7602f0 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Nov 2006 23:16:44 +0100 Subject: [PATCH 4/5] Update of --mem flag after comments mysql-test/mysql-test-run.pl: Allow --mem to be specified as a flag or --mem= Add /tmp to locations to search Update comments and usage description --- mysql-test/mysql-test-run.pl | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index e89fa21d610..9bf0f8df632 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -667,7 +667,7 @@ sub command_line_setup () { 'tmpdir=s' => \$opt_tmpdir, 'vardir=s' => \$opt_vardir, 'benchdir=s' => \$glob_mysql_bench_dir, - 'mem' => \$opt_mem, + 'mem:s' => \$opt_mem, # Misc 'comment=s' => \$opt_comment, @@ -747,17 +747,18 @@ sub command_line_setup () { # -------------------------------------------------------------------------- # Check if we should speed up tests by trying to run on tmpfs # -------------------------------------------------------------------------- - if ( $opt_mem ) + if ( defined $opt_mem ) { mtr_error("Can't use --mem and --vardir at the same time ") if $opt_vardir; mtr_error("Can't use --mem and --tmpdir at the same time ") if $opt_tmpdir; - # Use /dev/shm as the preferred location for vardir and - # thus implicitly also tmpdir. Add other locations to list - my @tmpfs_locations= ($opt_mem, "/dev/shm"); - # One could maybe use "mount" to find tmpfs location(s) + # Search through list of locations that are known + # to be "fast disks" to list to find a suitable location + # Use --mem= as first location to look. + my @tmpfs_locations= ($opt_mem, "/dev/shm", "/tmp"); + foreach my $fs (@tmpfs_locations) { if ( -d $fs ) @@ -4630,9 +4631,12 @@ Options to control directories to use vardir=DIR The directory where files generated from the test run is stored (default: ./var). Specifying a ramdisk or tmpfs will speed up tests. - mem Run testsuite in "memory" using tmpfs if - available(default: /dev/shm) - reads path from MTR_MEM environment variable + mem[=DIR] Run testsuite in "memory" using tmpfs or ramdisk + Attempts to use DIR first if specified else + uses as builtin list of standard locations + for tmpfs (/dev/shm) + The option can also be set using environment + variable MTR_MEM=[DIR] Options to control what test suites or cases to run From 0100c53f9deeaab395b39d25f643489a44559920 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 9 Nov 2006 00:17:22 +0100 Subject: [PATCH 5/5] Fix warnings and NetWare compile failure client/mysql_upgrade.c: Fix NetWare problem - illegal cast of "const char*" to "char*" Fix warning, init "mystat" in FILEINFO to NULL Fix warning, remove unused variable "i" --- client/mysql_upgrade.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index e5855aee605..b8344606448 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -378,7 +378,7 @@ find_file(const char *name, const char *root, uint flags, char *result, size_t l { int ret; va_list va; - FILEINFO key= { name }; + FILEINFO key= { (char*)name, NULL }; const char *subdir; char *cp; @@ -395,7 +395,6 @@ find_file(const char *name, const char *root, uint flags, char *result, size_t l { MY_DIR *dir; FILEINFO *match; - uint i; char *cp1; cp1= strnmov(cp + 1, subdir, len - (cp - result) - 1);