diff options
Diffstat (limited to 'mysql-test/mysql-test-run.pl')
-rwxr-xr-x | mysql-test/mysql-test-run.pl | 172 |
1 files changed, 92 insertions, 80 deletions
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index cb6f7b4a486..40a6282e8ef 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -112,6 +112,7 @@ $SIG{INT}= sub { mtr_error("Got ^C signal"); }; our $mysql_version_id; our $glob_mysql_test_dir; our $basedir; +our $bindir; our $path_charsetsdir; our $path_client_bindir; @@ -159,7 +160,7 @@ my $path_config_file; # The generated config file, var/my.cnf # executables will be used by the test suite. our $opt_vs_config = $ENV{'MTR_VS_CONFIG'}; -my $DEFAULT_SUITES= "main,binlog,federated,rpl,maria,handler,parts,innodb,innodb_plugin,percona,ndb"; +my $DEFAULT_SUITES= "main,binlog,federated,rpl,maria,handler,parts,innodb,innodb_plugin,percona,ndb,vcol,oqgraph,sphinx,plugins"; my $opt_suites; our $opt_verbose= 0; # Verbose output, enable with --verbose @@ -531,7 +532,7 @@ sub run_test_server ($$$) { my $completed= []; my %running; my $result; - my $exe_mysqld= find_mysqld($basedir) || ""; # Used as hint to CoreDump + my $exe_mysqld= find_mysqld($bindir) || ""; # Used as hint to CoreDump my $suite_timeout= start_timer(suite_timeout()); @@ -907,7 +908,7 @@ sub run_worker ($) { $valgrind_reports= valgrind_exit_reports(); } if ( $opt_gprof ) { - gprof_collect (find_mysqld($basedir), keys %gprof_dirs); + gprof_collect (find_mysqld($bindir), keys %gprof_dirs); } exit($valgrind_reports); } @@ -1147,6 +1148,10 @@ sub command_line_setup { $basedir= dirname($basedir); } + # Respect MTR_BINDIR variable, which is typically set in to the + # build directory in out-of-source builds. + $bindir=$ENV{MTR_BINDIR}||$basedir; + fix_vs_config_dir(); # Look for the client binaries directory @@ -1157,21 +1162,25 @@ sub command_line_setup { } else { - $path_client_bindir= mtr_path_exists("$basedir/client_release", - "$basedir/client_debug", - "$basedir/client$opt_vs_config", - "$basedir/client", - "$basedir/bin"); + $path_client_bindir= mtr_path_exists("$bindir/client_release", + "$bindir/client_debug", + "$bindir/client$opt_vs_config", + "$bindir/client", + "$bindir/bin"); } - # Look for language files and charsetsdir, use same share - $path_language= mtr_path_exists("$basedir/share/mariadb/english", - "$basedir/share/mysql/english", - "$basedir/sql/share/english", - "$basedir/share/english"); + + $path_language= mtr_path_exists("$bindir/share/mariadb/english", + "$bindir/share/mysql/english", + "$bindir/sql/share/english", + "$bindir/share/english"); my $path_share= dirname($path_language); - $path_charsetsdir= mtr_path_exists("$path_share/charsets"); + + $path_charsetsdir= mtr_path_exists("$basedir/share/charsets", + "$basedir/share/mysql/charsets", + "$basedir/sql/share/charsets", + "$basedir/share/charsets"); # --debug implies we run debug server $opt_debug_server= 1 if $opt_debug; @@ -1337,7 +1346,15 @@ sub command_line_setup { # -------------------------------------------------------------------------- # Set the "var/" directory, the base for everything else # -------------------------------------------------------------------------- - $default_vardir= "$glob_mysql_test_dir/var"; + if(defined $ENV{MTR_BINDIR}) + { + $default_vardir= "$ENV{MTR_BINDIR}/mysql-test/var"; + } + else + { + $default_vardir= "$glob_mysql_test_dir/var"; + } + if ( ! $opt_vardir ) { $opt_vardir= $default_vardir; @@ -1408,25 +1425,15 @@ sub command_line_setup { # -------------------------------------------------------------------------- if ( $opt_embedded_server ) { - if ( IS_WINDOWS ) - { - # Add the location for libmysqld.dll to the path. - my $separator= ";"; - my $lib_mysqld= - mtr_path_exists("$basedir/libmysqld$opt_vs_config"); - if ( IS_CYGWIN ) - { - $lib_mysqld= posix_path($lib_mysqld); - $separator= ":"; - } - $ENV{'PATH'}= "$ENV{'PATH'}".$separator.$lib_mysqld; - } $opt_skip_ndbcluster= 1; # Turn off use of NDB cluster $opt_skip_ssl= 1; # Turn off use of SSL # Turn off use of bin log push(@opt_extra_mysqld_opt, "--skip-log-bin"); + # Write errors to stderr, not to mysqld.1.err + push(@opt_extra_mysqld_opt, "--disable-log-error"); + if ( using_extern() ) { mtr_error("Can't use --extern with --embedded-server"); @@ -1435,21 +1442,18 @@ sub command_line_setup { if ($opt_gdb) { - mtr_warning("Silently converting --gdb to --client-gdb in embedded mode"); $opt_client_gdb= $opt_gdb; $opt_gdb= undef; } if ($opt_ddd) { - mtr_warning("Silently converting --ddd to --client-ddd in embedded mode"); $opt_client_ddd= $opt_ddd; $opt_ddd= undef; } if ($opt_debugger) { - mtr_warning("Silently converting --debugger to --client-debugger in embedded mode"); $opt_client_debugger= $opt_debugger; $opt_debugger= undef; } @@ -1717,7 +1721,7 @@ sub collect_mysqld_features { mtr_add_arg($args, "--user=root"); } - my $exe_mysqld= find_mysqld($basedir); + my $exe_mysqld= find_mysqld($bindir); my $cmd= join(" ", $exe_mysqld, @$args); my $list= `$cmd`; @@ -1754,8 +1758,11 @@ sub collect_mysqld_features { # Put variables into hash if ( $line =~ /^([\S]+)[ \t]+(.*?)\r?$/ ) { - # print "$1=\"$2\"\n"; - $mysqld_variables{$1}= $2; + my $name= $1; + my $value=$2; + $name =~ s/_/-/g; + # print "$name=\"$value\"\n"; + $mysqld_variables{$name}= $value; } else { @@ -1809,8 +1816,11 @@ sub collect_mysqld_features_from_running_server () # Put variables into hash if ( $line =~ /^([\S]+)[ \t]+(.*?)\r?$/ ) { - # print "$1=\"$2\"\n"; - $mysqld_variables{$1}= $2; + my $name= $1; + my $value=$2; + $name =~ s/_/-/g; + # print "$name=\"$value\"\n"; + $mysqld_variables{$name}= $value; } } @@ -1842,7 +1852,7 @@ sub find_mysqld { unshift(@mysqld_names, "mysqld-debug"); } - return my_find_bin($mysqld_basedir, + return my_find_bin($bindir, ["sql", "libexec", "sbin", "bin"], [@mysqld_names]); } @@ -1892,7 +1902,7 @@ sub executable_setup () { if ( $opt_embedded_server ) { $exe_mysqltest= - mtr_exe_exists("$basedir/libmysqld/examples$opt_vs_config/mysqltest_embedded", + mtr_exe_exists("$bindir/libmysqld/examples$opt_vs_config/mysqltest_embedded", "$path_client_bindir/mysqltest_embedded"); } else @@ -2005,11 +2015,11 @@ sub mysql_client_test_arguments(){ # mysql_client_test executable may _not_ exist if ( $opt_embedded_server ) { $exe= mtr_exe_maybe_exists( - "$basedir/libmysqld/examples$opt_vs_config/mysql_client_test_embedded", - "$basedir/bin/mysql_client_test_embedded"); + "$bindir/libmysqld/examples$opt_vs_config/mysql_client_test_embedded", + "$bindir/bin/mysql_client_test_embedded"); } else { - $exe= mtr_exe_maybe_exists("$basedir/tests$opt_vs_config/mysql_client_test", - "$basedir/bin/mysql_client_test"); + $exe= mtr_exe_maybe_exists("$bindir/tests$opt_vs_config/mysql_client_test", + "$bindir/bin/mysql_client_test"); } my $args; @@ -2021,13 +2031,13 @@ sub mysql_client_test_arguments(){ mtr_add_arg($args, "--testcase"); mtr_add_arg($args, "--vardir=$opt_vardir"); client_debug_arg($args,"mysql_client_test"); - - return mtr_args2str($exe, @$args); + my $ret=mtr_args2str($exe, @$args); + return $ret; } sub tool_arguments ($$) { my($sedir, $tool_name) = @_; - my $exe= my_find_bin($basedir, + my $exe= my_find_bin($bindir, [$sedir, "bin"], $tool_name); @@ -2041,7 +2051,7 @@ sub tool_arguments ($$) { # scripts to run the mysqld binary to test invalid server startup options. sub mysqld_client_arguments () { my $default_mysqld= default_mysqld(); - my $exe = find_mysqld($basedir); + my $exe = find_mysqld($bindir); my $args; mtr_init_args(\$args); mtr_add_arg($args, "--no-defaults"); @@ -2053,7 +2063,7 @@ sub mysqld_client_arguments () { sub have_maria_support () { - my $maria_var= $mysqld_variables{'maria'}; + my $maria_var= $mysqld_variables{'aria'}; return defined $maria_var and $maria_var eq 'TRUE'; } @@ -2238,24 +2248,24 @@ sub environment_setup { # some versions, test using it should be skipped # ---------------------------------------------------- my $exe_bug25714= - mtr_exe_maybe_exists("$basedir/tests$opt_vs_config/bug25714"); + mtr_exe_maybe_exists("$bindir/tests$opt_vs_config/bug25714"); $ENV{'MYSQL_BUG25714'}= native_path($exe_bug25714); # ---------------------------------------------------- # mysql_fix_privilege_tables.sql # ---------------------------------------------------- my $file_mysql_fix_privilege_tables= - mtr_file_exists("$basedir/scripts/mysql_fix_privilege_tables.sql", - "$basedir/share/mysql_fix_privilege_tables.sql", - "$basedir/share/mariadb/mysql_fix_privilege_tables.sql", - "$basedir/share/mysql/mysql_fix_privilege_tables.sql"); + mtr_file_exists("$bindir/scripts/mysql_fix_privilege_tables.sql", + "$bindir/share/mysql_fix_privilege_tables.sql", + "$bindir/share/mariadb/mysql_fix_privilege_tables.sql", + "$bindir/share/mysql/mysql_fix_privilege_tables.sql"); $ENV{'MYSQL_FIX_PRIVILEGE_TABLES'}= $file_mysql_fix_privilege_tables; # ---------------------------------------------------- # my_print_defaults # ---------------------------------------------------- my $exe_my_print_defaults= - mtr_exe_exists("$basedir/extra$opt_vs_config/my_print_defaults", + mtr_exe_exists("$bindir/extra$opt_vs_config/my_print_defaults", "$path_client_bindir/my_print_defaults"); $ENV{'MYSQL_MY_PRINT_DEFAULTS'}= native_path($exe_my_print_defaults); @@ -2268,12 +2278,12 @@ sub environment_setup { $ENV{'MYISAM_FTDUMP'}= tool_arguments("storage/myisam", "myisam_ftdump"); # ---------------------------------------------------- - # maria tools + # aria tools # ---------------------------------------------------- if (have_maria_support()) { - $ENV{'MARIA_CHK'}= tool_arguments("storage/maria", "maria_chk"); - $ENV{'MARIA_PACK'}= tool_arguments("storage/maria", "maria_pack"); + $ENV{'MARIA_CHK'}= tool_arguments("storage/maria", "aria_chk"); + $ENV{'MARIA_PACK'}= tool_arguments("storage/maria", "aria_pack"); } # ---------------------------------------------------- @@ -2290,7 +2300,7 @@ sub environment_setup { # ---------------------------------------------------- # perror # ---------------------------------------------------- - my $exe_perror= mtr_exe_exists("$basedir/extra$opt_vs_config/perror", + my $exe_perror= mtr_exe_exists("$bindir/extra$opt_vs_config/perror", "$path_client_bindir/perror"); $ENV{'MY_PERROR'}= native_path($exe_perror); @@ -2347,9 +2357,11 @@ sub remove_stale_vardir () { mtr_report(" - WARNING: Using the 'mysql-test/var' symlink"); # Make sure the directory where it points exist - mtr_error("The destination for symlink $opt_vardir does not exist") - if ! -d readlink($opt_vardir); - + if (! -d readlink($opt_vardir)) + { + mtr_report("The destination for symlink $opt_vardir does not exist; Removing it and creating a new var directory"); + unlink($opt_vardir); + } foreach my $bin ( glob("$opt_vardir/*") ) { mtr_verbose("Removing bin $bin"); @@ -2416,8 +2428,11 @@ sub setup_vardir() { # it's a symlink # Make sure the directory where it points exist - mtr_error("The destination for symlink $opt_vardir does not exist") - if ! -d readlink($opt_vardir); + if (! -d readlink($opt_vardir)) + { + mtr_report("The destination for symlink $opt_vardir does not exist; Removing it and creating a new var directory"); + unlink($opt_vardir); + } } elsif ( $opt_mem ) { @@ -2471,9 +2486,9 @@ sub setup_vardir() { mkpath($plugindir); if (IS_WINDOWS && !$opt_embedded_server) { - for (<../storage/*$opt_vs_config/*.dll>, - <../plugin/*$opt_vs_config/*.dll>, - <../sql$opt_vs_config/*.dll>) + for (<$bindir/storage/*$opt_vs_config/*.dll>, + <$bindir/plugin/*$opt_vs_config/*.dll>, + <$bindir/sql$opt_vs_config/*.dll>) { my $pname=basename($_); copy rel2abs($_), "$plugindir/$pname"; @@ -2482,7 +2497,7 @@ sub setup_vardir() { } else { - for (<../storage/*/.libs/*.so>,<../plugin/*/.libs/*.so>,<../sql/.libs/*.so>) + for (<$bindir/storage/*/.libs/*.so>,<$bindir/plugin/*/.libs/*.so>,<$bindir/sql/.libs/*.so>) { my $pname=basename($_); symlink rel2abs($_), "$plugindir/$pname"; @@ -2493,8 +2508,8 @@ sub setup_vardir() { else { # hm, what paths work for debs and for rpms ? - for (<$basedir/lib/mysql/plugin/*.so>, - <$basedir/lib/plugin/*.dll>) + for (<$bindir/lib/mysql/plugin/*.so>, + <$bindir/lib/plugin/*.dll>) { my $pname=basename($_); set_plugin_var($pname); @@ -2609,7 +2624,7 @@ sub fix_vs_config_dir () { $opt_vs_config=""; - for (<$basedir/sql/*/mysqld.exe>) { + for (<$bindir/sql/*/mysqld.exe>) { if (-M $_ < $modified) { $modified = -M _; @@ -3199,7 +3214,7 @@ sub mysql_install_db { mtr_add_arg($args, "--loose-skip-innodb"); mtr_add_arg($args, "--loose-skip-pbxt"); mtr_add_arg($args, "--loose-skip-ndbcluster"); - mtr_add_arg($args, "--loose-skip-maria"); + mtr_add_arg($args, "--loose-skip-aria"); mtr_add_arg($args, "--disable-sync-frm"); mtr_add_arg($args, "--loose-disable-debug"); mtr_add_arg($args, "--tmpdir=%s", "$opt_vardir/tmp/"); @@ -3226,7 +3241,7 @@ sub mysql_install_db { # Setup args for bootstrap.test # #mtr_init_args(\$cmd_args); - #mtr_add_arg($cmd_args, "--loose-skip-maria") + #mtr_add_arg($cmd_args, "--loose-skip-aria") # ---------------------------------------------------------------------- # export MYSQLD_BOOTSTRAP_CMD variable containing <path>/mysqld <args> @@ -4391,7 +4406,7 @@ sub extract_warning_lines ($) { my @patterns = ( - qr/^Warning:|mysqld: Warning|\[Warning\]/, + qr/^Warning|mysqld: Warning|\[Warning\]/, qr/^Error:|\[ERROR\]/, qr/^==\d+==\s+\S/, # valgrind errors qr/InnoDB: Warning|InnoDB: Error/, @@ -4447,6 +4462,8 @@ sub extract_warning_lines ($) { qr|Table \./test/bug53592 has a primary key in InnoDB data dictionary, but not in MySQL|, qr|mysqld: Table '\./mtr/test_suppressions' is marked as crashed and should be repaired|, qr|InnoDB: Error: table 'test/bug39438'|, + qr|Access denied for user|, + qr|Aborted connection|, qr|table.*is full|, ); @@ -4951,14 +4968,13 @@ sub mysqld_arguments ($$$) { if ( $opt_valgrind_mysqld ) { - mtr_add_arg($args, "--skip-safemalloc"); - if ( $mysql_version_id < 50100 ) { mtr_add_arg($args, "--skip-bdb"); } } + mtr_add_arg($args, "--loose-skip-safemalloc"); mtr_add_arg($args, "%s--disable-sync-frm"); if (!using_extern() and $mysql_version_id >= 50106 && !$opt_user_args) @@ -5634,9 +5650,7 @@ sub gdb_arguments { if ( $type eq "client" ) { # write init file for client - mtr_tofile($gdb_init_file, - "set args $str\n" . - "break main\n"); + mtr_tofile($gdb_init_file, "set args $str\n"); } else { @@ -5692,9 +5706,7 @@ sub ddd_arguments { if ( $type eq "client" ) { # write init file for client - mtr_tofile($gdb_init_file, - "set args $str\n" . - "break main\n"); + mtr_tofile($gdb_init_file, "set args $str\n"); } else { |