diff options
Diffstat (limited to 'mysql-test/mysql-test-run.pl')
-rwxr-xr-x | mysql-test/mysql-test-run.pl | 202 |
1 files changed, 132 insertions, 70 deletions
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index a85bed88395..f75f65f0644 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -174,16 +174,17 @@ my @DEFAULT_SUITES= qw( handler- heap- innodb- + innodb_fts- innodb_zip- maria- + multi_source- optimizer_unfixed_bugs- - oqgraph- parts- percona- perfschema- plugins- + roles- rpl- - sphinx- sys_vars- unit- vcol- @@ -209,6 +210,8 @@ our @opt_mysqld_envs; my $opt_stress; +my $opt_dry_run; + my $opt_compress; my $opt_ssl; my $opt_skip_ssl; @@ -349,7 +352,7 @@ my $exe_ndb_mgm; our %mysqld_variables; our @optional_plugins; -my $source_dist= 0; +my $source_dist= -d "../sql"; my $opt_max_save_core= env_or_val(MTR_MAX_SAVE_CORE => 5); my $opt_max_save_datadir= env_or_val(MTR_MAX_SAVE_DATADIR => 20); @@ -395,11 +398,6 @@ sub main { executable_setup(); - if (!$opt_suites) { - $opt_suites= join ',', collect_default_suites(@DEFAULT_SUITES); - } - mtr_report("Using suites: $opt_suites") unless @opt_cases; - # --debug[-common] implies we run debug server $opt_debug_server= 1 if $opt_debug || $opt_debug_common; @@ -412,16 +410,30 @@ sub main { { # Run the mysqld to find out what features are available collect_mysqld_features(); - mysql_install_db(default_mysqld(), "$opt_vardir/install.db"); } check_ndbcluster_support(); check_ssl_support(); check_debug_support(); + if (!$opt_suites) { + $opt_suites= join ',', collect_default_suites(@DEFAULT_SUITES); + } + mtr_report("Using suites: $opt_suites") unless @opt_cases; + mtr_report("Collecting tests..."); my $tests= collect_test_cases($opt_reorder, $opt_suites, \@opt_cases, \@opt_skip_test_list); mark_time_used('collect'); + mysql_install_db(default_mysqld(), "$opt_vardir/install.db") unless using_extern(); + + if ($opt_dry_run) + { + for (@$tests) { + print $_->fullname(), "\n"; + } + exit 0; + } + if ( $opt_report_features ) { # Put "report features" as the first test to run my $tinfo = My::Test->new @@ -825,7 +837,7 @@ sub run_test_server ($$$) { redo; } - # Limit number of parallell NDB tests + # Limit number of parallel NDB tests if ($t->{ndb_test} and $num_ndb_tests >= $max_ndb){ #mtr_report("Skipping, num ndb is already at max, $num_ndb_tests"); next; @@ -1071,7 +1083,6 @@ sub print_global_resfile { resfile_global("shutdown-timeout", $opt_shutdown_timeout ? 1 : 0); resfile_global("warnings", $opt_warnings ? 1 : 0); resfile_global("max-connections", $opt_max_connections); -# resfile_global("default-myisam", $opt_default_myisam ? 1 : 0); resfile_global("product", "MySQL"); # Somewhat hacky code to convert numeric version back to dot notation my $v1= int($mysql_version_id / 10000); @@ -1232,10 +1243,10 @@ sub command_line_setup { 'stop-file=s' => \$opt_stop_file, 'stop-keep-alive=i' => \$opt_stop_keep_alive, 'max-connections=i' => \$opt_max_connections, - 'default-myisam!' => \&collect_option, 'report-times' => \$opt_report_times, 'result-file' => \$opt_resfile, 'stress=s' => \$opt_stress, + 'dry-run' => \$opt_dry_run, 'help|h' => \$opt_usage, # list-options is internal, not listed in help @@ -1254,11 +1265,6 @@ sub command_line_setup { report_option('verbose', $opt_verbose); } - if ( -d "../sql" ) - { - $source_dist= 1; - } - # Find the absolute path to the test directory $glob_mysql_test_dir= cwd(); if ($glob_mysql_test_dir =~ / /) @@ -1938,10 +1944,6 @@ sub collect_mysqld_features_from_running_server () } } - # "Convert" innodb flag - $mysqld_variables{'innodb'}= "ON" - if ($mysqld_variables{'have_innodb'} eq "YES"); - # Parse version my $version_str= $mysqld_variables{'version'}; if ( $version_str =~ /^([0-9]*)\.([0-9]*)\.([0-9]*)([^\s]*)/ ) @@ -2493,6 +2495,17 @@ sub environment_setup { "$path_client_bindir/replace"); $ENV{'REPLACE'}= native_path($exe_replace); + # ---------------------------------------------------- + # innochecksum + # ---------------------------------------------------- + my $exe_innochecksum= + mtr_exe_maybe_exists("$bindir/extra$opt_vs_config/innochecksum", + "$path_client_bindir/innochecksum"); + if ($exe_innochecksum) + { + $ENV{'INNOCHECKSUM'}= native_path($exe_innochecksum); + } + # Create an environment variable to make it possible # to detect that valgrind is being used from test cases $ENV{'VALGRIND_TEST'}= $opt_valgrind; @@ -2669,24 +2682,34 @@ sub setup_vardir() { # and make them world readable copytree("$glob_mysql_test_dir/std_data", "$opt_vardir/std_data", "0022"); - # create a plugin dir and copy plugins into it + # create a plugin dir and copy or symlink plugins into it if ($source_dist) { $plugindir="$opt_vardir/plugins"; mkpath($plugindir); - if (IS_WINDOWS && !$opt_embedded_server) + if (IS_WINDOWS) { - for (<$bindir/storage/*$opt_vs_config/*.dll>, - <$bindir/plugin/*$opt_vs_config/*.dll>, - <$bindir/sql$opt_vs_config/*.dll>) + if (!$opt_embedded_server) { - my $pname=basename($_); - copy rel2abs($_), "$plugindir/$pname"; - set_plugin_var($pname); + 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"; + set_plugin_var($pname); + } } } else { + my $opt_use_copy= 1; + if (symlink "$opt_vardir/run", "$plugindir/symlink_test") + { + $opt_use_copy= 0; + unlink "$plugindir/symlink_test"; + } + for (<../storage/*/.libs/*.so>, <../plugin/*/.libs/*.so>, <../plugin/*/*/.libs/*.so>, @@ -2696,7 +2719,14 @@ sub setup_vardir() { <$bindir/sql/*.so>) { my $pname=basename($_); - symlink rel2abs($_), "$plugindir/$pname"; + if ($opt_use_copy) + { + copy rel2abs($_), "$plugindir/$pname"; + } + else + { + symlink rel2abs($_), "$plugindir/$pname"; + } set_plugin_var($pname); } } @@ -3490,7 +3520,10 @@ sub mysql_install_db { mtr_add_arg($args, "--basedir=%s", $install_basedir); mtr_add_arg($args, "--datadir=%s", $install_datadir); mtr_add_arg($args, "--default-storage-engine=myisam"); - mtr_add_arg($args, "--skip-$_") for @optional_plugins; + mtr_add_arg($args, "--skip-plugin-$_") for @optional_plugins; + # starting from 10.0 bootstrap scripts require InnoDB + mtr_add_arg($args, "--loose-innodb"); + mtr_add_arg($args, "--loose-innodb-log-file-size=5M"); mtr_add_arg($args, "--disable-sync-frm"); mtr_add_arg($args, "--tmpdir=%s", "$opt_vardir/tmp/"); mtr_add_arg($args, "--core-file"); @@ -3556,7 +3589,7 @@ sub mysql_install_db { { my $sql_dir= dirname($path_sql); # Use the mysql database for system tables - mtr_tofile($bootstrap_sql_file, "use mysql\n"); + mtr_tofile($bootstrap_sql_file, "use mysql;\n"); # Add the offical mysql system tables # for a production system @@ -3585,6 +3618,9 @@ sub mysql_install_db { mtr_appendfile_to_file("$sql_dir/fill_help_tables.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"); } else { @@ -3605,7 +3641,7 @@ sub mysql_install_db { # Create mtr database mtr_tofile($bootstrap_sql_file, - "CREATE DATABASE mtr;\n"); + "CREATE DATABASE mtr CHARSET=latin1;\n"); # Add help tables and data for warning detection and supression mtr_tofile($bootstrap_sql_file, @@ -3636,9 +3672,10 @@ sub mysql_install_db { verbose => $opt_verbose, ) != 0) { + my $data= mtr_grab_file($path_bootstrap_log); mtr_error("Error executing mysqld --bootstrap\n" . "Could not install system database from $bootstrap_sql_file\n" . - "see $path_bootstrap_log for errors"); + "The $path_bootstrap_log file contains:\n$data\n"); } } @@ -4252,11 +4289,18 @@ sub run_testcase ($$) { # foreach my $option ($config->options_in_group("ENV")) { - # Save old value to restore it before next time - $old_env{$option->name()}= $ENV{$option->name()}; + my ($name, $val)= ($option->name(), $option->value()); - mtr_verbose($option->name(), "=",$option->value()); - $ENV{$option->name()}= $option->value(); + # Save old value to restore it before next time + $old_env{$name}= $ENV{$name}; + + unless (defined $val) { + mtr_warning("Uninitialized value for ", $name, + ", group [ENV], file ", $current_config_name); + } else { + mtr_verbose($name, "=", $val); + $ENV{$name}= $val; + } } } @@ -4761,13 +4805,14 @@ sub extract_warning_lines ($$) { qr/Plugin 'ndbcluster' will be forced to shutdown/, qr/InnoDB: Error: in ALTER TABLE `test`.`t[12]`/, qr/InnoDB: Error: table `test`.`t[12]` .*does not exist in the InnoDB internal/, + qr/InnoDB: Warning: Setting innodb_use_sys_malloc/, qr/InnoDB: Warning: a long semaphore wait:/, - qr/Slave: Unknown table 't1' Error_code: 1051/, - qr/Slave SQL:.*(Error_code: [[:digit:]]+|Query:.*)/, + qr/Slave: Unknown table 't1' .* 1051/, + qr/Slave SQL:.*(Internal MariaDB error code: [[:digit:]]+|Query:.*)/, qr/slave SQL thread aborted/, qr/unknown option '--loose[-_]/, qr/unknown variable 'loose[-_]/, - qr/Invalid .*old.* table or database name/, + #qr/Invalid .*old.* table or database name/, qr/Now setting lower_case_table_names to [02]/, qr/Setting lower_case_table_names=2/, qr/You have forced lower_case_table_names to 0/, @@ -4781,6 +4826,12 @@ sub extract_warning_lines ($$) { qr/Slave I\/O: Get master clock failed with error:.*/, qr/Slave I\/O: Get master COLLATION_SERVER failed with error:.*/, qr/Slave I\/O: Get master TIME_ZONE failed with error:.*/, + qr/Slave I\/O: Get master \@\@GLOBAL.gtid_domain_id failed with error:.*/, + qr/Slave I\/O: Setting \@slave_connect_state failed with error:.*/, + qr/Slave I\/O: Setting \@slave_gtid_strict_mode failed with error:.*/, + qr/Slave I\/O: Setting \@slave_gtid_ignore_duplicates failed with error:.*/, + qr/Slave I\/O: Setting \@slave_until_gtid failed with error:.*/, + qr/Slave I\/O: Get master GTID position failed with error:.*/, qr/Slave I\/O: error reconnecting to master '.*' - retry-time: [1-3] retries/, qr/Slave I\/0: Master command COM_BINLOG_DUMP failed/, qr/Error reading packet/, @@ -4791,7 +4842,8 @@ sub extract_warning_lines ($$) { qr|Checking table: '\..mtr.test_suppressions'|, qr|Table \./test/bug53592 has a primary key in InnoDB data dictionary, but not in MySQL|, qr|Table '\..mtr.test_suppressions' is marked as crashed and should be repaired|, - qr|Can't open shared library.*ha_archive|, + qr|Can't open shared library|, + qr|Couldn't load plugin named .*EXAMPLE.*|, qr|InnoDB: Error: table 'test/bug39438'|, qr| entry '.*' ignored in --skip-name-resolve mode|, qr|mysqld got signal 6|, @@ -4807,6 +4859,8 @@ sub extract_warning_lines ($$) { qr|feedback plugin: failed to retrieve the MAC address|, qr|Plugin 'FEEDBACK' init function returned error|, qr|Plugin 'FEEDBACK' registration as a INFORMATION SCHEMA failed|, + qr|'log-bin-use-v1-row-events' is MySQL 5.6 compatible option|, + qr|InnoDB: Setting thread \d+ nice to \d+ failed, current nice \d+, errno 13|, # setpriority() fails under valgrind qr|Failed to setup SSL|, qr|SSL error: Failed to set ciphers to use|, qr/Plugin 'InnoDB' will be forced to shutdown/, @@ -5198,7 +5252,7 @@ sub report_failure_and_restart ($) { # In these cases we may want valgrind report from normal termination $tinfo->{'dont_kill_server'}= 1; } - # Shotdown properly if not to be killed (for valgrind) + # Shutdown properly if not to be killed (for valgrind) stop_all_servers($tinfo->{'dont_kill_server'} ? $opt_shutdown_timeout : 0); $tinfo->{'result'}= 'MTR_RES_FAILED'; @@ -5329,9 +5383,6 @@ sub mysqld_arguments ($$$) { } my $found_skip_core= 0; - my @plugins; - my %seen; - my $plugin; foreach my $arg ( @$extra_opts ) { # Skip --defaults-file option since it's handled above. @@ -5351,12 +5402,6 @@ sub mysqld_arguments ($$$) { { ; # Dont add --skip-log-bin when mysqld have --log-slave-updates in config } - elsif ($plugin = mtr_match_prefix($arg, "--plugin-load=")) - { - next if $plugin =~ /=$/; - push @plugins, $plugin unless $seen{$plugin}; - $seen{$plugin} = 1; - } else { mtr_add_arg($args, "%s", $arg); @@ -5373,11 +5418,6 @@ sub mysqld_arguments ($$$) { mtr_add_arg($args, "--loose-debug-sync-timeout=%s", $opt_debug_sync_timeout) unless $opt_user_args; - if (@plugins) { - my $sep = (IS_WINDOWS) ? ';' : ':'; - mtr_add_arg($args, "--plugin-load=%s" . join($sep, @plugins)); - } - return $args; } @@ -5703,7 +5743,7 @@ sub get_extra_opts { sub stop_servers($$) { my (@servers)= @_; - mtr_report("Restarting ", started(@servers)); + mtr_report("Stopping ", started(@servers)); My::SafeProcess::shutdown($opt_shutdown_timeout, started(@servers)); @@ -6190,7 +6230,6 @@ sub debugger_arguments { } } - # # Modify the exe and args so that program is run in valgrind # @@ -6210,6 +6249,17 @@ sub valgrind_arguments { mtr_add_arg($args, "--num-callers=16"); mtr_add_arg($args, "--suppressions=%s/valgrind.supp", $glob_mysql_test_dir) if -f "$glob_mysql_test_dir/valgrind.supp"; + + # Ensure the jemalloc works with mysqld + if ($$exe =~ /mysqld/) + { + my %somalloc=( + 'system jemalloc' => 'libjemalloc*', + 'bundled jemalloc' => 'NONE' + ); + my ($syn) = $somalloc{$mysqld_variables{'version-malloc-library'}}; + mtr_add_arg($args, '--soname-synonyms=somalloc=%s', $syn) if $syn; + } } # Add valgrind options, can be overriden by user @@ -6340,7 +6390,20 @@ sub usage ($) { $0 [ OPTIONS ] [ TESTCASE ] -Options to control what engine/variation to run +Where test case can be specified as: + +testcase[.test] Runs the test case named 'testcase' from all suits +path-to-testcase +[suite.]testcase[,combination] + +Examples: + +alias +main.alias 'main' is the name of the suite for the 't' directory. +rpl.rpl_invoked_features,mix,xtradb_plugin +suite/rpl/t/rpl.rpl_invoked_features + +Options to control what engine/variation to run: embedded-server Use the embedded server, i.e. no mysqld daemons ps-protocol Use the binary protocol between client and server @@ -6351,16 +6414,18 @@ Options to control what engine/variation to run non-blocking-api Use the non-blocking client API compress Use the compressed protocol between client and server ssl Use ssl protocol between client and server - skip-ssl Dont start server with support for ssl connections + skip-ssl Don't start server with support for ssl connections vs-config Visual Studio configuration used to create executables (default: MTR_VS_CONFIG environment variable) - parallel=# How many parallell test should be run + parallel=# How many parallel test should be run defaults-file=<config template> Use fixed config template for all tests defaults-extra-file=<config template> Extra config template to add to all generated configs combination=<opt> Use at least twice to run tests with specified options to mysqld + dry-run Don't run any tests, print the list of tests + that were selected for execution Options to control directories to use tmpdir=DIR The directory where temporary files are stored @@ -6481,7 +6546,7 @@ Options for debugging the product up disks for heavily crashing server). Defaults to $opt_max_save_datadir, set to 0 for no limit. Set it's default with MTR_MAX_SAVE_DATADIR - max-test-fail Limit the number of test failurs before aborting + max-test-fail Limit the number of test failures before aborting the current test run. Defaults to $opt_max_test_fail, set to 0 for no limit. Set it's default with MTR_MAX_TEST_FAIL @@ -6524,11 +6589,11 @@ Misc options start-dirty Only start the servers (without initialization) for the first specified test case user-args In combination with start* and no test name, drops - arguments to mysqld except those speficied with + arguments to mysqld except those specified with --mysqld (if any) wait-all If --start or --start-dirty option is used, wait for all servers to exit before finishing the process - fast Run as fast as possible, dont't wait for servers + fast Run as fast as possible, don't wait for servers to shutdown etc. force-restart Always restart servers between tests parallel=N Run tests in N parallel threads (default 1) @@ -6539,7 +6604,7 @@ Misc options failures before stopping, set with the --retry-failure option retry-failure=N When using the --retry option to retry failed tests, - stop when N failures have occured (default $opt_retry_failure) + stop when N failures have occurred (default $opt_retry_failure) reorder Reorder tests to get fewer server restarts help Get this help text @@ -6563,7 +6628,7 @@ Misc options actions. Disable facility with NUM=0. gcov Collect coverage information after the test. The result is a gcov file per source and header file. - gcov-src-dir=subdir Colllect coverage only within the given subdirectory. + gcov-src-dir=subdir Collect coverage only within the given subdirectory. For example, if you're only developing the SQL layer, it makes sense to use --gcov-src-dir=sql gprof Collect profiling information using gprof. @@ -6574,9 +6639,6 @@ Misc options timediff With --timestamp, also print time passed since *previous* test started max-connections=N Max number of open connection to server in mysqltest - default-myisam Set default storage engine to MyISAM for non-innodb - tests. This is needed after switching default storage - engine to InnoDB. report-times Report how much time has been spent on different phases of test execution. stress=ARGS Run stress test, providing options to |