From 1f09ede4e4adf8deccb2069e321b7157d1b224d2 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 Nov 2008 23:37:54 +0100 Subject: [PATCH 1/6] Merge from mysql-5.0.72-release From 39be835d9c1e00b4c50f20316859a7ac487fe229 Mon Sep 17 00:00:00 2001 From: Magnus Svensson Date: Fri, 21 Nov 2008 08:57:46 +0100 Subject: [PATCH 2/6] mtr - temporarily turn on verbose --- mysql-test/mysql-test-run.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 69fc2924698..5095482335d 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -118,7 +118,7 @@ our $opt_vs_config = $ENV{'MTR_VS_CONFIG'}; my $DEFAULT_SUITES= "main,binlog,federated,rpl,rpl_ndb,ndb"; my $opt_suites; -our $opt_verbose= 0; # Verbose output, enable with --verbose +our $opt_verbose= 1; # Verbose output, enable with --verbose our $exe_mysql; our $exe_mysqladmin; From 66ced5f49035bdbe2a8d5e318ad456350f62cfe4 Mon Sep 17 00:00:00 2001 From: Magnus Svensson Date: Fri, 21 Nov 2008 13:45:28 +0100 Subject: [PATCH 3/6] Bug#40891 test suite timeouts on valgrind host in pushbuild --- mysql-test/mysql-test-run.pl | 68 ++++++++++++++++++++++++++++++------ 1 file changed, 58 insertions(+), 10 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 5095482335d..1cd3fad90ae 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -118,7 +118,7 @@ our $opt_vs_config = $ENV{'MTR_VS_CONFIG'}; my $DEFAULT_SUITES= "main,binlog,federated,rpl,rpl_ndb,ndb"; my $opt_suites; -our $opt_verbose= 1; # Verbose output, enable with --verbose +our $opt_verbose= 0; # Verbose output, enable with --verbose our $exe_mysql; our $exe_mysqladmin; @@ -186,6 +186,10 @@ my $opt_suite_timeout = 300; # minutes my $opt_shutdown_timeout= 10; # seconds my $opt_start_timeout = 180; # seconds +sub testcase_timeout { return $opt_testcase_timeout * 60; }; +sub suite_timeout { return $opt_suite_timeout * 60; }; +sub check_timeout { return $opt_testcase_timeout * 6; }; + my $opt_start; my $opt_start_dirty; my $opt_repeat= 1; @@ -409,7 +413,7 @@ sub run_test_server ($$$) { my %running; my $result; - my $suite_timeout_proc= My::SafeProcess->timer($opt_suite_timeout * 60); + my $suite_timeout_proc= My::SafeProcess->timer(suite_timeout()); my $s= IO::Select->new(); $s->add($server); @@ -1166,7 +1170,18 @@ sub command_line_setup { } } - # + # -------------------------------------------------------------------------- + # Check timeout arguments + # -------------------------------------------------------------------------- + + mtr_error("Invalid value '$opt_testcase_timeout' supplied ". + "for option --testcase-timeout") + if ($opt_testcase_timeout <= 0); + mtr_error("Invalid value '$opt_suite_timeout' supplied ". + "for option --testsuite-timeout") + if ($opt_suite_timeout <= 0); + + # -------------------------------------------------------------------------- # Check valgrind arguments # -------------------------------------------------------------------------- if ( $opt_valgrind or $opt_valgrind_path or @valgrind_args) @@ -2752,6 +2767,8 @@ sub check_testcase($$) # Return immediately if no check proceess was started return 0 unless ( keys %started ); + my $timeout_proc= My::SafeProcess->timer(check_timeout()); + while (1){ my $result; my $proc= My::SafeProcess->wait_any(); @@ -2778,6 +2795,9 @@ sub check_testcase($$) if ( keys(%started) == 0){ # All checks completed + + $timeout_proc->kill(); + return 0; } # Wait for next process to exit @@ -2817,6 +2837,12 @@ sub check_testcase($$) } } + elsif ( $proc eq $timeout_proc ) { + $tinfo->{comment}.= "Timeout $timeout_proc for ". + "'check-testcase' expired after ".check_timeout(). + " seconds"; + $result= 4; + } else { # Unknown process returned, most likley a crash, abort everything $tinfo->{comment}= @@ -2828,8 +2854,12 @@ sub check_testcase($$) # Kill any check processes still running map($_->kill(), values(%started)); + $timeout_proc->kill(); + return $result; } + + mtr_error("INTERNAL_ERROR: check_testcase"); } @@ -2896,7 +2926,7 @@ sub run_on_all($$) # Return immediately if no check proceess was started return 0 unless ( keys %started ); - my $timeout_proc= My::SafeProcess->timer(60); # Seconds + my $timeout_proc= My::SafeProcess->timer(check_timeout()); while (1){ my $result; @@ -2927,7 +2957,9 @@ sub run_on_all($$) next; } elsif ( $proc eq $timeout_proc ) { - $tinfo->{comment}.= "Timeout $timeout_proc expired for running '$run'"; + $tinfo->{comment}.= "Timeout $timeout_proc for '$run' ". + "expired after ". check_timeout(). + " seconds"; } else { # Unknown process returned, most likley a crash, abort everything @@ -2942,6 +2974,7 @@ sub run_on_all($$) return 1; } + mtr_error("INTERNAL_ERROR: run_on_all"); } @@ -3125,7 +3158,7 @@ sub run_testcase ($) { exit(1); } - my $test_timeout_proc= My::SafeProcess->timer($opt_testcase_timeout * 60); + my $test_timeout_proc= My::SafeProcess->timer(testcase_timeout()); do_before_run_mysqltest($tinfo); @@ -3270,14 +3303,16 @@ sub run_testcase ($) { { my $log_file_name= $opt_vardir."/log/".$tinfo->{shortname}.".log"; $tinfo->{comment}= - "Test case timeout after $opt_testcase_timeout minute(s)\n\n"; + "Test case timeout after ".testcase_timeout(). + " seconds\n\n"; # Add 20 last executed commands from test case log file if (-e $log_file_name) { $tinfo->{comment}.= - "== $log_file_name == \n" . mtr_lastlinesfromfile($log_file_name, 20)."\n"; + "== $log_file_name == \n". + mtr_lastlinesfromfile($log_file_name, 20)."\n"; } - $tinfo->{'timeout'}= $opt_testcase_timeout; # Mark as timeout + $tinfo->{'timeout'}= testcase_timeout(); # Mark as timeout run_on_all($tinfo, 'analyze-timeout'); report_failure_and_restart($tinfo); return 1; @@ -3371,6 +3406,8 @@ sub check_warnings ($) { # Return immediately if no check proceess was started return 0 unless ( keys %started ); + my $timeout_proc= My::SafeProcess->timer(check_timeout()); + while (1){ my $result= 0; my $proc= My::SafeProcess->wait_any(); @@ -3403,6 +3440,9 @@ sub check_warnings ($) { if ( keys(%started) == 0){ # All checks completed + + $timeout_proc->kill(); + return $result; } # Wait for next process to exit @@ -3421,6 +3461,12 @@ sub check_warnings ($) { # Remove the .err file the check generated unlink($err_file); } + elsif ( $proc eq $timeout_proc ) { + $tinfo->{comment}.= "Timeout $timeout_proc for ". + "'check warnings' expired after ".check_timeout(). + " seconds"; + $result= 4; + } else { # Unknown process returned, most likley a crash, abort everything $tinfo->{comment}= @@ -3431,10 +3477,12 @@ sub check_warnings ($) { # Kill any check processes still running map($_->kill(), values(%started)); + $timeout_proc->kill(); + return $result; } - return $res; + mtr_error("INTERNAL_ERROR: check_warnings"); } From 82efca8d6b97ed2d4e95d980180002da3417ce7f Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Tue, 25 Nov 2008 17:51:02 +0100 Subject: [PATCH 4/6] Clarified the error message printed when mtr's test cleanup check fails. mysql-test/mysql-test-run.pl: Clarified error message printed when test cleanup check fails. --- mysql-test/mysql-test-run.pl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 1cd3fad90ae..049dbb4aceb 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2810,8 +2810,12 @@ sub check_testcase($$) # Test failed, grab the report mysqltest has created my $report= mtr_grab_file($err_file); $tinfo->{check}.= - "\nThe check of testcase '$tname' failed, this is the\n". - "diff between before and after:\n"; + "\nMTR's internal check of the test case '$tname' failed. +This means that the test case does not preserve the state that existed +before the test case was executed. Most likely the test case did not +do a proper clean-up. +This is the diff of the states of the servers before and after the +test case was executed:\n"; $tinfo->{check}.= $report; # Check failed, mark the test case with that info From 28ce657919b5679248c2af83c98118c6674bfcd2 Mon Sep 17 00:00:00 2001 From: Serge Kozlov Date: Thu, 27 Nov 2008 15:04:48 +0300 Subject: [PATCH 5/6] Bug#40708: Sometimes DB mysqltest1 did not removed before starting test rpl_row_create_table therefore the patch add the cleanup operation if DB with such name already exists. --- mysql-test/suite/rpl/r/rpl_row_create_table.result | 2 ++ mysql-test/suite/rpl/t/rpl_row_create_table.test | 3 +++ 2 files changed, 5 insertions(+) diff --git a/mysql-test/suite/rpl/r/rpl_row_create_table.result b/mysql-test/suite/rpl/r/rpl_row_create_table.result index ad659c37b7f..b6dede79b9d 100644 --- a/mysql-test/suite/rpl/r/rpl_row_create_table.result +++ b/mysql-test/suite/rpl/r/rpl_row_create_table.result @@ -436,11 +436,13 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; +DROP DATABASE IF EXISTS mysqltest1; CREATE DATABASE mysqltest1; CREATE TABLE mysqltest1.without_select (f1 BIGINT); CREATE TABLE mysqltest1.with_select AS SELECT 1 AS f1; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # DROP DATABASE IF EXISTS mysqltest1 master-bin.000001 # Query # # CREATE DATABASE mysqltest1 master-bin.000001 # Query # # use `test`; CREATE TABLE mysqltest1.without_select (f1 BIGINT) master-bin.000001 # Query # # use `test`; BEGIN diff --git a/mysql-test/suite/rpl/t/rpl_row_create_table.test b/mysql-test/suite/rpl/t/rpl_row_create_table.test index 3fb5aa8e1f2..e4825a4abfd 100644 --- a/mysql-test/suite/rpl/t/rpl_row_create_table.test +++ b/mysql-test/suite/rpl/t/rpl_row_create_table.test @@ -266,6 +266,9 @@ sync_slave_with_master; source include/master-slave-reset.inc; connection master; +--disable_warnings +DROP DATABASE IF EXISTS mysqltest1; +--enable_warnings CREATE DATABASE mysqltest1; CREATE TABLE mysqltest1.without_select (f1 BIGINT); From 011d84bb2769fe765e46dfba60acfa2de4e91b53 Mon Sep 17 00:00:00 2001 From: Serge Kozlov Date: Thu, 27 Nov 2008 15:15:14 +0300 Subject: [PATCH 6/6] Bug#40145. Argument for LOAD_FILE() can be too long and sometimes a query with two or more these functions truncated. Therefore data from each LOAD_FILE() copied into its local variables and then used in a query. --- mysql-test/r/general_log_func.result | 7 ++++--- mysql-test/t/general_log_func.test | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/general_log_func.result b/mysql-test/r/general_log_func.result index 012a1383497..4b6cbda6eff 100644 --- a/mysql-test/r/general_log_func.result +++ b/mysql-test/r/general_log_func.result @@ -27,9 +27,10 @@ INSERT into t1(name) values('Record_3'); INSERT into t1(name) values('Record_4'); ## There should be a difference ## SET @@session.max_allowed_packet= 1024*1024*1024; -select -STRCMP(load_file('MYSQLD_LOGFILE.orig'), load_file('MYSQLD_LOGFILE.copy')); -STRCMP(load_file('MYSQLD_LOGFILE.orig'), load_file('MYSQLD_LOGFILE.copy')) +SET @orig_file= load_file('MYSQLD_LOGFILE.orig'); +SET @copy_file= load_file('MYSQLD_LOGFILE.copy'); +SELECT STRCMP(@orig_file, @copy_file); +STRCMP(@orig_file, @copy_file) 1 ## Dropping tables ## DROP TABLE t1; diff --git a/mysql-test/t/general_log_func.test b/mysql-test/t/general_log_func.test index 3539b978c55..20b875388c1 100644 --- a/mysql-test/t/general_log_func.test +++ b/mysql-test/t/general_log_func.test @@ -81,8 +81,10 @@ INSERT into t1(name) values('Record_4'); --echo ## There should be a difference ## SET @@session.max_allowed_packet= 1024*1024*1024; --replace_result $MYSQLD_LOGFILE MYSQLD_LOGFILE -eval select - STRCMP(load_file('$MYSQLD_LOGFILE.orig'), load_file('$MYSQLD_LOGFILE.copy')); +eval SET @orig_file= load_file('$MYSQLD_LOGFILE.orig'); +--replace_result $MYSQLD_LOGFILE MYSQLD_LOGFILE +eval SET @copy_file= load_file('$MYSQLD_LOGFILE.copy'); +eval SELECT STRCMP(@orig_file, @copy_file); --remove_file $MYSQLD_LOGFILE.copy --remove_file $MYSQLD_LOGFILE.orig