1
0
mirror of https://github.com/MariaDB/server.git synced 2025-10-25 18:38:00 +03:00

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.
This commit is contained in:
Sven Sandberg
2008-07-10 18:09:39 +02:00
parent d034ae598f
commit 6e69536956
77 changed files with 418 additions and 678 deletions

View File

@@ -21,7 +21,7 @@ a
1
[on slave]
==== Verify results on slave ====
STOP SLAVE;
include/stop_slave.inc
SELECT "" AS Slave_IO_State;
Slave_IO_State

View File

@@ -92,7 +92,7 @@ Master D 4 D
* Do failure for C and then make new connection B->D *
STOP SLAVE;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
START SLAVE;
include/start_slave.inc
INSERT INTO t1 VALUES(6,'C',2);
INSERT INTO t1(b,c) VALUES('B',2);
INSERT INTO t1(b,c) VALUES('A',2);
@@ -119,7 +119,7 @@ Master D 8 D
STOP SLAVE;
STOP SLAVE;
CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_B_PORT,master_user='root',master_log_file='LOG_FILE',master_log_pos=LOG_POS;
START SLAVE;
include/start_slave.inc
* Check data inserted before failure *
SELECT 'Master A',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
@@ -166,7 +166,7 @@ Master D 12 D
*** Testing restoring scheme A->B->C->D->A after failure ***
* Remove wrong event from C and restore B->C->D *
STOP SLAVE;
include/stop_slave.inc
DELETE FROM t1 WHERE a = 6;
START SLAVE;
RESET MASTER;

View File

@@ -18,11 +18,7 @@ start slave;
stop slave;
change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=SLAVE_PORT;
start slave;
let $result_pattern= '%127.0.0.1%root%slave-bin.000001%slave-bin.000001%Yes%Yes%0%0%None%' ;
--source include/wait_slave_status.inc
include/start_slave.inc
FLUSH LOGS;
SHOW SLAVE STATUS;
Slave_IO_State #

View File

@@ -103,10 +103,10 @@ DROP PROCEDURE just_log;
DROP PROCEDURE calc_and_log;
DROP FUNCTION log_rows;
**** Resetting master and slave ****
STOP SLAVE;
include/stop_slave.inc
RESET SLAVE;
RESET MASTER;
START SLAVE;
include/start_slave.inc
#### 2. Using mixed mode ####
==== 2.1. Checking a procedure ====
**** On Master ****

View File

@@ -5,8 +5,8 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
set global max_connections=151;
stop slave;
start slave;
include/stop_slave.inc
include/start_slave.inc
show variables like 'init_slave';
Variable_name Value
init_slave set global max_connections=500
@@ -25,6 +25,6 @@ set global init_connect="set @c=1";
show variables like 'init_connect';
Variable_name Value
init_connect set @c=1
stop slave;
include/stop_slave.inc
set global init_connect= @my_global_init_connect;
set global max_connections= default;

View File

@@ -7,7 +7,7 @@ start slave;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
stop slave;
include/stop_slave.inc
change master to master_log_pos=75;
SHOW SLAVE STATUS;
Slave_IO_State #
@@ -49,7 +49,7 @@ Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
start slave;
stop slave;
include/stop_slave.inc
SHOW SLAVE STATUS;
Slave_IO_State #
Master_Host 127.0.0.1

View File

