diff options
author | unknown <tsmith@maint1.mysql.com> | 2006-10-24 20:01:01 +0200 |
---|---|---|
committer | unknown <tsmith@maint1.mysql.com> | 2006-10-24 20:01:01 +0200 |
commit | b075786e0a70c05dc4ed9ffac2760a689683d532 (patch) | |
tree | 942339701a7623ad65cdc98db19b566968d5a03b /mysql-test | |
parent | 31959774de006ba846b8206eea8f4df3cb85ad63 (diff) | |
parent | 5154dd662594e7ab0e83e77fe5652bfa0eba92da (diff) | |
download | mariadb-git-b075786e0a70c05dc4ed9ffac2760a689683d532.tar.gz |
Merge bk-internal.mysql.com:/home/bk/mysql-5.1-maint
into maint1.mysql.com:/data/localhome/tsmith/bk/51
mysql-test/include/mix1.inc:
Auto merged
mysql-test/r/innodb_mysql.result:
Auto merged
mysql-test/t/view.test:
Auto merged
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/include/analyze_failure_sync_with_master.test | 15 | ||||
-rwxr-xr-x | mysql-test/mysql-test-run.pl | 278 | ||||
-rw-r--r-- | mysql-test/r/mysqldump-max.result | 19 | ||||
-rw-r--r-- | mysql-test/r/rpl_trigger.result | 2 | ||||
-rw-r--r-- | mysql-test/r/type_newdecimal.result | 2 | ||||
-rw-r--r-- | mysql-test/t/mysqldump-max.test | 11 | ||||
-rw-r--r-- | mysql-test/t/rpl_ndb_auto_inc.test | 1 | ||||
-rw-r--r-- | mysql-test/t/rpl_trigger.test | 2 | ||||
-rw-r--r-- | mysql-test/t/type_newdecimal.test | 4 |
9 files changed, 222 insertions, 112 deletions
diff --git a/mysql-test/include/analyze_failure_sync_with_master.test b/mysql-test/include/analyze_failure_sync_with_master.test new file mode 100644 index 00000000000..e6fd32d2f46 --- /dev/null +++ b/mysql-test/include/analyze_failure_sync_with_master.test @@ -0,0 +1,15 @@ +# Connect to both master and slave +connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,); +connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,); + +vertical_results; + +echo == MASTER ===========================================================; +connection master; +show master status; +show slave status; + +echo == SLAVE ===========================================================; +connection slave; +show master status; +show slave status; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 286bb8a11c5..3046e5ba2fe 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -758,14 +758,19 @@ sub command_line_setup () { $opt_vardir= $default_vardir; } elsif ( $mysql_version_id < 50000 and - $opt_vardir ne $default_vardir ) + $opt_vardir ne $default_vardir) { # Version 4.1 and --vardir was specified # Only supported as a symlink from var/ # by setting up $opt_mem that symlink will be created - $opt_mem= $opt_vardir; + if ( ! $glob_win32 ) + { + # Only platforms that have native symlinks can use the vardir trick + $opt_mem= $opt_vardir; + mtr_report("Using 4.1 vardir trick"); + } + $opt_vardir= $default_vardir; - mtr_report("Using 4.1 vardir trick"); } $path_vardir_trace= $opt_vardir; @@ -1264,9 +1269,9 @@ sub collect_mysqld_features () { else { # Put variables into hash - if ( $line =~ /^([\S]+)[ \t]+(.*)$/ ) + if ( $line =~ /^([\S]+)[ \t]+(.*?)\r?$/ ) { - # print "$1=$2\n"; + # print "$1=\"$2\"\n"; $mysqld_variables{$1}= $2; } else @@ -1295,6 +1300,54 @@ sub collect_mysqld_features () { } +sub executable_setup_im () { + + # Look for instance manager binary - mysqlmanager + $exe_im= + mtr_exe_maybe_exists( + "$glob_basedir/server-tools/instance-manager/mysqlmanager", + "$glob_basedir/libexec/mysqlmanager"); + + return ($exe_im eq ""); +} + +sub executable_setup_ndb () { + + # Look for ndb tols and binaries + my $ndb_path= mtr_file_exists("$glob_basedir/ndb", + "$glob_basedir/storage/ndb", + "$glob_basedir/bin"); + + $exe_ndbd= + mtr_exe_maybe_exists("$ndb_path/src/kernel/ndbd", + "$ndb_path/ndbd"); + $exe_ndb_mgm= + mtr_exe_maybe_exists("$ndb_path/src/mgmclient/ndb_mgm", + "$ndb_path/ndb_mgm"); + $exe_ndb_mgmd= + mtr_exe_maybe_exists("$ndb_path/src/mgmsrv/ndb_mgmd", + "$ndb_path/ndb_mgmd"); + $exe_ndb_waiter= + mtr_exe_maybe_exists("$ndb_path/tools/ndb_waiter", + "$ndb_path/ndb_waiter"); + + # May not exist + $path_ndb_tools_dir= mtr_file_exists("$ndb_path/tools", + "$ndb_path"); + # May not exist + $path_ndb_examples_dir= + mtr_file_exists("$ndb_path/ndbapi-examples", + "$ndb_path/examples"); + # May not exist + $exe_ndb_example= + mtr_file_exists("$path_ndb_examples_dir/ndbapi_simple/ndbapi_simple"); + + return ( $exe_ndbd eq "" or + $exe_ndb_mgm eq "" or + $exe_ndb_mgmd eq "" or + $exe_ndb_waiter eq ""); +} + sub executable_setup () { # @@ -1333,20 +1386,6 @@ sub executable_setup () { "$glob_basedir/extra/release/perror", "$glob_basedir/extra/debug/perror"); - - if ( ! $opt_skip_im ) - { - # Look for instance manager binary - mysqlmanager - $exe_im= - mtr_exe_exists( - "$glob_basedir/server-tools/instance-manager/mysqlmanager", - "$glob_basedir/libexec/mysqlmanager"); - } - else - { - $exe_im= "not_available"; - } - # Look for the client binaries $exe_mysqlcheck= mtr_exe_exists("$path_client_bindir/mysqlcheck"); $exe_mysqldump= mtr_exe_exists("$path_client_bindir/mysqldump"); @@ -1368,35 +1407,25 @@ sub executable_setup () { "$path_client_bindir/mysql_fix_privilege_tables"); } - if ( ! $opt_skip_ndbcluster) - { - # Look for ndb tols and binaries - my $ndb_path= mtr_path_exists("$glob_basedir/ndb", - "$glob_basedir/storage/ndb", - "$glob_basedir/bin"); - - $path_ndb_tools_dir= mtr_path_exists("$ndb_path/tools", - "$ndb_path"); - $exe_ndb_mgm= - mtr_exe_exists("$ndb_path/src/mgmclient/ndb_mgm", - "$ndb_path/ndb_mgm"); - $exe_ndb_mgmd= - mtr_exe_exists("$ndb_path/src/mgmsrv/ndb_mgmd", - "$ndb_path/ndb_mgmd"); - $exe_ndb_waiter= - mtr_exe_exists("$ndb_path/tools/ndb_waiter", - "$ndb_path/ndb_waiter"); - $exe_ndbd= - mtr_exe_exists("$ndb_path/src/kernel/ndbd", - "$ndb_path/ndbd"); - - # May not exist - $path_ndb_examples_dir= - mtr_file_exists("$ndb_path/ndbapi-examples", - "$ndb_path/examples"); - # May not exist - $exe_ndb_example= - mtr_file_exists("$path_ndb_examples_dir/ndbapi_simple/ndbapi_simple"); + + if ( ! $opt_skip_ndbcluster and executable_setup_ndb()) + { + mtr_warning("Could not find all required ndb binaries, " . + "all ndb tests will fail, use --skip-ndbcluster to " . + "skip testing it."); + + foreach my $cluster (@{$clusters}) + { + $cluster->{"executable_setup_failed"}= 1; + } + } + + if ( ! $opt_skip_im and executable_setup_im()) + { + mtr_warning("Could not find all required instance manager binaries, " . + "all im tests will fail, use --skip-im to " . + "continue without instance manager"); + $instance_manager->{"executable_setup_failed"}= 1; } # Look for the udf_example library @@ -1424,7 +1453,8 @@ sub executable_setup () { if ( $glob_use_embedded_server ) { $exe_mysql_client_test= - mtr_exe_maybe_exists("$glob_basedir/libmysqld/examples/mysql_client_test_embedded"); + mtr_exe_maybe_exists( + "$glob_basedir/libmysqld/examples/mysql_client_test_embedded"); } else { @@ -1567,19 +1597,28 @@ sub environment_setup () { # ---------------------------------------------------- # Setup env for IM # ---------------------------------------------------- - $ENV{'IM_EXE'}= $exe_im; - $ENV{'IM_PATH_PID'}= $instance_manager->{path_pid}; - $ENV{'IM_PATH_ANGEL_PID'}= $instance_manager->{path_angel_pid}; - $ENV{'IM_PORT'}= $instance_manager->{port}; - $ENV{'IM_DEFAULTS_PATH'}= $instance_manager->{defaults_file}; - $ENV{'IM_PASSWORD_PATH'}= $instance_manager->{password_file}; - - $ENV{'IM_MYSQLD1_SOCK'}= $instance_manager->{instances}->[0]->{path_sock}; - $ENV{'IM_MYSQLD1_PORT'}= $instance_manager->{instances}->[0]->{port}; - $ENV{'IM_MYSQLD1_PATH_PID'}=$instance_manager->{instances}->[0]->{path_pid}; - $ENV{'IM_MYSQLD2_SOCK'}= $instance_manager->{instances}->[1]->{path_sock}; - $ENV{'IM_MYSQLD2_PORT'}= $instance_manager->{instances}->[1]->{port}; - $ENV{'IM_MYSQLD2_PATH_PID'}=$instance_manager->{instances}->[1]->{path_pid}; + if ( ! $opt_skip_im ) + { + $ENV{'IM_EXE'}= $exe_im; + $ENV{'IM_PATH_PID'}= $instance_manager->{path_pid}; + $ENV{'IM_PATH_ANGEL_PID'}= $instance_manager->{path_angel_pid}; + $ENV{'IM_PORT'}= $instance_manager->{port}; + $ENV{'IM_DEFAULTS_PATH'}= $instance_manager->{defaults_file}; + $ENV{'IM_PASSWORD_PATH'}= $instance_manager->{password_file}; + + $ENV{'IM_MYSQLD1_SOCK'}= + $instance_manager->{instances}->[0]->{path_sock}; + $ENV{'IM_MYSQLD1_PORT'}= + $instance_manager->{instances}->[0]->{port}; + $ENV{'IM_MYSQLD1_PATH_PID'}= + $instance_manager->{instances}->[0]->{path_pid}; + $ENV{'IM_MYSQLD2_SOCK'}= + $instance_manager->{instances}->[1]->{path_sock}; + $ENV{'IM_MYSQLD2_PORT'}= + $instance_manager->{instances}->[1]->{port}; + $ENV{'IM_MYSQLD2_PATH_PID'}= + $instance_manager->{instances}->[1]->{path_pid}; + } # ---------------------------------------------------- # Setup env so childs can execute mysqlcheck @@ -1696,7 +1735,7 @@ sub environment_setup () { # Setup env so childs can execute mysql_client_test # ---------------------------------------------------- my $cmdline_mysql_client_test= - "$exe_mysql_client_test --no-defaults --testcase --user=root --silent " . + "$exe_mysql_client_test --no-defaults --testcase --user=root " . "--port=$master->[0]->{'port'} " . "--socket=$master->[0]->{'path_sock'}"; if ( $mysql_version_id >= 50000 ) @@ -1834,6 +1873,11 @@ sub kill_running_servers () { if ( ! -d $opt_vardir ) { + if ( -l $opt_vardir and ! -d readlink($opt_vardir) ) + { + mtr_report("Removing $opt_vardir symlink without destination"); + unlink($opt_vardir); + } # The "var" dir does not exist already # the processes that mtr_kill_leftovers start will write # their log files to var/log so it should be created @@ -2037,14 +2081,6 @@ sub check_ndbcluster_support ($) { $opt_skip_ndbcluster_slave= 1; return; } - elsif ( -e "$glob_basedir/bin" && ! -f "$glob_basedir/bin/ndbd") - { - # Binary dist with a mysqld that supports ndb, but no ndbd found - mtr_report("Skipping ndbcluster, can't fint binaries"); - $opt_skip_ndbcluster= 1; - $opt_skip_ndbcluster_slave= 1; - return; - } $glob_ndbcluster_supported= 1; mtr_report("Using ndbcluster when necessary, mysqld supports it"); @@ -2475,7 +2511,8 @@ sub mysql_install_db () { my $cluster_started_ok= 1; # Assume it can be started - if ($opt_skip_ndbcluster || $glob_use_running_ndbcluster) + if ($opt_skip_ndbcluster || $glob_use_running_ndbcluster || + $clusters->[0]->{executable_setup_failed}) { # Don't install master cluster } @@ -2486,7 +2523,8 @@ sub mysql_install_db () { } if ($max_slave_num == 0 || - $opt_skip_ndbcluster_slave || $glob_use_running_ndbcluster_slave) + $opt_skip_ndbcluster_slave || $glob_use_running_ndbcluster_slave || + $clusters->[1]->{executable_setup_failed}) { # Don't install slave cluster } @@ -2760,6 +2798,16 @@ sub run_testcase_check_skip_test($) last if ($opt_skip_ndbcluster_slave and $cluster->{'name'} eq 'Slave'); + # If test needs this cluster, check binaries was found ok + if ( $cluster->{'executable_setup_failed'} ) + { + mtr_report_test_name($tinfo); + $tinfo->{comment}= + "Failed to find cluster binaries"; + mtr_report_test_failed($tinfo); + return 1; + } + # If test needs this cluster, check it was installed ok if ( !$cluster->{'installed_ok'} ) { @@ -2769,6 +2817,20 @@ sub run_testcase_check_skip_test($) mtr_report_test_failed($tinfo); return 1; } + + } + } + + if ( $tinfo->{'component_id'} eq 'im' ) + { + # If test needs im, check binaries was found ok + if ( $instance_manager->{'executable_setup_failed'} ) + { + mtr_report_test_name($tinfo); + $tinfo->{comment}= + "Failed to find MySQL manager binaries"; + mtr_report_test_failed($tinfo); + return 1; } } @@ -2861,6 +2923,56 @@ sub find_testcase_skipped_reason($) } +sub analyze_testcase_failure_sync_with_master($) +{ + my ($tinfo)= @_; + + my $args; + mtr_init_args(\$args); + + 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); + + mtr_add_arg($args, "--socket=%s", $master->[0]->{'path_sock'}); + mtr_add_arg($args, "--port=%d", $master->[0]->{'port'}); + mtr_add_arg($args, "--database=test"); + mtr_add_arg($args, "--user=%s", $opt_user); + mtr_add_arg($args, "--password="); + + # Run the test file and append output to log file + mtr_run_test($exe_mysqltest,$args, + "include/analyze_failure_sync_with_master.test", + "$path_timefile", "$path_timefile","", + { append_log_file => 1 }); + +} + +sub analyze_testcase_failure($) +{ + my ($tinfo)= @_; + + # Open mysqltest.log + my $F= IO::File->new($path_timefile) or + mtr_error("can't open file \"$path_timefile\": $!"); + + while ( my $line= <$F> ) + { + # Look for "mysqltest: At line nnn: <error> + if ( $line =~ /mysqltest: At line [0-9]*: (.*)/ ) + { + my $error= $1; + # Look for "could not sync with master" + if ( $error =~ /could not sync with master/ ) + { + analyze_testcase_failure_sync_with_master($tinfo); + } + } + } +} + ############################################################################## # # Run a single test case @@ -2880,6 +2992,13 @@ sub find_testcase_skipped_reason($) sub run_testcase ($) { my $tinfo= shift; + # ------------------------------------------------------- + # Init variables that can change between each test case + # ------------------------------------------------------- + + $ENV{'TZ'}= $tinfo->{'timezone'}; + mtr_verbose("Starting server with timezone: $tinfo->{'timezone'}"); + my $master_restart= run_testcase_need_master_restart($tinfo); my $slave_restart= run_testcase_need_slave_restart($tinfo); @@ -2942,6 +3061,10 @@ sub run_testcase ($) { } elsif ( $res == 1 ) { + if ( $opt_force ) + { + analyze_testcase_failure($tinfo); + } # Test case failure reported by mysqltest report_failure_and_restart($tinfo); } @@ -3409,6 +3532,9 @@ sub mysqld_start ($$$) { my $type= $mysqld->{'type'}; my $idx= $mysqld->{'idx'}; + mtr_error("Internal error: mysqld should never be started for embedded") + if $glob_use_embedded_server; + if ( $type eq 'master' ) { $exe= $exe_master_mysqld; @@ -3849,12 +3975,6 @@ sub run_testcase_start_servers($) { my $tinfo= shift; my $tname= $tinfo->{'name'}; - # ------------------------------------------------------- - # Init variables that can change between server starts - # ------------------------------------------------------- - $ENV{'TZ'}= $tinfo->{'timezone'}; - mtr_verbose("Starting server with timezone: $tinfo->{'timezone'}"); - if ( $tinfo->{'component_id'} eq 'mysqld' ) { if ( ! $opt_skip_ndbcluster and diff --git a/mysql-test/r/mysqldump-max.result b/mysql-test/r/mysqldump-max.result index 613db96be93..e78fc4d386a 100644 --- a/mysql-test/r/mysqldump-max.result +++ b/mysql-test/r/mysqldump-max.result @@ -1,21 +1,4 @@ -drop table if exists t1; -Warnings: -Note 1051 Unknown table 't1' -drop table if exists t2; -Warnings: -Note 1051 Unknown table 't2' -drop table if exists t3; -Warnings: -Note 1051 Unknown table 't3' -drop table if exists t4; -Warnings: -Note 1051 Unknown table 't4' -drop table if exists t5; -Warnings: -Note 1051 Unknown table 't5' -drop table if exists t6; -Warnings: -Note 1051 Unknown table 't6' +drop table if exists t1, t2, t3, t4, t5, t6; create table t1 (id int(8), name varchar(32)); create table t2 (id int(8), name varchar(32)) ENGINE="MyISAM"; create table t3 (id int(8), name varchar(32)) ENGINE="MEMORY"; diff --git a/mysql-test/r/rpl_trigger.result b/mysql-test/r/rpl_trigger.result index bd6d6e63d57..50bcd071d23 100644 --- a/mysql-test/r/rpl_trigger.result +++ b/mysql-test/r/rpl_trigger.result @@ -74,8 +74,6 @@ get_lock("bug12480",2) 1 create table t1 (a datetime,b datetime, c datetime); drop function if exists bug12480; -Warnings: -Note 1305 FUNCTION bug12480 does not exist create function bug12480() returns datetime begin set @a=get_lock("bug12480",2); diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result index 0b6bdfda6bc..595c15afcc2 100644 --- a/mysql-test/r/type_newdecimal.result +++ b/mysql-test/r/type_newdecimal.result @@ -978,8 +978,6 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; drop procedure if exists wg2; -Warnings: -Note 1305 PROCEDURE wg2 does not exist create procedure wg2() begin declare v int default 1; diff --git a/mysql-test/t/mysqldump-max.test b/mysql-test/t/mysqldump-max.test index fbea84808b4..359c4ea5793 100644 --- a/mysql-test/t/mysqldump-max.test +++ b/mysql-test/t/mysqldump-max.test @@ -3,14 +3,9 @@ --source include/have_innodb.inc --source include/have_archive.inc ---disable-warnings -drop table if exists t1; -drop table if exists t2; -drop table if exists t3; -drop table if exists t4; -drop table if exists t5; -drop table if exists t6; ---enable-warnings +--disable_warnings +drop table if exists t1, t2, t3, t4, t5, t6; +--enable_warnings create table t1 (id int(8), name varchar(32)); create table t2 (id int(8), name varchar(32)) ENGINE="MyISAM"; diff --git a/mysql-test/t/rpl_ndb_auto_inc.test b/mysql-test/t/rpl_ndb_auto_inc.test index 0fc31de9b3a..53bb7e764f1 100644 --- a/mysql-test/t/rpl_ndb_auto_inc.test +++ b/mysql-test/t/rpl_ndb_auto_inc.test @@ -6,6 +6,7 @@ # Date: 2006-02-10 # Change: Augmented test to use with cluster ##################################### +--source include/have_ndb.inc --source include/master-slave.inc --source include/have_binlog_format_mixed_or_row.inc diff --git a/mysql-test/t/rpl_trigger.test b/mysql-test/t/rpl_trigger.test index 279574a8aaa..6ec0021635a 100644 --- a/mysql-test/t/rpl_trigger.test +++ b/mysql-test/t/rpl_trigger.test @@ -70,7 +70,7 @@ select get_lock("bug12480",2); connection default; create table t1 (a datetime,b datetime, c datetime); ---ignore_warnings +--disable_warnings drop function if exists bug12480; --enable_warnings diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test index 6bf18b30c41..1b80a15e4ff 100644 --- a/mysql-test/t/type_newdecimal.test +++ b/mysql-test/t/type_newdecimal.test @@ -1000,9 +1000,9 @@ drop table t1; # # Bug 12938 (arithmetic loop's zero) # ---disable-warnings +--disable_warnings drop procedure if exists wg2; ---enable-warnings +--enable_warnings delimiter //; create procedure wg2() begin |