1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge with MySQL 5.1.55

- Fixed some issues with partitions and connection_string, which also fixed lp:716890 "Pre- and post-recovery crash in Aria"
- Fixed wrong assert in Aria

Now need to merge with latest xtradb before pushing 

sql/ha_partition.cc:
  Ensure that m_ordered_rec_buffer is not freed before close.
sql/mysqld.cc:
  Changed to use opt_stack_trace instead of opt_pstack.
  Removed references to pstack
sql/partition_element.h:
  Ensure that connect_string is initialized
storage/maria/ma_key_recover.c:
  Fixed wrong assert
This commit is contained in:
Michael Widenius
2011-02-20 18:51:43 +02:00
1288 changed files with 19581 additions and 38443 deletions

View File

@ -9,10 +9,6 @@
# check if START SLAVE, RESET SLAVE, CHANGE MASTER reset Last_slave_error and
# Last_slave_errno in SHOW SLAVE STATUS (1st and 3rd commands did not: bug 986).
####################################
# Change Author: JBM
# Change Date: 2006-01-11
# Change: Split test per lars review
####################################
#"REQUIREMENT: A master DROP TABLE on a table with non-existing MYI
# file must be correctly replicated to the slave"
####################################
@ -24,6 +20,4 @@ let $MYSQLD_DATADIR= `select @@datadir`;
remove_file $MYSQLD_DATADIR/test/t1.MYI ;
drop table if exists t1;
--source include/master-slave-end.inc
# End of 4.1 tests
--source include/rpl_end.inc

View File

@ -1,14 +1,6 @@
#
# Test of auto_increment with offset
#
#####################################
# By: JBM
# Date: 2006-02-10
# Change: NDB does not support auto inc
# in this usage. Currently there is no
# plan to implment. Skipping test when
# NDB is default engine.
#####################################
-- source include/not_ndb_default.inc
-- source include/master-slave.inc
@ -169,7 +161,7 @@ drop table t1;
# auto_increment fields if the values of them are 0. There is an inconsistency
# between slave and master. When MODE_NO_AUTO_VALUE_ON_ZERO are masters treat
#
source include/master-slave-reset.inc;
source include/rpl_reset.inc;
connection master;
--disable_warnings
@ -210,12 +202,10 @@ INSERT INTO t2 VALUES(4);
FLUSH LOGS;
sync_slave_with_master;
let $diff_table_1= master:test.t1;
let $diff_table_2= slave:test.t1;
let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
let $diff_table_1= master:test.t2;
let $diff_table_2= slave:test.t2;
let $diff_tables= master:t2, slave:t2;
source include/diff_tables.inc;
connection master;
@ -228,15 +218,14 @@ let $MYSQLD_DATADIR= `SELECT @@DATADIR`;
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 | $MYSQL test
sync_slave_with_master;
let $diff_table_1= master:test.t1;
let $diff_table_2= slave:test.t1;
let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
let $diff_table_1= master:test.t2;
let $diff_table_2= slave:test.t2;
let $diff_tables= master:t2, slave:t2;
source include/diff_tables.inc;
# End cleanup
--connection master
DROP TABLE t1;
DROP TABLE t2;
SET SQL_MODE='';
@ -297,4 +286,29 @@ DROP TABLE t1;
DROP TABLE t_ignored1;
DROP TABLE t_ignored2;
#
# BUG#56662
# The test verifies if the assertion of "next_insert_id == 0"
# will fail in ha_external_lock() function.
#
connection master;
CREATE TABLE t1 (id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, data INT) ENGINE=innodb;
BEGIN;
--echo # Set sql_mode with NO_AUTO_VALUE_ON_ZERO for allowing
--echo # zero to fill the auto_increment field.
SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
INSERT INTO t1(id,data) VALUES(0,2);
--echo # Resetting sql_mode without NO_AUTO_VALUE_ON_ZERO to
--echo # affect the execution of the transaction on slave.
SET SQL_MODE=0;
COMMIT;
SELECT * FROM t1;
sync_slave_with_master;
SELECT * FROM t1;
connection master;
DROP TABLE t1;
sync_slave_with_master;
--source include/rpl_end.inc

View File

@ -29,8 +29,7 @@ commit;
sync_slave_with_master;
--echo #Test if the results are consistent on master and slave
--echo #for 'INSERT DATA INTO VIEW WHICH INVOKES TRIGGERS'
let $diff_table_1=master:test.t3;
let $diff_table_2=slave:test.t3;
let $diff_tables= master:t3, slave:t3;
source include/diff_tables.inc;
connection master;

View File

@ -60,14 +60,11 @@ connection master;
sync_slave_with_master;
--echo #Test if the results are consistent on master and slave
--echo #for 'INVOKES A TRIGGER with $trigger_action action'
let $diff_table_1=master:test.t2;
let $diff_table_2=slave:test.t2;
let $diff_tables= master:t2, slave:t2;
source include/diff_tables.inc;
let $diff_table_1=master:test.t4;
let $diff_table_2=slave:test.t4;
let $diff_tables= master:t4, slave:t4;
source include/diff_tables.inc;
let $diff_table_1=master:test.t6;
let $diff_table_2=slave:test.t6;
let $diff_tables= master:t6, slave:t6;
source include/diff_tables.inc;
connection master;

View File

@ -41,11 +41,9 @@ connection master;
sync_slave_with_master;
--echo #Test if the results are consistent on master and slave
--echo #for 'CALLS A FUNCTION which INVOKES A TRIGGER with $insert_action action'
let $diff_table_1=master:test.t2;
let $diff_table_2=slave:test.t2;
let $diff_tables= master:t2, slave:t2;
source include/diff_tables.inc;
let $diff_table_1=master:test.t3;
let $diff_table_2=slave:test.t3;
let $diff_tables= master:t3, slave:t3;
source include/diff_tables.inc;
connection master;

View File