@@ -8,8 +8,8 @@ drop database if exists DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________
create database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
SET @@global.max_allowed_packet=1024;
SET @@global.net_buffer_length=1024;
STOP SLAVE;
START SLAVE;
include/stop_slave.inc
include/start_slave.inc
select @@net_buffer_length, @@max_allowed_packet;
@@net_buffer_length @@max_allowed_packet
1024 1024
@@ -27,8 +27,8 @@ SLAVE_RUNNING ON
drop database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
SET @@global.max_allowed_packet=4096;
SET @@global.net_buffer_length=4096;
STOP SLAVE;
START SLAVE;
include/stop_slave.inc
include/start_slave.inc
CREATE TABLe `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
show slave status;

View File

@@ -423,10 +423,10 @@ a b c
**** On Master ****
DELETE FROM t1;
**** Resetting master and slave ****
STOP SLAVE;
include/stop_slave.inc
RESET SLAVE;
RESET MASTER;
START SLAVE;
include/start_slave.inc
**** On Master ****
INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M');
**** On Master ****

View File

@@ -423,10 +423,10 @@ a b c
**** On Master ****
DELETE FROM t1;
**** Resetting master and slave ****
STOP SLAVE;
include/stop_slave.inc
RESET SLAVE;
RESET MASTER;
START SLAVE;
include/start_slave.inc
**** On Master ****
INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M');
**** On Master ****

View File

@@ -16,6 +16,6 @@ INSERT INTO t1 VALUES (1);
[on slave]
Last_SQL_Error = Error 'Table 'test.t1' doesn't exist' on opening tables
==== Clean up ====
STOP SLAVE;
include/stop_slave.inc
[on master]
DROP TABLE t1;

View File

@@ -4,7 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
stop slave;
include/stop_slave.inc
reset master;
reset slave;
reset master;
@@ -113,11 +113,7 @@ Aberdeen
Abernathy
aberrant
aberration
start slave;
let $result_pattern= '%127.0.0.1%root%master-bin.000002%slave-relay-bin.000005%Yes%Yes%0%0%None%' ;
--source include/wait_slave_status.inc
include/start_slave.inc
select * from t1 order by 1 asc;
word
Aarhus
@@ -190,7 +186,8 @@ Abernathy
aberrant
aberration
flush logs;
stop slave;
include/stop_slave.inc
include/start_slave.inc
create table t2 (n int)ENGINE=MyISAM;
insert into t2 values (1);
show binlog events from <binlog_start>;
@@ -220,7 +217,6 @@ show binary logs;
Log_name File_size
master-bin.000001 1540
master-bin.000002 516
start slave;
show binary logs;
Log_name File_size
slave-bin.000001 1638

View File

@@ -4,7 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
stop slave;
include/stop_slave.inc
reset master;
reset slave;
reset master;
@@ -113,11 +113,7 @@ Aberdeen
Abernathy
aberrant
aberration
start slave;
let $result_pattern= '%127.0.0.1%root%master-bin.000002%slave-relay-bin.000005%Yes%Yes%0%0%None%' ;
--source include/wait_slave_status.inc
include/start_slave.inc
select * from t1 order by 1 asc;
word
Aarhus
@@ -190,7 +186,8 @@ Abernathy
aberrant
aberration
flush logs;
stop slave;
include/stop_slave.inc
include/start_slave.inc
create table t2 (n int)ENGINE=InnoDB;
insert into t2 values (1);
show binlog events from <binlog_start>;
@@ -220,7 +217,6 @@ show binary logs;
Log_name File_size
master-bin.000001 1456
master-bin.000002 474
start slave;
show binary logs;
Log_name File_size
slave-bin.000001 1536

View File

@@ -13,4 +13,5 @@ select count(*) from t1;
count(*)
70
drop table t1;
include/stop_slave.inc
drop table t1;

View File

@@ -4,7 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
stop slave;
include/stop_slave.inc
create table t1(n int not null auto_increment primary key);
insert into t1 values (1),(2),(3),(4);
drop table t1;
@@ -149,7 +149,7 @@ Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
start slave;
stop slave;
include/stop_slave.inc
start slave sql_thread until master_log_file='master-bin.000001', master_log_pos=740;
SHOW SLAVE STATUS;
Slave_IO_State #

View File

@@ -44,9 +44,9 @@ a b
SELECT * FROM t2 ORDER BY a;
a b
1 AA_for_row_or_YY_for_stmt_mixed
STOP SLAVE;
include/stop_slave.inc
RENAME TABLE t3_bak TO t3;
START SLAVE;
include/start_slave.inc
TRUNCATE t1;
TRUNCATE t2;
TRUNCATE t3;
@@ -78,9 +78,9 @@ SELECT * FROM t1 ORDER BY a;
a b
SELECT * FROM t2 ORDER BY a;
a b
STOP SLAVE;
include/stop_slave.inc
RENAME TABLE t3_bak TO t3;
START SLAVE;
include/start_slave.inc
TRUNCATE t1;
TRUNCATE t2;
TRUNCATE t3;
@@ -116,8 +116,8 @@ SELECT * FROM t1 ORDER BY a;
a b
SELECT * FROM t2 ORDER BY a;
a b
STOP SLAVE;
include/stop_slave.inc
RENAME TABLE t3_bak TO t3;
START SLAVE;
include/start_slave.inc
*** Clean up ***
DROP TABLE t1,t2,t3;

View File

@@ -166,7 +166,7 @@ BEGIN
UPDATE t3 SET a =2, b = 'master only';
END|
**** On Slave ****
STOP SLAVE;
include/stop_slave.inc
**** On Master ****
UPDATE t1 SET a = 2, b = 'master only' WHERE a = 1;
DROP TRIGGER tr1;
@@ -188,7 +188,7 @@ a b
3 master/slave
*** On Slave ***
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE;
include/start_slave.inc
SELECT * FROM t1 ORDER BY a;
a b
1 master/slave
@@ -208,7 +208,7 @@ CREATE TABLE t4 (a INT, b VARCHAR(20)) ENGINE=innodb;
CREATE TABLE t5 (a INT, b VARCHAR(20)) ENGINE=innodb;
CREATE TABLE t6 (a INT, b VARCHAR(20)) ENGINE=innodb;
**** On Slave ****
STOP SLAVE;
include/stop_slave.inc
*** On Master ***
BEGIN;
INSERT INTO t4 VALUES (2, 'master only');
@@ -234,7 +234,7 @@ a b
3 master/slave
*** On Slave ***
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE;
include/start_slave.inc
SELECT * FROM t4 ORDER BY a;
a b
3 master/slave
@@ -245,7 +245,7 @@ SELECT * FROM t6 ORDER BY a;
a b
3 master/slave
**** On Slave ****
STOP SLAVE;
include/stop_slave.inc
*** On Master ***
BEGIN;
INSERT INTO t4 VALUES (6, 'master only');
@@ -277,7 +277,7 @@ a b
7 master only
*** On Slave ***
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=10;
START SLAVE;
include/start_slave.inc
SELECT * FROM t4 ORDER BY a;
a b
3 master/slave
@@ -287,7 +287,7 @@ a b
SELECT * FROM t6 ORDER BY a;
a b
3 master/slave
STOP SLAVE;
include/stop_slave.inc
SET AUTOCOMMIT=0;
INSERT INTO t4 VALUES (4, 'master only');
INSERT INTO t5 VALUES (4, 'master only');
@@ -323,7 +323,7 @@ a b
7 master only
*** On Slave ***
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE;
include/start_slave.inc
SELECT * FROM t4 ORDER BY a;
a b
3 master/slave
@@ -341,7 +341,7 @@ DROP TABLE t4, t5, t6;
*** On Master ***
CREATE TABLE t10 (a INT, b VARCHAR(20)) ENGINE=myisam;
*** On Slave ***
STOP SLAVE;
include/stop_slave.inc
*** On Master ***
SET SESSION BINLOG_FORMAT=STATEMENT;
LOAD DATA INFILE 'MYSQLTEST_VARDIR/std_data/rpl_bug28618.dat' INTO TABLE t10 FIELDS TERMINATED BY '|';
@@ -352,7 +352,7 @@ a b
3 master only
*** On Slave ***
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE;
include/start_slave.inc
SELECT * FROM t10 ORDER BY a;
a b
DROP TABLE t10;

View File

@@ -8,9 +8,9 @@ start slave;
[on master]
GRANT REPLICATION SLAVE ON *.* TO rpl@127.0.0.1 IDENTIFIED BY 'rpl';
[on slave]
STOP SLAVE;
include/stop_slave.inc
CHANGE MASTER TO master_user='rpl', master_password='rpl';
START SLAVE;
include/start_slave.inc
==== Do replication as new user ====
[on master]
CREATE TABLE t1 (n INT);
@@ -25,7 +25,7 @@ DROP USER rpl@127.0.0.1;
FLUSH PRIVILEGES;
[on slave]
==== Restart slave without privileges =====
STOP SLAVE;
include/stop_slave.inc
START SLAVE;
==== Verify that Slave_IO_Running = No ====
Slave_IO_Running = No (should be No)

View File

@@ -191,11 +191,15 @@ begin
return unix_timestamp();
end|
ERROR HY000: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
set @old_log_bin_trust_routine_creators= @@global.log_bin_trust_routine_creators;
set @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
set global log_bin_trust_routine_creators=1;
Warnings:
Warning 1287 The syntax 'log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use 'log_bin_trust_function_creators' instead
set global log_bin_trust_function_creators=0;
set global log_bin_trust_function_creators=1;
set @old_log_bin_trust_routine_creators= @@global.log_bin_trust_routine_creators;
set @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
set global log_bin_trust_function_creators=1;
create function fn2()
returns int
@@ -549,8 +553,14 @@ insert into t values (1);
return 0;
end
master-bin.000001 # Query 1 # use `mysqltest`; SELECT `mysqltest2`.`f1`()
set global log_bin_trust_function_creators=0;
set global log_bin_trust_function_creators=0;
set @@global.log_bin_trust_routine_creators= @old_log_bin_trust_routine_creators;
Warnings:
Warning 1287 The syntax 'log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use 'log_bin_trust_function_creators' instead
set @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
set @@global.log_bin_trust_routine_creators= @old_log_bin_trust_routine_creators;
Warnings:
Warning 1287 The syntax 'log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use 'log_bin_trust_function_creators' instead
set @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
drop database mysqltest;
drop database mysqltest2;
use test;

View File

@@ -4,6 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
drop procedure if exists p1;
drop procedure if exists p2;
drop function if exists f1;
@@ -275,5 +276,5 @@ E
drop table t2;
drop procedure sp_bug26199;
drop function sf_bug26199;
SET GLOBAL log_bin_trust_function_creators = 0;
SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
end of the tests

View File

@@ -4,7 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
stop slave;
include/stop_slave.inc
reset master;
reset slave;
reset master;
@@ -109,11 +109,7 @@ Aberdeen
Abernathy
aberrant
aberration
start slave;
let $result_pattern= '%127.0.0.1%root%master-bin.000002%slave-relay-bin.000005%Yes%Yes%0%0%None%' ;
--source include/wait_slave_status.inc
include/start_slave.inc
select * from t1 order by 1 asc;
word
Aarhus
@@ -186,7 +182,8 @@ Abernathy
aberrant
aberration
flush logs;
stop slave;
include/stop_slave.inc
include/start_slave.inc
create table t2 (n int)ENGINE=MyISAM;
insert into t2 values (1);
show binlog events from <binlog_start>;
@@ -209,7 +206,6 @@ show binary logs;
Log_name File_size
master-bin.000001 1347
master-bin.000002 392
start slave;
show binary logs;
Log_name File_size
slave-bin.000001 1450

View File

@@ -4,7 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
stop slave;
include/stop_slave.inc
create table t1(n int not null auto_increment primary key);
insert into t1 values (1),(2),(3),(4);
drop table t1;
@@ -149,7 +149,7 @@ Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
start slave;
stop slave;
include/stop_slave.inc
start slave until master_log_file='master-bin.000001', master_log_pos=776;
SHOW SLAVE STATUS;
Slave_IO_State #

View File

@@ -40,10 +40,10 @@ SET @user_num = 10;
SET @user_text = 'Alunda';
[on master]
**** Resetting master and slave ****
STOP SLAVE;
include/stop_slave.inc
RESET SLAVE;
RESET MASTER;
START SLAVE;
include/start_slave.inc
[on slave]
SET @@global.init_slave = 'ant';
[on master]