diff options
Diffstat (limited to 'mysql-test/mysql-test-run.pl')
-rwxr-xr-x | mysql-test/mysql-test-run.pl | 103 |
1 files changed, 60 insertions, 43 deletions
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 1a00a7e694d..ddb79b925b6 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2,7 +2,7 @@ # -*- cperl -*- # Copyright (c) 2004, 2014, Oracle and/or its affiliates. -# Copyright (c) 2009, 2017, MariaDB Corporation +# Copyright (c) 2009, 2018, MariaDB Corporation # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -653,50 +653,59 @@ sub run_test_server ($$$) { my $worker_savename= basename($worker_savedir); my $savedir= "$opt_vardir/log/$worker_savename"; + # Move any core files from e.g. mysqltest + foreach my $coref (glob("core*"), glob("*.dmp")) + { + mtr_report(" - found '$coref', moving it to '$worker_savedir'"); + move($coref, $worker_savedir); + } + + find( + { + no_chdir => 1, + wanted => sub + { + my $core_file= $File::Find::name; + my $core_name= basename($core_file); + + # Name beginning with core, not ending in .gz + if (($core_name =~ /^core/ and $core_name !~ /\.gz$/) + or (IS_WINDOWS and $core_name =~ /\.dmp$/)) + { + # Ending with .dmp + mtr_report(" - found '$core_name'", + "($num_saved_cores/$opt_max_save_core)"); + + My::CoreDump->show($core_file, $exe_mysqld, $opt_parallel); + + # Limit number of core files saved + if ($opt_max_save_core > 0 && + $num_saved_cores >= $opt_max_save_core) + { + mtr_report(" - deleting it, already saved", + "$opt_max_save_core"); + unlink("$core_file"); + } + else + { + mtr_compress_file($core_file) unless @opt_cases; + ++$num_saved_cores; + } + } + } + }, + $worker_savedir); + if ($opt_max_save_datadir > 0 && $num_saved_datadir >= $opt_max_save_datadir) { mtr_report(" - skipping '$worker_savedir/'"); rmtree($worker_savedir); } - else { + else + { mtr_report(" - saving '$worker_savedir/' to '$savedir/'"); rename($worker_savedir, $savedir); - # Move any core files from e.g. mysqltest - foreach my $coref (glob("core*"), glob("*.dmp")) - { - mtr_report(" - found '$coref', moving it to '$savedir'"); - move($coref, $savedir); - } - if ($opt_max_save_core > 0) { - # Limit number of core files saved - find({ no_chdir => 1, - wanted => sub { - my $core_file= $File::Find::name; - my $core_name= basename($core_file); - - # Name beginning with core, not ending in .gz - if (($core_name =~ /^core/ and $core_name !~ /\.gz$/) - or (IS_WINDOWS and $core_name =~ /\.dmp$/)){ - # Ending with .dmp - mtr_report(" - found '$core_name'", - "($num_saved_cores/$opt_max_save_core)"); - - My::CoreDump->show($core_file, $exe_mysqld, $opt_parallel); - - if ($num_saved_cores >= $opt_max_save_core) { - mtr_report(" - deleting it, already saved", - "$opt_max_save_core"); - unlink("$core_file"); - } else { - mtr_compress_file($core_file) unless @opt_cases; - } - ++$num_saved_cores; - } - } - }, - $savedir); - } } resfile_print_test(); $num_saved_datadir++; @@ -1133,7 +1142,7 @@ sub command_line_setup { 'debug' => \$opt_debug, 'debug-common' => \$opt_debug_common, 'debug-server' => \$opt_debug_server, - 'gdb:s' => sub { $opt_gdb = $_[1] || '#' }, + 'gdb=s' => \$opt_gdb, 'client-gdb' => \$opt_client_gdb, 'manual-gdb' => \$opt_manual_gdb, 'manual-lldb' => \$opt_manual_lldb, @@ -1228,6 +1237,9 @@ sub command_line_setup { 'skip-test-list=s' => \@opt_skip_test_list ); + # fix options (that take an optional argument and *only* after = sign + my %fixopt = ( '--gdb' => '--gdb=#' ); + @ARGV = map { $fixopt{$_} or $_ } @ARGV; GetOptions(%options) or usage("Can't read options"); usage("") if $opt_usage; list_options(\%options) if $opt_list_options; @@ -2573,7 +2585,7 @@ sub setup_vardir() { { for (<$bindir/storage/*$opt_vs_config/*.dll>, <$bindir/plugin/*$opt_vs_config/*.dll>, - <$bindir/libmariadb/plugins/*$opt_vs_config/*.dll>, + <$bindir/libmariadb$opt_vs_config/*.dll>, <$bindir/sql$opt_vs_config/*.dll>) { my $pname=basename($_); @@ -2594,6 +2606,7 @@ sub setup_vardir() { for (<$bindir/storage/*/*.so>, <$bindir/plugin/*/*.so>, <$bindir/libmariadb/plugins/*/*.so>, + <$bindir/libmariadb/*.so>, <$bindir/sql/*.so>) { my $pname=basename($_); @@ -3191,9 +3204,6 @@ sub mysql_install_db { mtr_appendfile_to_file("$sql_dir/mysql_performance_tables.sql", $bootstrap_sql_file); - # Don't install anonymous users - mtr_tofile($bootstrap_sql_file, "set \@skip_auth_anonymous=1;\n"); - # Add the mysql system tables initial data # for a production system mtr_appendfile_to_file("$sql_dir/mysql_system_tables_data.sql", @@ -3211,6 +3221,10 @@ sub mysql_install_db { mtr_appendfile_to_file("$sql_dir/fill_help_tables.sql", $bootstrap_sql_file); + # Create test database + mtr_appendfile_to_file("$sql_dir/mysql_test_db.sql", + $bootstrap_sql_file); + # mysql.gtid_slave_pos was created in InnoDB, but many tests # run without InnoDB. Alter it to MyISAM now mtr_tofile($bootstrap_sql_file, "ALTER TABLE gtid_slave_pos ENGINE=MyISAM;\n"); @@ -3228,6 +3242,10 @@ sub mysql_install_db { sql_to_bootstrap($text)); } + # Remove anonymous users + mtr_tofile($bootstrap_sql_file, + "DELETE FROM mysql.user where user= '';\n"); + # Create mtr database mtr_tofile($bootstrap_sql_file, "CREATE DATABASE mtr CHARSET=latin1;\n"); @@ -3248,7 +3266,6 @@ sub mysql_install_db { # Create directories mysql and test mkpath("$install_datadir/mysql"); - mkpath("$install_datadir/test"); if ( My::SafeProcess->run ( |