@ -2,11 +2,7 @@
# This test will fail if the server/client does not support enough charsets.
source include/master-slave.inc;
--disable_warnings
set timestamp=1000000000;
drop database if exists mysqltest2;
drop database if exists mysqltest3;
--enable_warnings
create database mysqltest2 character set latin2;
set @@character_set_server=latin5;
@ -151,6 +147,6 @@ eval create table `t1` (
set @p=_latin1 'test';
update t1 set pk='test' where pk=@p;
drop table t1;
sync_slave_with_master;
# End of 4.1 tests
--source include/rpl_end.inc

View File

@ -1,16 +1,10 @@
#################################
# Test updated to use a wrapper #
#################################
eval CREATE TABLE t1 (a INT) ENGINE=$engine_type;
begin;
insert into t1 values(1);
flush tables with read lock;
commit;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
# cleanup
connection master;
unlock tables;

View File

@ -139,8 +139,13 @@ if (`SELECT @@global.binlog_format = 'ROW' AND @@global.slave_exec_mode = 'STRIC
--echo ---- Wait until slave stops with an error ----
let $slave_sql_errno= 1032; # ER_KEY_NOT_FOUND
source include/wait_for_slave_sql_error.inc;
let $err= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
--echo Last_SQL_Error = $err (expected "can't find record" error)
--let $err= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1)
--replace_regex /end_log_pos [0-9]+/end_log_pos END_LOG_POS/
--disable_query_log
--eval SELECT "$err" as 'Last_SQL_Error (expected "duplicate key" error)'
--enable_query_log
SELECT * FROM t1;
--echo ---- Resolve the conflict on the slave and restart SQL thread ----
@ -165,4 +170,4 @@ connection master;
DROP TABLE t1;
--echo [on slave]
sync_slave_with_master;
--sync_slave_with_master

View File

@ -136,14 +136,6 @@ sync_slave_with_master;
connection master;
SET AUTOCOMMIT = 1;
#
# 1. DROP all objects, which probably already exist, but must be created here
#
--disable_warnings
DROP DATABASE IF EXISTS mysqltest1;
DROP DATABASE IF EXISTS mysqltest2;
DROP DATABASE IF EXISTS mysqltest3;
--enable_warnings
#
# 2. CREATE all objects needed
# working database is mysqltest1
# working table (transactional!) is mysqltest1.t1
@ -619,6 +611,3 @@ connection master;
DROP DATABASE mysqltest1;
# mysqltest2 was alreday DROPPED some tests before.
DROP DATABASE mysqltest3;
--enable_warnings
-- source include/master-slave-end.inc

View File

@ -131,3 +131,4 @@ sync_slave_with_master;
SET global max_relay_log_size= @my_max_relay_log_size;
--echo End of 5.1 tests
--source include/rpl_end.inc

View File

@ -1,24 +1,7 @@
#############################################################
# Author: Chuck
#############################################################
# Purpose: To test having extra columns on the master WL#3915
# engine inspecific sourced part
#############################################################
# Change Author: Jeb
# Change: Cleanup and extend testing
#############################################################
# TODO: partition specific
# -- source include/have_partition.inc
# Note: Will be done in different test due to NDB using this
# test case.
############################################################
########### Clean up ################
--disable_warnings
--disable_query_log
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t10,t11,t12,t13,t14,t15,t16,t17,t18,t31;
--enable_query_log
--enable_warnings
#
# Setup differently defined tables on master and slave
@ -1025,8 +1008,3 @@ SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1;
connection master;
DROP TABLE t5;
sync_slave_with_master;
--echo
# END of 5.1 tests case

View File

@ -1,19 +1,10 @@
#################################################
# Author: Jeb
# Date: 2006-09-07
# Purpose: To test having extra columns on the slave.
##################################################
# Some tests in here requre partitioning
-- source include/have_partition.inc
########### Clean up ################
--disable_warnings
--disable_query_log
DROP TABLE IF EXISTS t1, t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t14a,t15,t16,t17;
--enable_query_log
--enable_warnings
#################################################
############ Different Table Def Test ###########
#################################################
@ -448,9 +439,9 @@ if (`SELECT $engine_type != 'NDB'`)
}
#--echo *** Drop t9 ***
#connection master;
#DROP TABLE t9;
#sync_slave_with_master;
connection master;
DROP TABLE t9;
sync_slave_with_master;
############################################
# More columns in slave at middle of table #
@ -725,6 +716,10 @@ sync_slave_with_master;
--replace_column 5 CURRENT_TIMESTAMP
SELECT * FROM t14a ORDER BY c1;
--connection master
DROP TABLE t14a;
--sync_slave_with_master
####################################################
# - Alter Master Dropping columns from the middle. #
# Expect: columns dropped #
@ -912,17 +907,3 @@ connection slave;
connection master;
DROP TABLE t17;
sync_slave_with_master;
#### Clean Up ####
--disable_warnings
--disable_query_log
connection master;
DROP TABLE IF EXISTS t1, t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t14a,t15,t16,t17;
sync_slave_with_master;
connection master;
--enable_query_log
--enable_warnings
# END 5.1 Test Case

View File

@ -22,4 +22,5 @@ connection master;
select * from t1;
commit;
drop table t1;
-- sync_slave_with_master
--source include/rpl_end.inc

View File

@ -54,7 +54,6 @@ unlock tables;
connection master;
drop table t3, t4, t5;
sync_slave_with_master;
# End of 4.1 tests
--source include/rpl_end.inc

View File

@ -60,6 +60,4 @@ select count(*) from t1 /* must be zero */;
connection master;
drop table t2,t1;
sync_slave_with_master;
--source include/rpl_end.inc

View File

@ -40,28 +40,16 @@ if (!$debug_sync_action)
}
# Restart slave
--disable_warnings
stop slave;
source include/wait_for_slave_to_stop.inc;
--source include/stop_slave.inc
eval SET @@global.debug= "+d,$dbug_sync_point";
start slave;
source include/wait_for_slave_to_start.inc;
--source include/start_slave.inc
--echo slave is going to hang in get_master_version_and_clock
connection master;
# Write file to make mysql-test-run.pl expect the "crash", but don't start
# it until it's told to
--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
wait
EOF
--let $rpl_server_number= 1
--source include/rpl_stop_server.inc
# Send shutdown to the connected server and give
# it 10 seconds to die before zapping it
shutdown_server 10;
connection slave;
--echo slave is unblocked
eval SET DEBUG_SYNC=$debug_sync_action;
@ -76,6 +64,7 @@ connection slave;
# '1040' ER_CON_COUNT_ERROR
# '1053' ER_SERVER_SHUTDOWN
let $slave_io_errno= 1040, 1053, 2002, 2003, 2006, 2013;
--let $slave_io_error_is_nonfatal= 1
source include/wait_for_slave_io_error.inc;
# deactivate the sync point of get_master_version_and_clock()
@ -84,21 +73,12 @@ source include/wait_for_slave_io_error.inc;
# unset.
eval set @@global.debug = "-d,$dbug_sync_point";
# Write file to make mysql-test-run.pl start up the server again
--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
restart
EOF
connection master;
# Turn on reconnect
--enable_reconnect
# Call script that will poll the server waiting for it to be back online again
--source include/wait_until_connected_again.inc
# Turn off reconnect again
--disable_reconnect
connection slave;
source include/wait_for_slave_to_start.inc;
--let $rpl_server_number= 1
--source include/rpl_start_server.inc
# We don't source include/wait_for_slave_io_to_start.inc, because the
# IO thread has an error and wait_for_slave_io_to_start.inc fails if
# the IO thread has an error.
--let $slave_param= Slave_IO_Running
--let $slave_param_value= Yes
--source include/wait_for_slave_param.inc

View File

@ -1,6 +1,4 @@
###########################################################
# 2006-02-01: By JBM: Added 1022, ORDER BY
###########################################################
# See if queries that use both auto_increment and LAST_INSERT_ID()
# are replicated well
############################################################
@ -14,9 +12,6 @@
--echo #
use test;
--disable_warnings
drop table if exists t1, t2, t3;
--enable_warnings
--echo #
--echo # See if queries that use both auto_increment and LAST_INSERT_ID()
@ -42,9 +37,7 @@ eval create table t2(b int auto_increment, c int, key(b)) engine=$engine_type;
insert into t1 values (1),(2),(3);
insert into t1 values (null);
insert into t2 values (null,last_insert_id());
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
select * from t1 ORDER BY a;
select * from t2 ORDER BY b;
connection master;
@ -63,9 +56,7 @@ insert into t1 values (null),(null),(null);
insert into t2 values (5,0);
insert into t2 values (null,last_insert_id());
SET FOREIGN_KEY_CHECKS=1;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
select * from t1;
select * from t2;
connection master;
@ -83,17 +74,13 @@ insert into t1 values (null),(null),(null);
insert into t2 values (5,0);
insert into t2 (c) select * from t1 ORDER BY a;
select * from t2 ORDER BY b;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
select * from t1 ORDER BY a;
select * from t2 ORDER BY b;
connection master;
drop table t1;
drop table t2;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
--echo #
--echo # Bug#8412: Error codes reported in binary log for CHARACTER SET,
@ -208,9 +195,7 @@ call foo();
select * from t1;
select * from t2;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
select * from t1;
select * from t2;
connection master;
@ -548,4 +533,5 @@ connection master;
drop table t1, t2;
drop procedure foo;
SET @@global.concurrent_insert= @old_concurrent_insert;
sync_slave_with_master;
--source include/rpl_end.inc

View File

@ -1,6 +1,4 @@
###########################################################
# 2006-02-08: By JBM:
###########################################################
# See if queries that use both auto_increment and LAST_INSERT_ID()
# are replicated well
############################################################
@ -20,9 +18,7 @@ create table t2(b int auto_increment, c int, primary key(b));
insert into t1 values (1),(2),(3);
insert into t1 values (null);
insert into t2 values (null,last_insert_id());
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
select * from t1 ORDER BY a;
select * from t2 ORDER BY b;
connection master;
@ -41,9 +37,7 @@ insert into t1 values (null),(null),(null);
insert into t2 values (5,0);
insert into t2 values (null,last_insert_id());
SET FOREIGN_KEY_CHECKS=1;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
select * from t1;
select * from t2;
connection master;
@ -59,17 +53,13 @@ insert into t1 values (null),(null),(null);
insert into t2 values (5,0);
insert into t2 (c) select * from t1 ORDER BY a;
select * from t2 ORDER BY b;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
select * from t1 ORDER BY a;
select * from t2 ORDER BY b;
connection master;
drop table t1;
drop table t2;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
#
# Bug#8412: Error codes reported in binary log for CHARACTER SET,
@ -85,3 +75,5 @@ INSERT INTO t1 VALUES (1),(1);
drop table t1;
sync_slave_with_master;
# End of 4.1 tests
--source include/rpl_end.inc

View File

@ -1,6 +1,3 @@
# Requires statement logging
-- source include/have_binlog_format_statement.inc
# See if replication of a "LOAD DATA in an autoincrement column"
# Honours autoincrement values
# i.e. if the master and slave have the same sequence
@ -14,13 +11,10 @@
# check if START SLAVE, RESET SLAVE, CHANGE MASTER reset Last_slave_error and
# Last_slave_errno in SHOW SLAVE STATUS (1st and 3rd commands did not: bug 986)
-- source include/have_binlog_format_statement.inc
-- source include/master-slave.inc
source include/have_innodb.inc;
connection slave;
reset master;
connection master;
# MTR is not case-sensitive.
let $lower_stmt_head= load data;
let $UPPER_STMT_HEAD= LOAD DATA;
@ -45,9 +39,7 @@ eval $lower_stmt_head infile '../../std_data/rpl_loaddata2.dat' into table t2 fi
create table t3 (day date,id int(9),category enum('a','b','c'),name varchar(60));
insert into t3 select * from t2;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
select * from t1;
select * from t3;
@ -59,9 +51,7 @@ drop table t2;
drop table t3;
create table t1(a int, b int, unique(b));
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
# See if slave stops when there's a duplicate entry for key error in LOAD DATA
@ -72,21 +62,16 @@ eval $lower_stmt_head infile '../../std_data/rpl_loaddata.dat' into table t1;
save_master_pos;
connection slave;
# The SQL slave thread should be stopped now.
--source include/wait_for_slave_sql_to_stop.inc
# 1062 = ER_DUP_ENTRY
--let $slave_sql_errno= 1062
--source include/wait_for_slave_sql_error_and_skip.inc
# Skip the bad event and see if error is cleared in SHOW SLAVE STATUS by START
# SLAVE, even though we are not executing any event (as sql_slave_skip_counter
# takes us directly to the end of the relay log).
set global sql_slave_skip_counter=1;
start slave;
sync_with_master;
let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
echo Last_SQL_Errno=$last_error;
let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
echo Last_SQL_Error;
echo $last_error;
--source include/check_slave_no_error.inc
# Trigger error again to test CHANGE MASTER
@ -100,17 +85,15 @@ connection slave;
# The SQL slave thread should be stopped now.
# Exec_Master_Log_Pos should point to the start of Execute event
# for last load data.
--source include/wait_for_slave_sql_to_stop.inc
# 1062 = ER_DUP_ENTRY
--let $slave_sql_errno= 1062
--source include/wait_for_slave_sql_error.inc
# CHANGE MASTER and see if error is cleared in SHOW SLAVE STATUS.
stop slave;
--source include/stop_slave_io.inc
change master to master_user='test';
change master to master_user='root';
let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
echo Last_SQL_Errno=$last_error;
let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
echo Last_SQL_Error;
echo $last_error;
--source include/check_slave_no_error.inc
# Trigger error again to test RESET SLAVE
@ -125,16 +108,14 @@ eval $lower_stmt_head infile '../../std_data/rpl_loaddata.dat' into table t1;
save_master_pos;
connection slave;
# The SQL slave thread should be stopped now.
--source include/wait_for_slave_sql_to_stop.inc
# 1062 = ER_DUP_ENTRY
--let $slave_sql_errno= 1062
--source include/wait_for_slave_sql_error.inc
# RESET SLAVE and see if error is cleared in SHOW SLAVE STATUS.
stop slave;
reset slave;
let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
echo Last_SQL_Errno=$last_error;
let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
echo Last_SQL_Error;
echo $last_error;
--source include/check_slave_no_error.inc
# Finally, see if logging is done ok on master for a failing LOAD DATA INFILE
@ -165,6 +146,7 @@ terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
drop table t1, t2;
--source include/stop_slave_io.inc
connection master;
drop table t1, t2;
@ -178,7 +160,8 @@ DROP TABLE IF EXISTS t1;
# BUG#48297: Schema name is ignored when LOAD DATA is written into binlog,
# replication aborts
-- source include/master-slave-reset.inc
-- let $rpl_only_running_threads= 1
-- source include/rpl_reset.inc
-- let $db1= b48297_db1
-- let $db2= b42897_db2
@ -239,8 +222,7 @@ connect (conn2,localhost,root,,*NO-ONE*);
-- sync_slave_with_master
-- eval use $db1
let $diff_table_1=master:$db1.t1;
let $diff_table_2=slave:$db1.t1;
let $diff_tables= master:$db1.t1, slave:$db1.t1;
source include/diff_tables.inc;
-- connection master
@ -251,7 +233,7 @@ source include/diff_tables.inc;
-- sync_slave_with_master
# BUG#49479: LOAD DATA INFILE is binlogged without escaping field names
-- source include/master-slave-reset.inc
-- source include/rpl_reset.inc
-- connection master
use test;
CREATE TABLE t1 (`key` TEXT, `text` TEXT);
@ -262,6 +244,6 @@ SELECT * FROM t1;
-- sync_slave_with_master
-- connection master
DROP TABLE t1;
-- sync_slave_with_master
# End of 4.1 tests
--source include/rpl_end.inc

View File

@ -124,7 +124,7 @@ DROP TABLE t3;
# Reset binlog so that show binlog events will not show the tests
# above.
source include/master-slave-reset.inc;
source include/rpl_reset.inc;
connection master;
create table t1(a int auto_increment primary key, b int);

View File

@ -6,9 +6,6 @@
# Requires statement logging
-- source include/master-slave.inc
# We have to sync with master, to ensure slave had time to start properly
# before we stop it. If not, we get errors about UNIX_TIMESTAMP() in the log.
sync_slave_with_master;
connection slave;
stop slave;
connection master;
@ -117,3 +114,4 @@ set global max_binlog_size= @my_max_binlog_size;
--echo #
--echo # End of 4.1 tests
--echo #
--source include/rpl_end.inc

View File

@ -7,9 +7,6 @@
# PS doesn't support multi-statements
--disable_ps_protocol
-- source include/master-slave.inc
--disable_warnings
drop database if exists mysqltest;
--enable_warnings
create database mysqltest;
delimiter /;
@ -25,4 +22,5 @@ select * from mysqltest.t1;
connection master;
source include/show_binlog_events.inc;
drop database mysqltest;
sync_slave_with_master;
--source include/rpl_end.inc

View File

@ -19,12 +19,11 @@ SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
UPDATE t1, t2 SET t1.b = t2.b WHERE t1.a = t2.a;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
# End of 4.1 tests
connection master;
drop table t1, t2;
sync_slave_with_master;
--source include/rpl_end.inc

View File

@ -226,7 +226,7 @@ connection master;
# Reset both slave and master
# This should reset binlog to #1
--source include/master-slave-reset.inc
--source include/rpl_reset.inc
--echo

View File

@ -71,12 +71,10 @@ INSERT INTO t4(a) VALUES (5);
sync_slave_with_master;
--echo TABLES t1 and t2 must be equal otherwise an error will be thrown.
let $diff_table_1=master:test.t1;
let $diff_table_2=slave:test.t1;
let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
let $diff_table_1=master:test.t2;
let $diff_table_2=slave:test.t2;
let $diff_tables= master:t2, slave:t2;
source include/diff_tables.inc;
--echo TABLES t2 and t3 must be different.
@ -101,8 +99,7 @@ REPLACE INTO t1(a,b,c) VALUES (2, NULL, 300);
sync_slave_with_master;
--echo TABLES t1 and t2 must be equal otherwise an error will be thrown.
let $diff_table_1=master:test.t1;
let $diff_table_2=slave:test.t1;
let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
--echo ************* CLEANING *************
@ -154,8 +151,7 @@ REPLACE INTO t1(a,b,c) VALUES (2, NULL, b'00');
--echo ************* SHOWING THE RESULT SETS WITH UPDATES and REPLACES *************
--echo TABLES t1 and t2 must be equal otherwise an error will be thrown.
sync_slave_with_master;
let $diff_table_1=master:test.t1;
let $diff_table_2=slave:test.t1;
let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
connection master;
@ -273,7 +269,7 @@ sync_slave_with_master;
# SELECT * FROM t3 ORDER BY a;
# connection slave;
# SELECT * FROM t3 ORDER BY a;
# --source include/reset_master_and_slave.inc
# --source include/rpl_reset.inc
#
# connection master;
#

View File

@ -4,7 +4,7 @@
#
-- echo ## case #1 - last_null_bit_pos==0 in record_compare without X bit
-- source include/master-slave-reset.inc
-- source include/rpl_reset.inc
-- connection master
-- eval CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 varchar(1) DEFAULT '', c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0, c8 bigint(20) DEFAULT 0) ENGINE=$engine DEFAULT CHARSET=latin1
@ -16,8 +16,7 @@ UPDATE t1 SET c5 = 'a';
-- enable_warnings
-- sync_slave_with_master
-- let $diff_table_1= master:test.t1
-- let $diff_table_2= slave:test.t1
-- let $diff_tables= master:t1, slave:t1
-- source include/diff_tables.inc
--connection master
@ -26,7 +25,7 @@ DROP TABLE t1;
-- echo ## case #1.1 - last_null_bit_pos==0 in record_compare with X bit
-- echo ## (1 column less and no varchar)
-- source include/master-slave-reset.inc
-- source include/rpl_reset.inc
-- connection master
-- eval CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 bigint(20) DEFAULT 0, c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0) ENGINE=$engine DEFAULT CHARSET=latin1
@ -38,8 +37,7 @@ UPDATE t1 SET c5 = 'a';
-- enable_warnings
-- sync_slave_with_master
-- let $diff_table_1= master:test.t1
-- let $diff_table_2= slave:test.t1
-- let $diff_tables= master:t1, slave:t1
-- source include/diff_tables.inc
--connection master
@ -48,7 +46,7 @@ DROP TABLE t1;
-- echo ## case #2 - X bit is wrongly set.
-- source include/master-slave-reset.inc
-- source include/rpl_reset.inc
-- connection master
-- eval CREATE TABLE t1 (c1 int, c2 varchar(1) default '') ENGINE=$engine DEFAULT CHARSET= latin1
@ -57,8 +55,7 @@ INSERT INTO t1(c1) VALUES (NULL);
UPDATE t1 SET c1= 0;
-- sync_slave_with_master
-- let $diff_table_1= master:test.t1
-- let $diff_table_2= slave:test.t1
-- let $diff_tables= master:t1, slave:t1
-- source include/diff_tables.inc
-- connection master

View File

@ -54,9 +54,9 @@ source include/check_slave_no_error.inc;
change master to master_user='impossible_user_name';
start slave;
let $slave_io_errno= 1045;
source include/wait_for_slave_io_error.inc;
--source include/wait_for_slave_io_error.inc
--source include/stop_slave_sql.inc
source include/stop_slave.inc;
change master to master_user='root';
source include/start_slave.inc;
source include/check_slave_no_error.inc;
@ -69,8 +69,11 @@ source include/stop_slave.inc;
change master to master_user='impossible_user_name';
start slave;
let $slave_io_errno= 1045;
source include/wait_for_slave_io_error.inc;
--source include/wait_for_slave_io_error.inc
--source include/stop_slave_sql.inc
source include/stop_slave.inc;
reset slave;
source include/check_slave_no_error.inc;
--let $rpl_only_running_threads= 1
--source include/rpl_end.inc

View File

@ -75,5 +75,3 @@ diff_files $MYSQLTEST_VARDIR/tmp/rpl_row_UUID_master.sql $MYSQLTEST_VARDIR/tmp/r
# this cleanup as no other test will use these files and they'll
# be removed at next testsuite run.
# End of 5.0 test case
-- source include/master-slave-end.inc

View File

@ -248,7 +248,7 @@ DELETE FROM t1;
sync_slave_with_master;
# Just to get a clean binary log
source include/reset_master_and_slave.inc;
--source include/rpl_reset.inc
--echo **** On Master ****
connection master;
@ -360,8 +360,7 @@ INSERT INTO t1 VALUES (1, "", 1);
INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2);
sync_slave_with_master;
let $diff_table_1=master:test.t1;
let $diff_table_2=slave:test.t1;
let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
--echo [expecting slave to replicate correctly]
@ -370,8 +369,7 @@ INSERT INTO t2 VALUES (1, "", 1);
INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2);
sync_slave_with_master;
let $diff_table_1=master:test.t2;
let $diff_table_2=slave:test.t2;
let $diff_tables= master:t2, slave:t2;
source include/diff_tables.inc;
--echo [expecting slave to stop]
@ -381,16 +379,12 @@ INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2);
connection slave;
# 1535 = ER_BINLOG_ROW_WRONG_TABLE_DEF
--let $slave_sql_errno= 1535
--let $slave_sql_errno= 1535
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error.inc
connection master;
RESET MASTER;
connection slave;
STOP SLAVE;
RESET SLAVE;
START SLAVE;
source include/wait_for_slave_to_start.inc;
--let $rpl_only_running_threads= 1
--source include/rpl_reset.inc
--echo [expecting slave to replicate correctly]
connection master;
@ -398,8 +392,7 @@ INSERT INTO t4 VALUES (1, "", 1);
INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2);
sync_slave_with_master;
let $diff_table_1=master:test.t4;
let $diff_table_2=slave:test.t4;
let $diff_tables= master:t4, slave:t4;
source include/diff_tables.inc;
--echo [expecting slave to stop]
@ -409,16 +402,11 @@ INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2);
connection slave;
# 1535 = ER_BINLOG_ROW_WRONG_TABLE_DEF
--let $slave_sql_errno= 1535
--let $slave_sql_errno= 1535
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error.inc
connection master;
RESET MASTER;
connection slave;
STOP SLAVE;
RESET SLAVE;
START SLAVE;
source include/wait_for_slave_to_start.inc;
--source include/rpl_reset.inc
--echo [expecting slave to stop]
connection master;
@ -427,16 +415,11 @@ INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2);
connection slave;
# 1535 = ER_BINLOG_ROW_WRONG_TABLE_DEF
--let $slave_sql_errno= 1535
--let $slave_sql_errno= 1535
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error.inc
connection master;
RESET MASTER;
connection slave;
STOP SLAVE;
RESET SLAVE;
START SLAVE;
source include/wait_for_slave_to_start.inc;
--source include/rpl_reset.inc
--echo [expecting slave to replicate correctly]
connection master;
@ -444,8 +427,7 @@ INSERT INTO t7 VALUES (1, "", 1);
INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2);
sync_slave_with_master;
let $diff_table_1=master:test.t7;
let $diff_table_2=slave:test.t7;
let $diff_tables= master:t7, slave:t7;
source include/diff_tables.inc;
connection master;
@ -465,8 +447,7 @@ UPDATE t1 SET a = 10;
INSERT INTO t1 VALUES (4);
sync_slave_with_master;
let $diff_table_1=master:test.t1;
let $diff_table_2=slave:test.t1;
let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
connection master;
@ -544,8 +525,7 @@ UPDATE t1 SET `int_key` = 4 ORDER BY `pk` LIMIT 6;
--sync_slave_with_master
--echo *** results: t2 must be consistent ****
let $diff_table_1=master:test.t2;
let $diff_table_2=master:test.t2;
let $diff_tables= master:t2, slave:t2;
source include/diff_tables.inc;
--connection master
@ -583,8 +563,7 @@ UPDATE t1 SET a = 8 WHERE a < 5;
sync_slave_with_master;
let $diff_table_1=master:test.t1;
let $diff_table_2=slave:test.t1;
let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
connection master;
@ -646,8 +625,7 @@ UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 3;
sync_slave_with_master;
let $diff_table_1=master:test.t1;
let $diff_table_2=slave:test.t1;
let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
connection master;

View File

@ -14,9 +14,8 @@ flush tables;
SELECT * FROM t1 ORDER BY a;
sync_slave_with_master;
connection master;
sync_slave_with_master;
SELECT * FROM t1 ORDER BY a;
connection master;
drop table t1;
sync_slave_with_master;
--source include/rpl_end.inc

View File

@ -1,9 +1,6 @@
#############################################################################
# This test is being created to test out the non deterministic items with #
# row based replication. #
# Original Author: JBM #
# Original Date: Aug/09/2005 #
# Updated: Aug/29/2005 #
#############################################################################
# Test: Contains two stored procedures test one that insert data into tables#
# and use the LAST_INSERTED_ID() on tables with FOREIGN KEY(a) #
@ -13,9 +10,6 @@
# the table depending on the CASE outcome. The test uses this SP in a#
# transaction first rolling back and then commiting, #
#############################################################################
# Mod Date: 08/22/2005 #
# TEST: Added test to include UPDATE CASCADE on table with FK per Trudy #
#############################################################################
@ -24,18 +18,6 @@
-- source include/master-slave.inc
# Begin clean up test section
connection master;
--disable_warnings
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP PROCEDURE IF EXISTS test.p3;
DROP TABLE IF EXISTS test.t3;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
--enable_warnings
# End of cleanup
# Begin test section 1
eval CREATE TABLE test.t1 (a INT AUTO_INCREMENT KEY, t CHAR(6)) ENGINE=$engine_type;
@ -71,9 +53,7 @@ SELECT * FROM test.t2;
let $message=< -- test 1 select slave after p1 -- >;
--source include/show_msg.inc
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
SELECT * FROM test.t1;
SELECT * FROM test.t2;
@ -86,9 +66,7 @@ SELECT * FROM test.t2;
let $message=< -- test 1 select slave after p2 -- >;
--source include/show_msg.inc
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
SELECT * FROM test.t1;
SELECT * FROM test.t2;
@ -136,9 +114,7 @@ SELECT * FROM test.t2;
let $message=< -- test 2 select Slave after p1 -- >;
--source include/show_msg.inc
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
SELECT * FROM test.t1;
SELECT * FROM test.t2;
@ -153,9 +129,7 @@ SELECT * FROM test.t2;
let $message=< -- test 1 select Slave after p2 -- >;
--source include/show_msg.inc
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
SELECT * FROM test.t1;
SELECT * FROM test.t2;
@ -195,9 +169,7 @@ while ($n)
ROLLBACK;
select * from test.t3;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
select * from test.t3;
connection master;
@ -216,9 +188,7 @@ while ($n)
COMMIT;
select * from test.t3;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
select * from test.t3;
connection master;
@ -228,12 +198,12 @@ connection master;
# First lets cleanup
SET AUTOCOMMIT=1;
SET FOREIGN_KEY_CHECKS=0;
DROP PROCEDURE IF EXISTS test.p3;
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
DROP TABLE IF EXISTS test.t3;
sync_slave_with_master;
DROP PROCEDURE test.p3;
DROP PROCEDURE test.p1;
DROP PROCEDURE test.p2;
DROP TABLE test.t1;
DROP TABLE test.t2;
DROP TABLE test.t3;
# End of 5.0 test case
--source include/rpl_end.inc

View File

@ -1,8 +1,4 @@
#############################################################################
# Original Author: JBM #
# Original Date: Aug/15/2005 #
# Updated: 08/29/2005 Remove sleeps #
#############################################################################
# TEST: SP that creates table, starts tranaction inserts. Save point, insert#
# rollback to save point and then commits. #
#############################################################################
@ -10,14 +6,6 @@
-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
# Begin clean up test section
connection master;
--disable_warnings
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1;
--enable_warnings
# End of cleanup
# Begin test section 1
delimiter |;
eval CREATE PROCEDURE test.p1(IN i INT)
@ -42,9 +30,7 @@ SELECT * FROM test.t1;
let $message=< ---- Slave selects-- >;
--source include/show_msg.inc
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
SELECT * FROM test.t1;
let $message=< ---- Master selects-- >;
@ -55,16 +41,15 @@ SELECT * FROM test.t1;
let $message=< ---- Slave selects-- >;
--source include/show_msg.inc
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
SELECT * FROM test.t1;
connection master;
#show binlog events;
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1;
DROP PROCEDURE test.p1;
DROP TABLE test.t1;
# End of 5.0 test case
--source include/rpl_end.inc

View File

@ -29,7 +29,7 @@
# BUG#49481: RBR: MyISAM and bit fields may cause slave to stop on
# delete cant find record
-- source include/master-slave-reset.inc
-- source include/rpl_reset.inc
-- connection master
-- eval CREATE TABLE t1 (c1 BIT, c2 INT) Engine=$engine
@ -37,8 +37,7 @@ INSERT INTO `t1` VALUES ( 1, 1 );
UPDATE t1 SET c1=NULL where c2=1;
-- sync_slave_with_master
-- let $diff_table_1=master:test.t1
-- let $diff_table_2=slave:test.t1
-- let $diff_tables= master:t1, slave:t1
-- source include/diff_tables.inc
-- connection master
@ -46,15 +45,14 @@ UPDATE t1 SET c1=NULL where c2=1;
DELETE FROM t1 WHERE c2=1 LIMIT 1;
-- sync_slave_with_master
-- let $diff_table_1=master:test.t1
-- let $diff_table_2=slave:test.t1
-- let $diff_tables= master:t1, slave:t1
-- source include/diff_tables.inc
-- connection master
DROP TABLE t1;
-- sync_slave_with_master
-- source include/master-slave-reset.inc
-- source include/rpl_reset.inc
-- connection master
@ -68,8 +66,7 @@ SELECT * FROM t1;
UPDATE t1 SET c1=NULL WHERE c1='w';
-- sync_slave_with_master
-- let $diff_table_1=master:test.t1
-- let $diff_table_2=slave:test.t1
-- let $diff_tables= master:t1, slave:t1
-- source include/diff_tables.inc
-- connection master
@ -77,8 +74,7 @@ UPDATE t1 SET c1=NULL WHERE c1='w';
DELETE FROM t1 LIMIT 2;
-- sync_slave_with_master
-- let $diff_table_1=master:test.t1
-- let $diff_table_2=slave:test.t1
-- let $diff_tables= master:t1, slave:t1
-- source include/diff_tables.inc
-- connection master

View File

@ -1,131 +0,0 @@
# Requires binlog_format=statement format since query involving
# get_lock() is logged in row format if binlog_format=mixed or row.
-- source include/have_binlog_format_statement.inc
-- source include/master-slave.inc
CALL mtr.add_suppression("Statement may not be safe to log in statement format.");
# Load some data into t1
create table t1 (word char(20) not null);
load data infile '../../std_data/words.dat' into table t1;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data local infile '$MYSQL_TEST_DIR/std_data/words.dat' into table t1;
select * from t1 limit 10;
#
# Test slave with wrong password
#
sync_slave_with_master;
stop slave;
connection master;
set password for root@"localhost" = password('foo');
connection slave;
start slave;
connection master;
#
# Give slave time to do at last one failed connect retry
# This one must be short so that the slave will not stop retrying
real_sleep 2;
set password for root@"localhost" = password('');
# Give slave time to connect (will retry every second)
sleep 2;
create table t3(n int);
insert into t3 values(1),(2);
sync_slave_with_master;
select * from t3;
select sum(length(word)) from t1;
connection master;
drop table t1,t3;
sync_slave_with_master;
# Test if the slave SQL thread can be more than 16K behind the slave
# I/O thread (> IO_SIZE)
connection master;
# we'll use table-level locking to delay slave SQL thread
eval create table t1 (n int) engine=$engine_type;
sync_slave_with_master;
connection master;
reset master;
connection slave;
stop slave;
reset slave;
connection master;
let $1=5000;
# Generate 16K of relay log
disable_query_log;
while ($1)
{
eval insert into t1 values($1);
dec $1;
}
enable_query_log;
# Try to cause a large relay log lag on the slave by locking t1
connection slave;
lock tables t1 read;
start slave;
#hope this is long enough for I/O thread to fetch over 16K relay log data
sleep 3;
unlock tables;
#test handling of aborted connection in the middle of update
connection master;
create table t2(id int);
insert into t2 values(connection_id());
connection master1;
# Avoid generating result
create temporary table t3(n int);
--disable_warnings
insert into t3 select get_lock('crash_lock%20C', 1) from t2;
--enable_warnings
connection master;
send update t1 set n = n + get_lock('crash_lock%20C', 2);
connection master1;
sleep 3;
select (@id := id) - id from t2;
kill @id;
# We don't drop t3 as this is a temporary table
drop table t2;
connection master;
# The get_lock function causes warning for unsafe statement.
--disable_warnings
--error 1317,2013
reap;
--enable_warnings
connection slave;
# The SQL slave thread should now have stopped because the query was killed on
# the master (so it has a non-zero error code in the binlog).
--source include/wait_for_slave_sql_to_stop.inc
# The following test can't be done because the result of Pos will differ
# on different computers
# --replace_result $MASTER_MYPORT MASTER_PORT
# show slave status;
set global sql_slave_skip_counter=1;
start slave;
select count(*) from t1;
connection master1;
drop table t1;
create table t1 (n int);
insert into t1 values(3456);
insert into mysql.user (Host, User, Password)
VALUES ("10.10.10.%", "blafasel2", password("blafasel2"));
select select_priv,user from mysql.user where user = _binary'blafasel2';
update mysql.user set Select_priv = "Y" where User= _binary"blafasel2";
select select_priv,user from mysql.user where user = _binary'blafasel2';
sync_slave_with_master;
select n from t1;
select select_priv,user from mysql.user where user = _binary'blafasel2';
connection master1;
drop table t1;
delete from mysql.user where user="blafasel2";
sync_slave_with_master;
# End of 4.1 tests

View File

@ -30,6 +30,11 @@ let $errno= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
--echo Error: "$error" (expected different error codes on master and slave)
--echo Errno: "$errno" (expected 0)
drop table t1;
--source include/stop_slave.inc
# Clear error messages.
RESET SLAVE;
# End of 4.1 tests
--let $rpl_only_running_threads= 1
--source include/rpl_end.inc

View File

@ -19,10 +19,13 @@ eval CREATE $_temporary TABLE IF NOT EXISTS t1 (c1 INT , c2 INT, c3 char(10), c4
SELECT 'abc' AS c3, 1 AS c4;
source include/show_binlog_events.inc;
--sync_slave_with_master
--connection master
if (!$is_temporary)
{
let $diff_table= test.t1;
source include/rpl_diff_tables.inc;
--let $diff_tables= master:t1,slave:t1
--source include/diff_tables.inc
}
--echo
@ -36,10 +39,13 @@ eval CREATE $_temporary TABLE IF NOT EXISTS t1
SELECT 'abc', 2;
source include/show_binlog_events.inc;
--sync_slave_with_master
--connection master
if (!$is_temporary)
{
let $diff_table= test.t1;
source include/rpl_diff_tables.inc;
--let $diff_tables= master:t1,slave:t1
--source include/diff_tables.inc
}
--echo
@ -57,10 +63,13 @@ eval CREATE $_temporary TABLE IF NOT EXISTS test.t1
SELECT 'abc', 20;
source include/show_binlog_events.inc;
--sync_slave_with_master
--connection master
if (!$is_temporary)
{
let $diff_table= test.t1;
source include/rpl_diff_tables.inc;
--let $diff_tables= master:test.t1,slave:test.t1
--source include/diff_tables.inc
}
USE test;
DROP DATABASE db1;
@ -74,10 +83,13 @@ eval CREATE $_temporary TABLE IF NOT EXISTS t1
REPLACE SELECT '123', 2;
source include/show_binlog_events.inc;
--sync_slave_with_master
--connection master
if (!$is_temporary)
{
let $diff_table= test.t1;
source include/rpl_diff_tables.inc;
--let $diff_tables= master:t1,slave:t1
--source include/diff_tables.inc
}
--echo
@ -89,10 +101,13 @@ eval CREATE $_temporary TABLE IF NOT EXISTS t1
IGNORE SELECT '123', 2;
source include/show_binlog_events.inc;
--sync_slave_with_master
--connection master
if (!$is_temporary)
{
let $diff_table= test.t1;
source include/rpl_diff_tables.inc;
--let $diff_tables= master:t1,slave:t1
--source include/diff_tables.inc
}
--echo
@ -103,10 +118,14 @@ let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
eval CREATE $_temporary TABLE IF NOT EXISTS t1
SELECT '123', 2;
source include/show_binlog_events.inc;
--sync_slave_with_master
--connection master
if (!$is_temporary)
{
let $diff_table= test.t1;
source include/rpl_diff_tables.inc;
--let $diff_tables= master:t1,slave:t1
--source include/diff_tables.inc
}
--echo
@ -121,10 +140,13 @@ eval CREATE $_temporary TABLE IF NOT EXISTS t1
IGNORE (SELECT '123', 3) UNION (SELECT '123', 4);
source include/show_binlog_events.inc;
--sync_slave_with_master
--connection master
if (!$is_temporary)
{
let $diff_table= test.t1;
source include/rpl_diff_tables.inc;
--let $diff_tables= master:t1,slave:t1
--source include/diff_tables.inc
}
if (!$is_temporary)
@ -155,10 +177,14 @@ let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
call p1(500);
call p1(600);
source include/show_binlog_events.inc;
--sync_slave_with_master
--connection master
if (!$is_temporary)
{
let $diff_table= test.t1;
source include/rpl_diff_tables.inc;
--let $diff_tables= master:t1,slave:t1
--source include/diff_tables.inc
}
DROP PROCEDURE p1;
@ -173,10 +199,14 @@ EXECUTE stm USING @a;
SET @a= 800;
EXECUTE stm USING @a;
source include/show_binlog_events.inc;
--sync_slave_with_master
--connection master
if (!$is_temporary)
{
let $diff_table= test.t1;
source include/rpl_diff_tables.inc;
--let $diff_tables= master:t1,slave:t1
--source include/diff_tables.inc
}
--echo
@ -224,10 +254,13 @@ eval /*!CREATE $_temporary TABLE IF NOT EXISTS t1
*/SELECT 'abc', 905;
source include/show_binlog_events.inc;
--sync_slave_with_master
--connection master
if (!$is_temporary)
{
let $diff_table= test.t1;
source include/rpl_diff_tables.inc;
--let $diff_tables= master:t1,slave:t1
--source include/diff_tables.inc
}
DROP TABLE t2;

View File

@ -53,8 +53,7 @@ source include/wait_for_slave_sql_to_stop.inc;
--echo # Slave should stop after the transaction has committed.
--echo # So t1 on master is same to t1 on slave.
let diff_table_1=master:test.t1;
let diff_table_2=slave:test.t1;
let diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
connection slave;

View File

@ -1,12 +1,3 @@
####################
# Change Author: JBM
# Change Date: 2006-01-17
# Change: Added order by in select
####################
# Change Date: 2006-02-02
# Change: renamed to make bettre sense,
# and wrapped per Engine test
############################
source include/master-slave.inc;
#
@ -32,4 +23,4 @@ connection master;
DROP TABLE t1;
sync_slave_with_master;
# End of 4.1 tests
--source include/rpl_end.inc

View File

@ -0,0 +1,86 @@
# ==== Purpose ====
#
# Auxiliary file used by suite/rpl/t/rpl_test_framework.test
#
# The purpose is to check that the sync chain generated in
# rpl_change_topology.inc (invoked from rpl_init.inc) is correct. This
# is done in two ways:
# (1) Print the sync chain.
# (2) Execute a statement and verify that it replicates to all slaves.
#
#
# ==== Implementation ====
#
# Does this:
# (1) Set up a given replication topology (rpl_init.inc)
# (2) Print $rpl_sync_chain
# (3) Execute "DELETE FROM t1" and then "INSERT INTO t1" on the master
# (4) Sync and compare all servers.
# (5) Clean up the replication topology (rpl_end.inc)
#
# (Technical detail: Since DELETE FROM t1 is not executed at the end,
# some servers may have rows left in t1 from a previous invocation of
# rpl_test_framework.inc. Therefore, this file will only work in
# statement mode where "DELETE FROM t1" removes rows that exist on
# slave but not on master.)
#
#
# ==== Usage ====
#
# --let $rpl_server_count= <number>
# --let $rpl_topology= <topology specification>
# --let $masters= <list of masters>
# [--let $rpl_diff_servers= <list of servers>]
# --source extra/rpl_tests/rpl_test_framework.inc
#
# Parameters:
# $next_number
# The INSERT statement will insert $next_number into t1, and
# $next_number will increase by 1.
#
# $rpl_server_count, $rpl_topology:
# See include/rpl_init.inc
#
# $masters
# This should be a list of numbers, each identifying a server.
# The DELETE and INSERT statements will be executed on all servers
# in the list.
#
# $rpl_diff_servers
# See include/rpl_diff.inc
--source include/rpl_init.inc
--source include/rpl_generate_sync_chain.inc
--echo rpl_sync_chain= '$rpl_sync_chain'
--inc $next_number
# Iterate over masters
while ($masters)
{
--let $master_i= `SELECT SUBSTRING_INDEX('$masters', ',', 1)`
--let $masters= `SELECT SUBSTRING('$masters', LENGTH('$master_i') + 2)`
# Connect to master and execute statement
--let $rpl_connection_name= server_$master_i
--source include/rpl_connection.inc
DELETE FROM t1;
--eval INSERT INTO t1 VALUES ($next_number)
}
--source include/rpl_sync.inc
# Compare all servers.
--let $diff_tables= server_$rpl_server_count:t1
--let $server_i= $rpl_server_count
--dec $server_i
while ($server_i)
{
--let $diff_tables= server_$server_i:t1,$diff_tables
--dec $server_i
}
--source include/diff_tables.inc
--let $diff_servers=
--let $masters=
--source include/rpl_end.inc

View File

@ -1,11 +1,6 @@
#
# Copyright 2006 MySQL. All rights reserved.
#
# Test to check for the different version of truncating a table.
# The statements are "TRUNCATE tbl" and "DELETE FROM tbl". We check
# the behaviour of each possible value for BINLOG_FORMAT.
#
# Author(s): Mats Kindahl
--source include/master-slave.inc
@ -14,3 +9,5 @@ let $trunc_stmt = TRUNCATE TABLE;
let $trunc_stmt = DELETE FROM;
--source extra/rpl_tests/rpl_truncate_helper.test
--source include/rpl_end.inc

View File

@ -1,4 +1,4 @@
source include/reset_master_and_slave.inc;
--source include/rpl_reset.inc
--echo **** On Master ****
connection master;
@ -10,8 +10,7 @@ connection master;
eval $trunc_stmt t1;
sync_slave_with_master;
let $diff_table_1=master:test.t1;
let $diff_table_2=slave:test.t1;
let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
--echo ==== Test using a table with delete triggers ====
@ -26,8 +25,7 @@ connection master;
eval $trunc_stmt t1;
sync_slave_with_master;
let $diff_table_1=master:test.t2;
let $diff_table_2=slave:test.t2;
let $diff_tables= master:t2, slave:t2;
source include/diff_tables.inc;
connection master;