diff --git a/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test b/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test index ee6b0ed1426..0baf49c9fac 100644 --- a/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test +++ b/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test @@ -4,8 +4,7 @@ # Test of FLUSH NO_WRITE_TO_BINLOG by the way. # - --- source include/master-slave.inc +source include/master-slave.inc; let $SERVER_VERSION=`select version()`; @@ -34,26 +33,32 @@ flush tables; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ eval SHOW BINLOG EVENTS FROM $rename_event_pos ; -save_master_pos; -connection slave; -sync_with_master; + +sync_slave_with_master; # Check that the slave is not confused. select * from t3; # Note that all this confusion may cause warnings 'table xx is open on rename' # in the .err files; these are not fatal and are not reported by mysql-test-run. - stop slave; +source include/wait_for_slave_to_stop.inc; + connection master; drop table t1; + connection slave; flush tables with read lock; start slave; -sleep 1; +source include/wait_for_slave_to_start.inc; --error 1192 stop slave; +# Cleanup +unlock tables; + connection master; drop table t3, t4, t5; +sync_slave_with_master; + # End of 4.1 tests diff --git a/mysql-test/include/mtr_warnings.sql b/mysql-test/include/mtr_warnings.sql index b1eb094c4ee..999f9c1dde5 100644 --- a/mysql-test/include/mtr_warnings.sql +++ b/mysql-test/include/mtr_warnings.sql @@ -218,6 +218,8 @@ INSERT INTO global_suppressions VALUES -- CREATE DEFINER=root@localhost PROCEDURE check_warnings(OUT result INT) BEGIN + DECLARE `text` text charset utf8; + DECLARE `pos` bigint unsigned; -- Don't write these queries to binlog SET SQL_LOG_BIN=0; @@ -234,15 +236,17 @@ BEGIN WHERE variable_name='LOG_ERROR'; SET @@session.max_allowed_packet= 1024*1024*1024; - SET @text= load_file(@log_error); - -- select @text; + SET text= load_file(@log_error); + -- select text; - WHILE LOCATE('\n', @text) DO + SET pos= LOCATE('\n', text); + WHILE pos DO INSERT error_log (line) VALUES ( - SUBSTR(@text, 1, LOCATE('\n', @text)-1) + SUBSTR(text, 1, pos-1) ); - SET @text= SUBSTR(@text FROM LOCATE('\n', @text)+1); + SET text= SUBSTR(text FROM pos+1); + SET pos= LOCATE('\n', text); END WHILE; -- select * from error_log; @@ -287,6 +291,7 @@ BEGIN -- Cleanup for next test TRUNCATE test_suppressions; + DROP TABLE error_log, suspect_lines; END|| diff --git a/mysql-test/include/rpl_multi_engine.inc b/mysql-test/include/rpl_multi_engine.inc index f2c837ef90b..b2d1a9c1cef 100644 --- a/mysql-test/include/rpl_multi_engine.inc +++ b/mysql-test/include/rpl_multi_engine.inc @@ -9,7 +9,7 @@ select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; sync_slave_with_master; select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; connection master; -DELETE FROM mysqltest1.t1 WHERE id = 42; +DELETE FROM t1 WHERE id = 42; select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; sync_slave_with_master; select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; diff --git a/mysql-test/include/wait_for_slave_sql_error.inc b/mysql-test/include/wait_for_slave_sql_error.inc index c454e3eb4d7..2d392f0e761 100644 --- a/mysql-test/include/wait_for_slave_sql_error.inc +++ b/mysql-test/include/wait_for_slave_sql_error.inc @@ -7,15 +7,29 @@ # # source include/wait_for_slave_sql_error.inc; # -# Parameters to this macro are $slave_timeout and -# $slave_keep_connection. See wait_for_slave_param.inc for -# descriptions. +# Parameters: +# +# $slave_sql_errno +# Number of expected SQL error. If it skipped then any error +# will pass. +# +# $slave_timeout and +# See wait_for_slave_param.inc for descriptions. +# +# $slave_keep_connection. +# See wait_for_slave_param.inc for descriptions. let $old_slave_param_comparison= $slave_param_comparison; let $slave_param= Last_SQL_Errno; let $slave_param_comparison= !=; let $slave_param_value= 0; + +if ($slave_sql_errno) { + let $slave_param_comparison= =; + let $slave_param_value= $slave_sql_errno; +} + let $slave_error_message= Failed while waiting for slave to produce an error in its sql thread; source include/wait_for_slave_param.inc; let $slave_error_message= ; diff --git a/mysql-test/include/wait_until_disconnected.inc b/mysql-test/include/wait_until_disconnected.inc index 66a09f3c971..956ab3c1845 100644 --- a/mysql-test/include/wait_until_disconnected.inc +++ b/mysql-test/include/wait_until_disconnected.inc @@ -4,7 +4,7 @@ --disable_result_log --disable_query_log let $counter= 500; -let $mysql_errno= 9999; +let $mysql_errno= 0; while (!$mysql_errno) { --error 0,1053,2002,2006 diff --git a/mysql-test/lib/mtr_report.pm b/mysql-test/lib/mtr_report.pm index 6a46a372c45..70d0a5be687 100644 --- a/mysql-test/lib/mtr_report.pm +++ b/mysql-test/lib/mtr_report.pm @@ -1,5 +1,5 @@ # -*- cperl -*- -# Copyright (C) 2004-2006 MySQL AB +# Copyright (C) 2004-2006 MySQL AB, 2008 Sun Microsystems, Inc. # # 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 @@ -110,22 +110,26 @@ sub mtr_report_test ($) { if ($result eq 'MTR_RES_FAILED'){ + my $timest = format_time(); + if ( $warnings ) { mtr_report("[ fail ] Found warnings in server log file!"); + mtr_report(" Test ended at $timest"); mtr_report($warnings); return; } my $timeout= $tinfo->{'timeout'}; if ( $timeout ) { - mtr_report("[ fail ] timeout after $timeout minutes"); + mtr_report("[ fail ] timeout after $timeout seconds"); + mtr_report(" Test ended at $timest"); mtr_report("\n$tinfo->{'comment'}"); return; } else { - mtr_report("[ fail ]"); + mtr_report("[ fail ]\n Test ended at $timest"); } if ( $logfile ) @@ -372,6 +376,13 @@ use Time::localtime; use Time::HiRes qw(gettimeofday); +sub format_time { + my $tm= localtime(); + return sprintf("%4d-%02d-%02d %02d:%02d:%02d", + $tm->year + 1900, $tm->mon+1, $tm->mday, + $tm->hour, $tm->min, $tm->sec); +} + my $t0= gettimeofday(); sub _timestamp { 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 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/suite/rpl/r/rpl_multi_engine.result b/mysql-test/suite/rpl/r/rpl_multi_engine.result index 7cb7d873415..e26777c15ce 100644 --- a/mysql-test/suite/rpl/r/rpl_multi_engine.result +++ b/mysql-test/suite/rpl/r/rpl_multi_engine.result @@ -4,13 +4,10 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; -create database if not exists mysqltest1; -use mysqltest1; drop table if exists t1; CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, f FLOAT DEFAULT 0, total BIGINT UNSIGNED, y YEAR, t TIMESTAMP,PRIMARY KEY(id)); -use mysqltest1; alter table t1 engine=myisam; show create table t1; Table Create Table @@ -55,7 +52,7 @@ id hex(b1) vc bc d f total y t select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; id hex(b1) vc bc d f total y t 42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00 -DELETE FROM mysqltest1.t1 WHERE id = 42; +DELETE FROM t1 WHERE id = 42; select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; id hex(b1) vc bc d f total y t select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; @@ -89,7 +86,7 @@ id hex(b1) vc bc d f total y t select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; id hex(b1) vc bc d f total y t 42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00 -DELETE FROM mysqltest1.t1 WHERE id = 42; +DELETE FROM t1 WHERE id = 42; select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; id hex(b1) vc bc d f total y t select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; @@ -123,7 +120,7 @@ id hex(b1) vc bc d f total y t select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; id hex(b1) vc bc d f total y t 42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00 -DELETE FROM mysqltest1.t1 WHERE id = 42; +DELETE FROM t1 WHERE id = 42; select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; id hex(b1) vc bc d f total y t select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; @@ -172,7 +169,7 @@ id hex(b1) vc bc d f total y t select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; id hex(b1) vc bc d f total y t 42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00 -DELETE FROM mysqltest1.t1 WHERE id = 42; +DELETE FROM t1 WHERE id = 42; select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; id hex(b1) vc bc d f total y t select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; @@ -206,7 +203,7 @@ id hex(b1) vc bc d f total y t select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; id hex(b1) vc bc d f total y t 42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00 -DELETE FROM mysqltest1.t1 WHERE id = 42; +DELETE FROM t1 WHERE id = 42; select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; id hex(b1) vc bc d f total y t select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; @@ -240,7 +237,7 @@ id hex(b1) vc bc d f total y t select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; id hex(b1) vc bc d f total y t 42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00 -DELETE FROM mysqltest1.t1 WHERE id = 42; +DELETE FROM t1 WHERE id = 42; select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; id hex(b1) vc bc d f total y t select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; @@ -289,7 +286,7 @@ id hex(b1) vc bc d f total y t select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; id hex(b1) vc bc d f total y t 42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00 -DELETE FROM mysqltest1.t1 WHERE id = 42; +DELETE FROM t1 WHERE id = 42; select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; id hex(b1) vc bc d f total y t select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; @@ -323,7 +320,7 @@ id hex(b1) vc bc d f total y t select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; id hex(b1) vc bc d f total y t 42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00 -DELETE FROM mysqltest1.t1 WHERE id = 42; +DELETE FROM t1 WHERE id = 42; select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; id hex(b1) vc bc d f total y t select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; @@ -357,10 +354,9 @@ id hex(b1) vc bc d f total y t select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; id hex(b1) vc bc d f total y t 42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00 -DELETE FROM mysqltest1.t1 WHERE id = 42; +DELETE FROM t1 WHERE id = 42; select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; id hex(b1) vc bc d f total y t select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; id hex(b1) vc bc d f total y t DROP TABLE t1; -DROP DATABASE mysqltest1; 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/r/rpl_row_flsh_tbls.result b/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result index 09626754428..129bad0fbcc 100644 --- a/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result +++ b/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result @@ -30,4 +30,5 @@ flush tables with read lock; start slave; stop slave; ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction +unlock tables; drop table t3, t4, t5; diff --git a/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result b/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result index 1c6b5615b6e..74031af1dde 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result +++ b/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result @@ -30,4 +30,5 @@ flush tables with read lock; start slave; stop slave; ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction +unlock tables; drop table t3, t4, t5; diff --git a/mysql-test/suite/rpl/t/rpl_multi_engine.test b/mysql-test/suite/rpl/t/rpl_multi_engine.test index 10780c765f7..31c4a2050d7 100644 --- a/mysql-test/suite/rpl/t/rpl_multi_engine.test +++ b/mysql-test/suite/rpl/t/rpl_multi_engine.test @@ -12,16 +12,14 @@ connection slave; connection master; -- source include/have_innodb.inc --disable_warnings -create database if not exists mysqltest1; -use mysqltest1; drop table if exists t1; +--enable_warnings CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, f FLOAT DEFAULT 0, total BIGINT UNSIGNED, y YEAR, t TIMESTAMP,PRIMARY KEY(id)); sync_slave_with_master; -use mysqltest1; # MyISAM to MyISAM then InnoDB then MEMORY @@ -101,8 +99,6 @@ show create table t1; # cleanup connection master; DROP TABLE t1; -# Need to drop mysqltest1 as well so other test will pass. -DROP DATABASE mysqltest1; sync_slave_with_master; # End of 5.1 test case 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); diff --git a/mysql-test/suite/rpl/t/rpl_start_stop_slave.test b/mysql-test/suite/rpl/t/rpl_start_stop_slave.test index 93c613f4cf4..dbf0775c978 100644 --- a/mysql-test/suite/rpl/t/rpl_start_stop_slave.test +++ b/mysql-test/suite/rpl/t/rpl_start_stop_slave.test @@ -25,6 +25,7 @@ let $wait_condition= SELECT COUNT(*) > 0 FROM t1; source include/wait_condition.inc; stop slave io_thread; start slave io_thread; +source include/wait_for_slave_to_start.inc; sync_with_master; connection master; diff --git a/mysql-test/suite/rpl/t/rpl_stm_mystery22.test b/mysql-test/suite/rpl/t/rpl_stm_mystery22.test index b43a734fffc..171bd9d5531 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_mystery22.test +++ b/mysql-test/suite/rpl/t/rpl_stm_mystery22.test @@ -28,6 +28,7 @@ insert into t1 values(NULL,'new'); save_master_pos; connection slave; # wait until the slave tries to run the query, fails and aborts slave thread +let $slave_sql_errno= 1062; source include/wait_for_slave_sql_error.inc; select * from t1 order by n; delete from t1 where n = 2; diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index e9357c2c048..2e20ea14207 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -25,3 +25,4 @@ timestamp_func : BUG#37962 2008-07-08 sven *_func tests c log_output_func : BUG#37766 2008-07-10 sven main.log_output_func randomly fails in pushbuild slow_query_log_func.test : Bug #37962: *_func tests containing sleeps/race conditions log_bin_trust_function_creators_func : Bug#41003 Dec-12-2008 andrei todo:re-enable after merging the bug fixes from the main trees. +innodb_max_dirty_pages_pct_func : BUG#41018 BUG#39382 2008-12-02 sven test fails often. some failures fill up the disk, causing subsequent failures in many other tests 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