summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorSven Sandberg <sven@mysql.com>2008-07-10 18:09:39 +0200
committerSven Sandberg <sven@mysql.com>2008-07-10 18:09:39 +0200
commit6e69536956b15d72c0943c1235b71044ec48138c (patch)
tree7e30a569062abb6dd5dbca89c6ce5c34ab523780 /mysql-test/t
parentd034ae598f8572f702e5b0bba8ffe9906235151a (diff)
downloadmariadb-git-6e69536956b15d72c0943c1235b71044ec48138c.tar.gz
BUG#37975: wait_for_slave_* should increase the timeout
Problem 1: tests often fail in pushbuild with a timeout when waiting for the slave to start/stop/receive error. Fix 1: Updated the wait_for_slave_* macros in the following way: - The timeout is increased by a factor ten - Refactored the macros so that wait_for_slave_param does the work for the other macros. Problem 2: Tests are often incorrectly written, lacking a source include/wait_for_slave_to_[start|stop].inc. Fix 2: Improved the chance to get it right by adding include/start_slave.inc and include/stop_slave.inc, and updated tests to use these. Problem 3: The the built-in test language command wait_for_slave_to_stop is a misnomer (does not wait for the slave io thread) and does not give as much debug info in case of failure as the otherwise equivalent macro source include/wait_for_slave_sql_to_stop.inc Fix 3: Replaced all calls to the built-in command by a call to the macro. Problem 4: Some, but not all, of the wait_for_slave_* macros had an implicit connection slave. This made some tests confusing to read, and made it more difficult to use the macro in circular replication scenarios, where the connection named master needs to wait. Fix 4: Removed the implicit connection slave from all wait_for_slave_* macros, and updated tests to use an explicit connection slave where necessary. Problem 5: The macros wait_slave_status.inc and wait_show_pattern.inc were unused. Moreover, using them is difficult and error-prone. Fix 5: remove these macros. Problem 6: log_bin_trust_function_creators_basic failed when running tests because it assumed @@global.log_bin_trust_function_creators=1, and some tests modified this variable without resetting it to its original value. Fix 6: All tests that use this variable have been updated so that they reset the value at end of test. mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test: Replaced wait_for_slave_to_stop by include/wait_for_slave_sql_to_stop.inc mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test: Replaced wait_for_slave_to_stop by include/wait_for_slave_sql_to_stop.inc Added connection slave since includ/wait_for_slave_sql_to_stop.inc does not do that anymore. mysql-test/extra/rpl_tests/rpl_log.test: Replaced start slave+wait_slave_status by start_slave.inc mysql-test/include/reset_master_and_slave.inc: replaced start/stop slave by start_slave.inc/stop_slave.inc mysql-test/include/sync_slave_io_with_master.inc: Improved comments and error message. mysql-test/include/wait_for_slave_io_to_stop.inc: Refactored to use wait_for_slave_param.inc. Removed connection slave. mysql-test/include/wait_for_slave_param.inc: - Improved usage instructions - Added more debug info in case of timeout - Added parameters $slave_param_comparison, $slave_timeout, $slave_keep_connection, $slave_error_message mysql-test/include/wait_for_slave_sql_error.inc: Refactored to use wait_for_slave_param.inc. Removed connection slave. mysql-test/include/wait_for_slave_sql_to_start.inc: Refactored to use wait_for_slave_param.inc. Removed connection slave. mysql-test/include/wait_for_slave_sql_to_stop.inc: Refactored to use wait_for_slave_param.inc. Removed connection slave. mysql-test/include/wait_for_slave_to_start.inc: Refactored to use wait_for_slave_param.inc. Removed connection slave. mysql-test/include/wait_for_slave_to_stop.inc: Refactored to use wait_for_slave_param.inc. Removed connection slave. mysql-test/include/wait_show_pattern.inc: Removed unused (and error-prone) file mysql-test/include/wait_slave_status.inc: Removed unused (and error-prone) file mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test: Renamed $keep_connection to $slave_keep_connection. mysql-test/suite/rpl/t/rpl_bug26395.test: Replace stop slave by stop_slave.inc mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test: Replace start/stop slave by start_slave.inc/stop_slave.inc. Replace wait_for_slave_param by wait_for_slave_sql_to_stop.inc. mysql-test/suite/rpl/t/rpl_dual_pos_advance.test: Renamed $keep_connection to $slave_keep_connection. mysql-test/suite/rpl/t/rpl_flushlog_loop.test: Replace wait_slave_status by start_slave.inc mysql-test/suite/rpl/t/rpl_idempotency.test: Added connection slave since wait_for_slave_sql_to_stop.inc does not do that any more. mysql-test/suite/rpl/t/rpl_incident.test: Replaced wait_for_slave_to_stop by wait_for_slave_sql_to_stop.inc mysql-test/suite/rpl/t/rpl_init_slave.test: Replaced start/stop slave by start_slave.inc/stop_slave.inc. Replaced save_master_pos;connection slave;sync_with_master by sync_slave_with_master. mysql-test/suite/rpl/t/rpl_log_pos.test: Replaced start/stop slave by start_slave.inc/stop_slave.inc. Replaced wait_for_slave_param by other wait_for_slave_* macros. mysql-test/suite/rpl/t/rpl_packet.test: Replaced start/stop slave by start_slave.inc/stop_slave.inc. mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test: Replaced start/stop slave by start_slave.inc/stop_slave.inc. mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test: Replaced start/stop slave by start_slave.inc/stop_slave.inc. mysql-test/suite/rpl/t/rpl_row_until.test: Replaced start/stop slave by start_slave.inc/stop_slave.inc. Replaced save_master_pos;connection slave;sync_with_master by sync_slave_with_master. mysql-test/suite/rpl/t/rpl_server_id1.test: Replaced start/stop slave by start_slave.inc/stop_slave.inc. mysql-test/suite/rpl/t/rpl_slave_grp_exec.test: Replaced start/stop slave by start_slave.inc/stop_slave.inc. mysql-test/suite/rpl/t/rpl_slave_skip.test: Replaced start/stop slave by start_slave.inc/stop_slave.inc. mysql-test/suite/rpl/t/rpl_slave_status.test: Replaced start/stop slave by start_slave.inc/stop_slave.inc. mysql-test/suite/rpl/t/rpl_sp.test: Restore @@global.log_bin_trust_function_creators at end of test. mysql-test/suite/rpl/t/rpl_sp_effects.test: Restore @@global.log_bin_trust_function_creators at end of test. mysql-test/suite/rpl/t/rpl_stm_until.test: Replaced start/stop slave by start_slave.inc/stop_slave.inc. Replaced save_master_pos;connection slave;sync_with_master by sync_slave_with_master. mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test: Replaced start slave by start_slave.inc. Added explicit connection slave since wait_for_slave_sql_to_stop.inc does not do that anymore. mysql-test/t/disabled.def: Disabled failing test. mysql-test/t/func_time.test: Restore @@global.log_bin_trust_function_creators at end of test. mysql-test/t/grant.test: Restore @@global.log_bin_trust_function_creators at end of test. mysql-test/t/grant2.test: Restore @@global.log_bin_trust_function_creators at end of test. mysql-test/t/innodb_notembedded.test: Restore @@global.log_bin_trust_function_creators at end of test. mysql-test/t/log_bin_trust_function_creators_func.test: Restore @@global.log_bin_trust_function_creators at end of test. Clean up at end of test by dropping the created user. mysql-test/t/query_cache.test: Restore @@global.log_bin_trust_function_creators at end of test. mysql-test/t/query_cache_notembedded.test: Restore @@global.log_bin_trust_function_creators at end of test. mysql-test/t/rpl_init_slave_func.test: Replaced start/stop slave by start_slave.inc/stop_slave.inc. mysql-test/t/timezone2.test: Restore @@global.log_bin_trust_function_creators at end of test.
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/disabled.def1
-rw-r--r--mysql-test/t/func_time.test2
-rw-r--r--mysql-test/t/grant.test3
-rw-r--r--mysql-test/t/grant2.test3
-rw-r--r--mysql-test/t/innodb_notembedded.test4
-rw-r--r--mysql-test/t/log_bin_trust_function_creators_func.test5
-rw-r--r--mysql-test/t/query_cache.test3
-rw-r--r--mysql-test/t/query_cache_notembedded.test4
-rw-r--r--mysql-test/t/rpl_init_slave_func.test3
-rw-r--r--mysql-test/t/timezone2.test3
10 files changed, 23 insertions, 8 deletions
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index b3b92066dda..dad6f3c56a1 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -106,3 +106,4 @@ rpl_max_binlog_size_func : BUG#37962 2008-07-08 sven *_func tests c
slow_query_log_func : BUG#37962 2008-07-08 sven *_func tests containing sleeps/race conditions
sql_low_priority_updates_func : BUG#37962 2008-07-08 sven *_func tests containing sleeps/race conditions
timestamp_func : BUG#37962 2008-07-08 sven *_func tests containing sleeps/race conditions
+log_output_func : BUG#37766 2008-07-10 sven main.log_output_func randomly fails in pushbuild
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test
index c417e9a02bf..3e5923157fe 100644
--- a/mysql-test/t/func_time.test
+++ b/mysql-test/t/func_time.test
@@ -606,6 +606,7 @@ select time_format('100:00:00', '%H %k %h %I %l');
# Bug #12562: Make SYSDATE behave like it does in Oracle: always the current
# time, regardless of magic to make NOW() always the same for the
# entirety of a statement.
+SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1;
create table t1 (a timestamp default '2005-05-05 01:01:01',
@@ -656,6 +657,7 @@ end;
delimiter ;//
call t_sysdate();
drop procedure t_sysdate;
+SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
#
# Bug #13534: timestampdiff() returned incorrect results across leap years
diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test
index 3fac767468e..853fd43028e 100644
--- a/mysql-test/t/grant.test
+++ b/mysql-test/t/grant.test
@@ -3,6 +3,7 @@
# Grant tests not performed with embedded server
-- source include/not_embedded.inc
+SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1;
# Cleanup
@@ -1468,4 +1469,4 @@ use test;
DROP DATABASE dbbug33464;
---echo End of 5.1 tests
+SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
diff --git a/mysql-test/t/grant2.test b/mysql-test/t/grant2.test
index 0f0c92e82eb..afdd2793207 100644
--- a/mysql-test/t/grant2.test
+++ b/mysql-test/t/grant2.test
@@ -488,6 +488,7 @@ flush privileges;
# BUG#13310 incorrect user parsing by SP
#
+SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1;
grant all privileges on test.* to `a@`@localhost;
@@ -512,7 +513,7 @@ connection default;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM `a@`@localhost;
drop user `a@`@localhost;
-SET GLOBAL log_bin_trust_function_creators = 0;
+SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
#
diff --git a/mysql-test/t/innodb_notembedded.test b/mysql-test/t/innodb_notembedded.test
index 2731f8e33ed..564b947c75e 100644
--- a/mysql-test/t/innodb_notembedded.test
+++ b/mysql-test/t/innodb_notembedded.test
@@ -5,6 +5,8 @@
drop table if exists t1;
--enable_warnings
+SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
+
connect (a,localhost,root,,);
connect (b,localhost,root,,);
@@ -39,4 +41,4 @@ drop table t1;
drop function f1;
disconnect a;
disconnect b;
-SET GLOBAL log_bin_trust_function_creators = 0;
+SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
diff --git a/mysql-test/t/log_bin_trust_function_creators_func.test b/mysql-test/t/log_bin_trust_function_creators_func.test
index db91128b225..52483ec281a 100644
--- a/mysql-test/t/log_bin_trust_function_creators_func.test
+++ b/mysql-test/t/log_bin_trust_function_creators_func.test
@@ -35,6 +35,7 @@ drop table if exists t1;
CREATE user tt@localhost;
--echo ## Setting value of variable to 0 ##
+SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET @@global.log_bin_trust_function_creators = 0;
--echo ## Creating new table t2 ##
@@ -119,3 +120,7 @@ drop table t1,t2;
--echo ## Disconnecting both the connections ##
disconnect test_con2;
+connection default;
+
+DROP USER tt@localhost;
+SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test
index 74cc97538aa..52e872c2b38 100644
--- a/mysql-test/t/query_cache.test
+++ b/mysql-test/t/query_cache.test
@@ -801,9 +801,10 @@ create procedure `p1`()
begin
select a, f1() from t1;
end//
+SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1;
call p1()//
-SET GLOBAL log_bin_trust_function_creators = 0;
+SET GLOBAL log_bin_trust_function_creators = @old_log_bin_trust_function_creators;
drop procedure p1//
drop function f1//
diff --git a/mysql-test/t/query_cache_notembedded.test b/mysql-test/t/query_cache_notembedded.test
index 929b93e10d5..ecb7bfc100e 100644
--- a/mysql-test/t/query_cache_notembedded.test
+++ b/mysql-test/t/query_cache_notembedded.test
@@ -183,6 +183,8 @@ drop table t1;
#
# bug#14767: INSERT in SF + concurrent SELECT with query cache
#
+connection default;
+SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1;
reset query cache;
@@ -224,7 +226,7 @@ disconnect con2;
connection default;
set GLOBAL query_cache_size=0;
-SET GLOBAL log_bin_trust_function_creators = 0;
+SET @@global.log_bin_trust_function_creators = @old_log_bin_trust_function_creators;
#
# Bug #30269 Query cache eats memory
diff --git a/mysql-test/t/rpl_init_slave_func.test b/mysql-test/t/rpl_init_slave_func.test
index b3d647f4394..f080a2b6814 100644
--- a/mysql-test/t/rpl_init_slave_func.test
+++ b/mysql-test/t/rpl_init_slave_func.test
@@ -73,8 +73,7 @@ sync_with_master;
SET @@global.init_slave = "SET @a=5";
-stop slave;
---wait_for_slave_to_stop
+source include/stop_slave.inc;
reset slave;
# Clean up old test tables
--disable_warnings
diff --git a/mysql-test/t/timezone2.test b/mysql-test/t/timezone2.test
index 4f70539ca8d..15ddceb8d68 100644
--- a/mysql-test/t/timezone2.test
+++ b/mysql-test/t/timezone2.test
@@ -228,6 +228,7 @@ drop table t1;
# Test for bug #11081 "Using a CONVERT_TZ function in a stored function
# or trigger fails".
#
+SET @old_log_bin_trust_function_creators = @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1;
create table t1 (ldt datetime, udt datetime);
@@ -243,7 +244,7 @@ select ldt, f1(udt) as ldt2 from t1;
drop table t1;
drop function f1;
-SET GLOBAL log_bin_trust_function_creators = 0;
+SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
# End of 5.0 tests