Commit 3476b15a authored by Alfranio Correia's avatar Alfranio Correia

merge mysql-5.1-rep+3 --> mysql-5.1-rep+2-delivery1

parents 7c2c655c 0758893a
[MYSQL]
post_commit_to = "commits@lists.mysql.com"
post_push_to = "commits@lists.mysql.com"
tree_name = "mysql-5.1-rep+2"
tree_name = "mysql-5.1-rep+3"
......@@ -8,6 +8,7 @@
-- source include/have_log_bin.inc
-- source include/have_innodb.inc
call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT");
--disable_warnings
drop table if exists t1, t2;
......@@ -323,23 +324,24 @@ let $MYSQLD_DATADIR= `select @@datadir`;
# and does not make slave to stop)
if (`select @@binlog_format = 'ROW'`)
{
--exec $MYSQL_BINLOG --start-position=525 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output
--echo This does not matter in ROW mode as the rolled back changes do not contain transactional changes as these
--echo were previously flushed upon committing/rolling back each statement.
}
if (`select @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`)
{
--exec $MYSQL_BINLOG --start-position=556 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output
}
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output"))
is not null;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval select
@a like "%#%error_code=0%ROLLBACK\\n/*!*/;%ROLLBACK /* added by mysqlbinlog */;%" OR
@a like "%#%error_code=0%ROLLBACK\\r\\n/*!*/;%ROLLBACK /* added by mysqlbinlog */;%",
@a not like "%#%error_code=%error_code=%";
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output"))
is not null;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval select
@a like "%#%error_code=0%ROLLBACK\\n/*!*/;%ROLLBACK /* added by mysqlbinlog */;%" OR
@a like "%#%error_code=0%ROLLBACK\\r\\n/*!*/;%ROLLBACK /* added by mysqlbinlog */;%",
@a not like "%#%error_code=%error_code=%";
}
drop table t1, t2;
#
......
This diff is collapsed.
......@@ -22,13 +22,7 @@
#
########################################################################################
########################################################################################
# Configuring the environment
########################################################################################
--source include/have_innodb.inc
--source include/master-slave.inc
--source include/not_embedded.inc
--source include/not_windows.inc
call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT");
CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
CREATE TABLE t2(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=MyIsam;
......@@ -50,30 +44,18 @@ eval INSERT INTO t1 (a, data) VALUES (1,
--enable_query_log
--echo *** Single statement on non-transactional table ***
--echo *** After WL#2687 the difference between STATEMENT/MIXED and ROW will not exist. ***
--disable_query_log
--disable_warnings
if (`SELECT @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`)
{
eval INSERT INTO t2 (a, data) VALUES (2,
CONCAT($data, $data, $data, $data, $data, $data));
--echo Got one of the listed errors
}
if (`SELECT @@binlog_format = 'ROW'`)
{
--error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
eval INSERT INTO t2 (a, data) VALUES (2,
--error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
eval INSERT INTO t2 (a, data) VALUES (2,
CONCAT($data, $data, $data, $data, $data, $data));
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
START SLAVE SQL_THREAD;
--source include/wait_for_slave_sql_to_start.inc
}
--enable_warnings
--enable_query_log
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
START SLAVE SQL_THREAD;
--source include/wait_for_slave_sql_to_start.inc
connection master;
--disable_query_log
......@@ -86,7 +68,6 @@ eval INSERT INTO t2 (a, data) VALUES (5, $data);
--enable_query_log
--echo *** Single statement on both transactional and non-transactional tables. ***
--echo *** After WL#2687 we will be able to change the order of the tables. ***
--disable_query_log
--error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
eval UPDATE t2, t1 SET t2.data = CONCAT($data, $data, $data, $data),
......@@ -95,13 +76,25 @@ eval UPDATE t2, t1 SET t2.data = CONCAT($data, $data, $data, $data),
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
if (`SELECT @@binlog_format = 'STATEMENT'`)
{
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
}
if (`SELECT @@binlog_format = 'ROW' || @@binlog_format = 'MIXED'`)
{
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 2;
}
START SLAVE SQL_THREAD;
--source include/wait_for_slave_sql_to_start.inc
connection master;
let $diff_statement= SELECT * FROM t1;
--source include/diff_master_slave.inc
#--echo ########################################################################################
#--echo # 2 - BEGIN - IMPLICIT COMMIT by DDL
#--echo ########################################################################################
--echo ########################################################################################
--echo # 2 - BEGIN - IMPLICIT COMMIT by DDL
--echo ########################################################################################
connection master;
TRUNCATE TABLE t1;
......@@ -149,14 +142,13 @@ BEGIN;
--eval INSERT INTO t1 (a, data) VALUES (21, 's');
--enable_query_log
if (`SELECT @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`)
if (`SELECT @@binlog_format = 'STATEMENT'`)
{
--disable_query_log
CREATE TABLE t4 SELECT * FROM t1;
--enable_query_log
--echo Got one of the listed errors
}
if (`SELECT @@binlog_format = 'ROW'`)
if (`SELECT @@binlog_format = 'ROW' || @@binlog_format = 'MIXED'`)
{
--disable_query_log
--error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
......@@ -186,6 +178,17 @@ BEGIN;
CREATE TABLE t5 (a int);
--enable_query_log
if (`SELECT @@binlog_format = 'ROW' || @@binlog_format = 'MIXED'` )
{
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
START SLAVE SQL_THREAD;
--source include/wait_for_slave_sql_to_start.inc
connection master;
}
let $diff_statement= SELECT * FROM t1;
--source include/diff_master_slave.inc
......@@ -341,16 +344,30 @@ BEGIN;
--eval INSERT INTO t1 (a, data) VALUES (1, $data);
--eval INSERT INTO t1 (a, data) VALUES (2, $data);
--eval INSERT INTO t2 (a, data) VALUES (3, $data);
--error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
--eval INSERT INTO t1 (a, data) VALUES (4, $data);
if (`SELECT @@binlog_format = 'STATEMENT'`)
{
--error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
--eval INSERT INTO t1 (a, data) VALUES (4, $data);
}
if (`SELECT @@binlog_format = 'ROW' || @@binlog_format = 'MIXED'`)
{
--eval INSERT INTO t1 (a, data) VALUES (4, $data);
}
--error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
--eval INSERT INTO t1 (a, data) VALUES (5, $data);
--error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
--eval INSERT INTO t1 (a, data) VALUES (6, $data);
--error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
--eval INSERT INTO t1 (a, data) VALUES (7, $data);
--error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
--eval UPDATE t2 SET data= CONCAT($data, $data);
if (`SELECT @@binlog_format = 'STATEMENT'`)
{
--error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
--eval UPDATE t2 SET data= CONCAT($data, $data);
}
if (`SELECT @@binlog_format = 'ROW' || @@binlog_format = 'MIXED'`)
{
--eval UPDATE t2 SET data= CONCAT($data, $data);
}
--eval INSERT INTO t1 (a, data) VALUES (8, 's');
--eval INSERT INTO t1 (a, data) VALUES (9, 's');
--eval INSERT INTO t2 (a, data) VALUES (10, 's');
......@@ -363,19 +380,38 @@ BEGIN;
--eval INSERT INTO t1 (a, data) VALUES (15, $data);
--eval INSERT INTO t1 (a, data) VALUES (16, $data);
--eval INSERT INTO t2 (a, data) VALUES (17, $data);
if (`SELECT @@binlog_format = 'STATEMENT'`)
{
--error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
--eval INSERT INTO t1 (a, data) VALUES (18, $data);
}
if (`SELECT @@binlog_format = 'ROW' || @@binlog_format = 'MIXED'`)
{
--eval INSERT INTO t1 (a, data) VALUES (18, $data);
}
--error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
--eval INSERT INTO t1 (a, data) VALUES (18, $data);
--eval INSERT INTO t1 (a, data) VALUES (19, $data);
--enable_query_log
COMMIT;
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
if (`SELECT @@binlog_format = 'STATEMENT'`)
{
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
START SLAVE SQL_THREAD;
--source include/wait_for_slave_sql_to_start.inc
connection master;
}
let $diff_statement= SELECT * FROM t1;
--source include/diff_master_slave.inc
--echo ########################################################################################
--echo # CLEAN
--echo ########################################################################################
--disable_warnings
connection master;
DROP TABLE t1;
DROP TABLE t2;
......@@ -384,12 +420,4 @@ DROP TABLE IF EXISTS t4;
DROP TABLE IF EXISTS t5;
DROP TABLE IF EXISTS t6;
DROP PROCEDURE p1;
connection slave;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
DROP TABLE IF EXISTS t4;
DROP TABLE IF EXISTS t5;
DROP TABLE IF EXISTS t6;
DROP PROCEDURE p1;
--enable_warnings
sync_slave_with_master;
......@@ -102,9 +102,8 @@ SELECT * FROM t2 ORDER BY a;
connection slave;
START SLAVE;
source include/wait_for_slave_sql_to_stop.inc;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1)
--echo Slave failed with Error $errno
STOP SLAVE;
RESET SLAVE;
SELECT * FROM t2 ORDER BY a;
......@@ -155,9 +154,8 @@ INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TEST
--echo ********************************************
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1)
--echo Slave failed with Error $errno
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
......@@ -200,9 +198,8 @@ INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'),
--echo ********************************************
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1)
--echo Slave failed with Error $errno
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
......@@ -245,9 +242,8 @@ INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098),
--echo ********************************************
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1)
--echo Slave failed with Error $errno
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
......@@ -291,9 +287,8 @@ INSERT INTO t6 () VALUES(1,'Kyle',200.23,1),
--echo ********************************************
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1)
--echo Slave failed with Error $errno
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
#START SLAVE;
......@@ -500,9 +495,8 @@ INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
--echo ********************************************
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1)
--echo Slave failed with Error $errno
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
......@@ -544,9 +538,8 @@ INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
--echo ********************************************
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1)
--echo Slave failed with Error $errno
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
......@@ -816,9 +809,8 @@ ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5;
--echo ********************************************
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1)
--echo Slave failed with Error $errno
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE;
......@@ -927,9 +919,8 @@ INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX');
--echo ********************************************
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1)
--echo Slave failed with Error $errno
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
......
......@@ -20,19 +20,15 @@ rename table t1 to t5, t2 to t1;
# first don't write it to the binlog, to test the NO_WRITE_TO_BINLOG keyword.
flush no_write_to_binlog tables;
# Check that it's not in the binlog.
--replace_result $SERVER_VERSION SERVER_VERSION
--replace_column 2 # 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
eval SHOW BINLOG EVENTS FROM $rename_event_pos ;
let $binlog_start= $rename_event_pos;
source include/show_binlog_events.inc;
# Check that the master is not confused.
select * from t3;
# This FLUSH should go into the binlog to not confuse the slave.
flush tables;
# Check that it's in the binlog.
--replace_result $SERVER_VERSION SERVER_VERSION
--replace_column 2 # 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
eval SHOW BINLOG EVENTS FROM $rename_event_pos ;
let $binlog_start= $rename_event_pos;
source include/show_binlog_events.inc;
sync_slave_with_master;
# Check that the slave is not confused.
......
......@@ -47,7 +47,6 @@ insert into t1 set b=1;
insert into t2 set a=1, b=1;
set foreign_key_checks=0;
set @@session.binlog_format=row;
delete from t1;
--echo must sync w/o a problem (could not with the buggy code)
......
This diff is collapsed.
# File for specialities regarding replication from or to InnoDB
# tables.
source include/master-slave.inc;
source include/have_innodb.inc;
#
# Bug#11401: Load data infile 'REPLACE INTO' fails on slave.
#
......@@ -76,7 +70,7 @@ sync_slave_with_master;
connection slave;
# We want to verify that the following transactions are written to the
# binlog, despite the transaction is rolled back. (The should be
# binlog, despite the transaction is rolled back. (They should be
# written to the binlog since they contain non-transactional DROP
# TEMPORARY TABLE). To see that, we use the auxiliary table t1, which
# is transactional (InnoDB) on master and MyISAM on slave. t1 should
......@@ -84,6 +78,10 @@ connection slave;
# the transaction to be logged. Since t1 is non-transactional on
# slave, the change will not be rolled back, so the inserted rows will
# stay in t1 and we can verify that the transaction was replicated.
#
# Note, however, that the previous explanation is not true for ROW and
# MIXED modes as rollback on a transactional table is not written to
# the binary log.
ALTER TABLE mysqltest1.t1 ENGINE = MyISAM;
SHOW CREATE TABLE mysqltest1.t1;
......
......@@ -38,18 +38,19 @@ connection master;
truncate table t1;
# first scenario: duplicate on first row
insert delayed into t1 values(10, "my name");
if ($binlog_format_statement)
flush table t1;
if (`SELECT @@global.binlog_format = 'STATEMENT'`)
{
# statement below will be converted to non-delayed INSERT and so
# will stop at first error, guaranteeing replication.
--error ER_DUP_ENTRY
insert delayed into t1 values(10, "is Bond"), (20, "James Bond");
}
if (!$binlog_format_statement)
if (`SELECT @@global.binlog_format != 'STATEMENT'`)
{
insert delayed into t1 values(10, "is Bond"), (20, "James Bond");
}
flush table t1; # to wait for INSERT DELAYED to be done
flush table t1;
select * from t1;
sync_slave_with_master;
# when bug existed in statement-based binlogging, t1 on slave had
......@@ -59,7 +60,7 @@ select * from t1;
# second scenario: duplicate on second row
connection master;
delete from t1 where id!=10;
if ($binlog_format_statement)
if (`SELECT @@global.binlog_format = 'STATEMENT'`)
{
# statement below will be converted to non-delayed INSERT and so
# will be binlogged with its ER_DUP_ENTRY error code, guaranteeing
......@@ -67,7 +68,7 @@ if ($binlog_format_statement)
--error ER_DUP_ENTRY
insert delayed into t1 values(20, "is Bond"), (10, "James Bond");
}
if (!$binlog_format_statement)
if (`SELECT @@global.binlog_format != 'STATEMENT'`)
{
insert delayed into t1 values(20, "is Bond"), (10, "James Bond");
}
......@@ -108,6 +109,7 @@ if (`SELECT @@global.binlog_format != 'ROW'`)
{
#must show two INSERT DELAYED
--replace_column 1 x 2 x 3 x 4 x 5 x
--replace_regex /table_id: [0-9]+/table_id: #/
show binlog events in 'master-bin.000002' LIMIT 2,2;
}
select * from t1;
......@@ -118,6 +120,7 @@ if (`SELECT @@global.binlog_format != 'ROW'`)
{
#must show two INSERT DELAYED
--replace_column 1 x 2 x 3 x 4 x 5 x
--replace_regex /table_id: [0-9]+/table_id: #/
show binlog events in 'slave-bin.000002' LIMIT 2,2;
}
select * from t1;
......
......@@ -9,6 +9,8 @@
# column and index but without primary key.
##############################################################
call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT");
--echo #
--echo # Setup
--echo #
......@@ -187,7 +189,9 @@ drop trigger t1_bi;
# Check that nested call doesn't affect outer context.
select last_insert_id();
--disable_warnings
select bug15728_insert();
--enable_warnings
select last_insert_id();
insert into t1 (last_id) values (bug15728());
# This should be exactly one greater than in the previous call.
......@@ -440,7 +444,9 @@ delimiter ;|
INSERT INTO t1 VALUES (NULL, -1);
CALL p1();
--disable_warnings
SELECT f1();
--enable_warnings
INSERT INTO t1 VALUES (NULL, f2()), (NULL, LAST_INSERT_ID()),
(NULL, LAST_INSERT_ID()), (NULL, f2()), (NULL, f2());
INSERT INTO t1 VALUES (NULL, f2());
......@@ -509,7 +515,9 @@ insert into t2 (id) values(1),(2),(3);
delete from t2;
set sql_log_bin=1;
#inside SELECT, then inside INSERT
--disable_warnings
select insid();
--enable_warnings
set sql_log_bin=0;
insert into t2 (id) values(5),(6),(7);
delete from t2 where id>=5;
......
......@@ -55,7 +55,9 @@ INSERT INTO t1 VALUES (2, 2);
INSERT INTO t1 VALUES (3, 3);
INSERT INTO t1 VALUES (4, 4);
--disable_warnings
INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
--enable_warnings
SELECT * FROM t1 ORDER BY a;
......
# Requires statement logging
-- source include/have_binlog_format_mixed_or_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
......@@ -71,7 +68,7 @@ set global sql_slave_skip_counter=1;
start slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
--replace_column 1 # 7 # 8 # 9 # 16 # 22 # 23 # 33 #
--query_vertical show slave status;
# Trigger error again to test CHANGE MASTER
......@@ -93,7 +90,7 @@ stop slave;
change master to master_user='test';
change master to master_user='root';
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
--replace_column 1 # 7 # 8 # 9 # 16 # 22 # 23 # 33 #
--query_vertical show slave status;
# Trigger error again to test RESET SLAVE
......@@ -115,7 +112,7 @@ connection slave;
stop slave;
reset slave;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
--replace_column 1 # 8 # 9 # 16 # 22 # 23 # 33 #
--query_vertical show slave status;
# Finally, see if logging is done ok on master for a failing LOAD DATA INFILE
......
......@@ -43,7 +43,7 @@ show binlog events from 107 limit 1;
show binlog events from 107 limit 2;
--replace_column 2 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
show binlog events from 107 limit 2,1;
show binlog events from 107 limit 1,4;
flush logs;
# We need an extra update before doing save_master_pos.
......@@ -104,7 +104,7 @@ show binlog events in 'slave-bin.000001' from 4;
--replace_column 2 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
show binlog events in 'slave-bin.000002' from 4;
source include/show_slave_status.inc;
source include/show_slave_status2.inc;
# Need to recode the following
......
This diff is collapsed.
......@@ -141,7 +141,9 @@ let $run= 5;
while ($run)
{
START TRANSACTION;
--disable_warnings
--eval CALL tpcb.trans($rpl_format);
--enable_warnings
eval SET @my_errno= $mysql_errno;
let $run_good= `SELECT @my_errno = 0`;
let $run_bad= `SELECT @my_errno <> 0`;
......@@ -190,7 +192,9 @@ let $run= 5;
while ($run)
{
START TRANSACTION;
--disable_warnings
--eval CALL tpcb.trans($rpl_format);
--enable_warnings
eval SET @my_errno= $mysql_errno;
let $run_good= `SELECT @my_errno = 0`;
let $run_bad= `SELECT @my_errno <> 0`;
......@@ -240,7 +244,9 @@ let $run= 5;
while ($run)
{
START TRANSACTION;
--disable_warnings
--eval CALL tpcb.trans($rpl_format);
--enable_warnings
eval SET @my_errno= $mysql_errno;
let $run_good= `SELECT @my_errno = 0`;
let $run_bad= `SELECT @my_errno <> 0`;
......
......@@ -23,7 +23,7 @@ let $binary_log_limit_row= 3;
-- echo [MASTER] ********* SOW BINLOG EVENTS ... LIMIT offset,rows *********
let $binary_log_file= ;
let $binary_log_limit_row= 3;
let $binary_log_limit_row= 4;
let $binary_log_limit_offset= 1;
-- source include/show_binlog_events.inc
......@@ -49,7 +49,7 @@ let $binary_log_limit_row= 3;
-- echo [SLAVE] ********* SOW BINLOG EVENTS ... LIMIT offset,rows *********
let $binary_log_file= ;
let $binary_log_limit_row= 3;
let $binary_log_limit_row= 4;
let $binary_log_limit_offset= 1;
-- source include/show_binlog_events.inc
......
source include/master-slave.inc;
source include/have_innodb.inc;
#
# Bug#6148 ()
#
# Let the master do lots of insertions
connection master;
call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT");
connection slave;
call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT");
connection master;
create table t1(n int);
sync_slave_with_master;
......
......@@ -3,7 +3,7 @@
-- 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.");
CALL mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT");
# Load some data into t1
create table t1 (word char(20) not null);
......
-- source include/have_debug.inc
-- source include/master-slave.inc
-- source include/have_innodb.inc
# Proving that stopping in the middle of applying a group of events
# does not have immediate effect if a non-transaction table has been changed.
# The slave sql thread has to try to finish applying first.
......@@ -11,6 +7,8 @@
connection master;
call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT");
create table tm (a int auto_increment primary key) engine=myisam;
create table ti (a int auto_increment primary key) engine=innodb;
......
......@@ -547,9 +547,9 @@ call p_verify_status_increment(0, 0, 0, 0);
--echo # the binary log.
--echo #
select f1();
call p_verify_status_increment(0, 0, 1, 0);
call p_verify_status_increment(1, 0, 1, 0);
commit;
call p_verify_status_increment(0, 0, 1, 0);
call p_verify_status_increment(1, 0, 1, 0);
--echo # 17. Read-only statement, a function changes non-trans-table.
--echo #
......@@ -557,15 +557,19 @@ call p_verify_status_increment(0, 0, 1, 0);
--echo # non-transactional changes saved in the transaction cache to
--echo # the binary log.
--echo #
--disable_warnings
select f1() from t1;
call p_verify_status_increment(1, 0, 2, 0);
--enable_warnings
call p_verify_status_increment(2, 0, 2, 0);
commit;
call p_verify_status_increment(1, 0, 2, 0);
call p_verify_status_increment(2, 0, 2, 0);
--echo # 18. Read-write statement: UPDATE, change 0 (transactional) rows.
--echo #
select count(*) from t2;
--disable_warnings
update t1 set a=2 where a=f1()+10;
--enable_warnings
select count(*) from t2;
call p_verify_status_increment(2, 0, 2, 0);
commit;
......@@ -579,7 +583,7 @@ call p_verify_status_increment(2, 0, 2, 0);
drop table t2;
set sql_mode=no_engine_substitution;
create temporary table t2 (a int);
call p_verify_status_increment(0, 0, 0, 0);
call p_verify_status_increment(1, 0, 0, 0);
set sql_mode=default;
--echo # 19. A function changes temp-trans-table.
--echo #
......@@ -636,9 +640,9 @@ call p_verify_status_increment(2, 0, 1, 0);
--echo # 25. DDL: DROP TEMPORARY TABLE, does not start a transaction
--echo #
drop temporary table t2;
call p_verify_status_increment(0, 0, 0, 0);
call p_verify_status_increment(1, 0, 0, 0);
commit;
call p_verify_status_increment(0, 0, 0, 0);
call p_verify_status_increment(1, 0, 0, 0);
--echo # 26. Verify that SET AUTOCOMMIT issues an implicit commit
--echo #
......@@ -719,17 +723,17 @@ call p_verify_status_increment(4, 4, 4, 4);
--echo # Sic: no table is created.
create table if not exists t2 (a int) select 6 union select 7;
--echo # Sic: first commits the statement, and then the transaction.
call p_verify_status_increment(4, 4, 4, 4);
call p_verify_status_increment(2, 0, 4, 4);
create table t3 select a from t2;
call p_verify_status_increment(4, 4, 4, 4);
call p_verify_status_increment(2, 0, 4, 4);
alter table t3 add column (b int);
call p_verify_status_increment(2, 0, 2, 0);
alter table t3 rename t4;
call p_verify_status_increment(2, 2, 2, 2);
call p_verify_status_increment(1, 0, 1, 0);
rename table t4 to t3;
call p_verify_status_increment(2, 2, 2, 2);
call p_verify_status_increment(1, 0, 1, 0);
truncate table t3;
call p_verify_status_increment(4, 4, 4, 4);
call p_verify_status_increment(2, 0, 2, 0);
create view v1 as select * from t2;
call p_verify_status_increment(1, 0, 1, 0);
check table t1;
......
#
# Whether server supports dynamic loading.
#
--require r/have_dynamic_loading.require
if (`SELECT @@have_dynamic_loading != 'YES'`) {
--skip The test requires dynamic loading
}
disable_query_log;
show variables like 'have_dynamic_loading';
enable_query_log;
#
# Check if server has support for loading udf's
# i.e it will support dlopen
# Check if server has support for loading plugins
#
--source include/have_dynamic_loading.inc
if (`SELECT @@have_dynamic_loading != 'YES'`) {
--skip Example plugin requires dynamic loading
}
#
# Check if the variable EXAMPLE_PLUGIN is set
#
--require r/have_example_plugin.require
disable_query_log;
eval select LENGTH('$EXAMPLE_PLUGIN') > 0 as 'have_example_plugin';
if (`SELECT LENGTH('$EXAMPLE_PLUGIN') = 0`) {
--skip Example plugin requires the environment variable \$EXAMPLE_PLUGIN to be set (normally done by mtr)
}
#
# Check if --plugin-dir was setup for exampledb
#
if (`SELECT CONCAT('--plugin-dir=', @@plugin_dir) != '$EXAMPLE_PLUGIN_OPT'`) {
--skip Example plugin requires that --plugin-dir is set to the example plugin dir (either the .opt file does not contain \$EXAMPLE_PLUGIN_OPT or another plugin is in use)
}
enable_query_log;
#
# Check if dynamic loading is supported
# Check if server has support for loading plugins
#
--require r/have_dynamic_loading.require
disable_query_log;
show variables like 'have_dynamic_loading';
enable_query_log;
if (`SELECT @@have_dynamic_loading != 'YES'`) {
--skip Requires dynamic loading
}
#
# Check if the variable SEMISYNC_MASTER_PLUGIN is set
......
#
# Check if server has support for loading udf's
# i.e it will support dlopen
# Check if server has support for loading plugins
#
--source include/have_dynamic_loading.inc
if (`SELECT @@have_dynamic_loading != 'YES'`) {
--skip simple parser requires dynamic loading
}
#
# Check if the variable SIMPLE_PARSER is set
#
--require r/have_simple_parser.require
disable_query_log;
eval select LENGTH('$SIMPLE_PARSER') > 0 as 'have_simple_parser';
enable_query_log;
if (`SELECT LENGTH('$SIMPLE_PARSER') = 0`) {
--skip simple parser requires the environment variable \$SIMPLE_PARSER to be set (normally done by mtr)
}
#
# Check if --plugin-dir was setup for simple parser
#
if (`SELECT CONCAT('--plugin-dir=', @@plugin_dir) != '$SIMPLE_PARSER_OPT'`) {
--skip simple parser requires that --plugin-dir is set to the udf plugin dir (either the .opt file does not contain \$UDF_EXAMPLE_LIB_OPT or another plugin is in use)
}
#
# Check if server has support for loading udf's
# i.e it will support dlopen
# Check if server has support for loading plugins
#
--source include/have_dynamic_loading.inc
if (`SELECT @@have_dynamic_loading != 'YES'`) {
--skip UDF requires dynamic loading
}
#
# Check if the variable UDF_EXAMPLE_LIB is set
#
--require r/have_udf_example.require
disable_query_log;
eval select LENGTH('$UDF_EXAMPLE_LIB') > 0 as 'have_udf_example_lib';
enable_query_log;
if (`SELECT LENGTH('$UDF_EXAMPLE_LIB') = 0`) {
--skip UDF requires the environment variable \$UDF_EXAMPLE_LIB to be set (normally done by mtr)
}
#
# Check if --plugin-dir was setup for udf
#
if (`SELECT CONCAT('--plugin-dir=', @@plugin_dir) != '$UDF_EXAMPLE_LIB_OPT'`) {
--skip UDF requires that --plugin-dir is set to the udf plugin dir (either the .opt file does not contain \$UDF_EXAMPLE_LIB_OPT or another plugin is in use)
}
......@@ -55,11 +55,13 @@ connection master;
--echo "Running on the master"
--enable_info
eval CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=$engine_type;
--disable_warnings
INSERT INTO t1 VALUES(myfunc_int(100), myfunc_double(50.00));
INSERT INTO t1 VALUES(myfunc_int(10), myfunc_double(5.00));
INSERT INTO t1 VALUES(myfunc_int(200), myfunc_double(25.00));
INSERT INTO t1 VALUES(myfunc_int(1), myfunc_double(500.00));
SELECT * FROM t1 ORDER BY sum;
--enable_warnings
--disable_info
sync_slave_with_master;
......
This diff is collapsed.
......@@ -9,11 +9,14 @@ EXECUTE stmt1 USING @var1;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; CREATE TABLE t1(f1 blob)
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES(0x8300)
master-bin.000001 # Query # # COMMIT
SELECT HEX(f1) FROM t1;
HEX(f1)
8300
DROP table t1;
call mtr.add_suppression('Error in Log_event::read_log_event()');
CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1,
s2 CHAR(50) CHARACTER SET cp932,
d DECIMAL(10,2))|
......@@ -29,22 +32,27 @@ HEX(s1) HEX(s2) d
466F6F2773206120426172 ED40ED41ED42 47.93
DROP PROCEDURE bug18293|
DROP TABLE t4|
SHOW BINLOG EVENTS FROM 371|
SHOW BINLOG EVENTS FROM 514|
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 371 Query 1 537 use `test`; CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1,
master-bin.000001 514 Query 1 581 BEGIN
master-bin.000001 581 Query 1 788 use `mtr`; INSERT INTO test_suppressions (pattern) VALUES ( NAME_CONST('pattern',_latin1'Error in Log_event::read_log_event()' COLLATE 'latin1_swedish_ci'))
master-bin.000001 788 Query 1 856 COMMIT
master-bin.000001 856 Query 1 1019 use `test`; CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1,
s2 CHAR(50) CHARACTER SET cp932,
d DECIMAL(10,2))
master-bin.000001 537 Query 1 786 use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `bug18293`(IN ins1 CHAR(50),
master-bin.000001 1019 Query 1 1265 use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `bug18293`(IN ins1 CHAR(50),
IN ins2 CHAR(50) CHARACTER SET cp932,
IN ind DECIMAL(10,2))
BEGIN
INSERT INTO t4 VALUES (ins1, ins2, ind);
END
master-bin.000001 786 Query 1 1050 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172 COLLATE 'latin1_swedish_ci'), NAME_CONST('ins2',_cp932 0xED40ED41ED42 COLLATE 'cp932_japanese_ci'), NAME_CONST('ind',47.93))
master-bin.000001 1050 Query 1 1139 use `test`; DROP PROCEDURE bug18293
master-bin.000001 1139 Query 1 1218 use `test`; DROP TABLE t4
master-bin.000001 1265 Query 1 1333 BEGIN
master-bin.000001 1333 Query 1 1597 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172 COLLATE 'latin1_swedish_ci'), NAME_CONST('ins2',_cp932 0xED40ED41ED42 COLLATE 'cp932_japanese_ci'), NAME_CONST('ind',47.93))
master-bin.000001 1597 Query 1 1666 COMMIT
master-bin.000001 1666 Query 1 1752 use `test`; DROP PROCEDURE bug18293
master-bin.000001 1752 Query 1 1828 use `test`; DROP TABLE t4
End of 5.0 tests
SHOW BINLOG EVENTS FROM 366;
SHOW BINLOG EVENTS FROM 490;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error
Bug#44352 UPPER/LOWER function doesn't work correctly on cp932 and sjis environment.
CREATE TABLE t1 (a varchar(16)) character set cp932;
......
Variable_name Value
have_dynamic_loading YES
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
$UDF_EXAMPLE_LIB_OPT --log-output=file,table
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment