Commit 9a51d88b authored by unknown's avatar unknown

Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl

into  dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl-merge


BitKeeper/deleted/.del-binlog_start_comment.result:
  Auto merged
include/my_sys.h:
  Auto merged
mysql-test/extra/binlog_tests/blackhole.test:
  Auto merged
mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
  Auto merged
mysql-test/r/case.result:
  Auto merged
mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
  Auto merged
mysql-test/suite/binlog/r/binlog_stm_blackhole.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_000015.result:
  Auto merged
mysql-test/suite/rpl/t/rpl_000015.test:
  Auto merged
mysql-test/t/case.test:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
BitKeeper/deleted/.del-binlog_start_comment.test:
  Using remote file.
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
  Manual merge. Taking remote file to update result set after merge,
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
  Manual merge.
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
  Manual merge.
parents b0f52885 817bfa35
...@@ -521,6 +521,11 @@ typedef int (*qsort2_cmp)(const void *, const void *, const void *); ...@@ -521,6 +521,11 @@ typedef int (*qsort2_cmp)(const void *, const void *, const void *);
#define my_b_tell(info) ((info)->pos_in_file + \ #define my_b_tell(info) ((info)->pos_in_file + \
(size_t) (*(info)->current_pos - (info)->request_pos)) (size_t) (*(info)->current_pos - (info)->request_pos))
#define my_b_get_buffer_start(info) (info)->request_pos
#define my_b_get_bytes_in_buffer(info) (char*) (info)->read_end - \
(char*) my_b_get_buffer_start(info)
#define my_b_get_pos_in_file(info) (info)->pos_in_file
/* tell write offset in the SEQ_APPEND cache */ /* tell write offset in the SEQ_APPEND cache */
int my_b_copy_to_file(IO_CACHE *cache, FILE *file); int my_b_copy_to_file(IO_CACHE *cache, FILE *file);
my_off_t my_b_append_tell(IO_CACHE* info); my_off_t my_b_append_tell(IO_CACHE* info);
......
...@@ -126,7 +126,12 @@ select * from t2; ...@@ -126,7 +126,12 @@ select * from t2;
select * from t3; select * from t3;
let $VERSION=`select version()`; let $VERSION=`select version()`;
source include/show_binlog_events.inc; --replace_result $VERSION VERSION
--replace_column 2 # 4 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
--replace_regex /file_id=[0-9]+/file_id=#/
show binlog events;
drop table t1,t2,t3; drop table t1,t2,t3;
# #
...@@ -178,7 +183,14 @@ start transaction; ...@@ -178,7 +183,14 @@ start transaction;
insert into t1 values(2); insert into t1 values(2);
rollback; rollback;
set autocommit=1; set autocommit=1;
source include/show_binlog_events.inc;
let $VERSION=`select version()`;
--replace_result $VERSION VERSION
--replace_column 2 # 4 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
--replace_regex /file_id=[0-9]+/file_id=#/
show binlog events;
drop table if exists t1; drop table if exists t1;
# End of 5.1 tests # End of 5.1 tests
...@@ -355,7 +355,6 @@ drop table t1, t2; ...@@ -355,7 +355,6 @@ drop table t1, t2;
create temporary table tt (a int unique); create temporary table tt (a int unique);
create table ti (a int) engine=innodb; create table ti (a int) engine=innodb;
reset master; reset master;
show master status;
# action # action
...@@ -368,9 +367,7 @@ rollback; ...@@ -368,9 +367,7 @@ rollback;
# check # check
select count(*) from tt /* 2 */; select count(*) from tt /* 2 */;
show master status; source include/show_binlog_events.inc;
--replace_column 2 # 5 #
show binlog events from 106;
select count(*) from ti /* zero */; select count(*) from ti /* zero */;
insert into ti select * from tt; insert into ti select * from tt;
select * from ti /* that is what slave would miss - a bug */; select * from ti /* that is what slave would miss - a bug */;
...@@ -380,7 +377,6 @@ select * from ti /* that is what slave would miss - a bug */; ...@@ -380,7 +377,6 @@ select * from ti /* that is what slave would miss - a bug */;
delete from ti; delete from ti;
delete from tt where a=1; delete from tt where a=1;
reset master; reset master;
show master status;
# action # action
...@@ -393,9 +389,7 @@ rollback; ...@@ -393,9 +389,7 @@ rollback;
# check # check
show master status; source include/show_binlog_events.inc;
--replace_column 2 # 5 #
show binlog events from 106;
select count(*) from ti /* zero */; select count(*) from ti /* zero */;
insert into ti select * from tt; insert into ti select * from tt;
select * from tt /* that is what otherwise slave missed - the bug */; select * from tt /* that is what otherwise slave missed - the bug */;
...@@ -439,14 +433,14 @@ reset master; ...@@ -439,14 +433,14 @@ reset master;
--error ER_DUP_ENTRY --error ER_DUP_ENTRY
insert into t2 values (bug27417(2)); insert into t2 values (bug27417(2));
show master status; /* only (!) with fixes for #23333 will show there is the query */; source include/show_binlog_events.inc; /* only (!) with fixes for #23333 will show there is the query */;
select count(*) from t1 /* must be 3 */; select count(*) from t1 /* must be 3 */;
reset master; reset master;
select count(*) from t2; select count(*) from t2;
delete from t2 where a=bug27417(3); delete from t2 where a=bug27417(3);
select count(*) from t2 /* nothing got deleted */; select count(*) from t2 /* nothing got deleted */;
show master status; /* the query must be in regardless of #23333 */; source include/show_binlog_events.inc; /* the query must be in regardless of #23333 */;
select count(*) from t1 /* must be 5 */; select count(*) from t1 /* must be 5 */;
--enable_info --enable_info
...@@ -488,7 +482,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB; ...@@ -488,7 +482,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
# check # check
show master status /* the offset must denote there is the query */; source include/show_binlog_events.inc; /* the output must denote there is the query */;
select count(*) from t1 /* must be 1 */; select count(*) from t1 /* must be 1 */;
# #
...@@ -508,7 +502,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB; ...@@ -508,7 +502,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
# check # check
show master status /* the offset must denote there is the query */; source include/show_binlog_events.inc; /* the output must denote there is the query */;
select count(*) from t1 /* must be 2 */; select count(*) from t1 /* must be 2 */;
# #
...@@ -525,7 +519,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB; ...@@ -525,7 +519,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
update t3 set b=b+bug27417(1); update t3 set b=b+bug27417(1);
# check # check
show master status /* the offset must denote there is the query */; source include/show_binlog_events.inc; /* the output must denote there is the query */;
select count(*) from t1 /* must be 2 */; select count(*) from t1 /* must be 2 */;
## multi_update::send_eof() branch ## multi_update::send_eof() branch
...@@ -543,7 +537,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB; ...@@ -543,7 +537,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */; UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */;
# check # check
show master status /* the offset must denote there is the query */; source include/show_binlog_events.inc; /* the output must denote there is the query */;
select count(*) from t1 /* must be 4 */; select count(*) from t1 /* must be 4 */;
## send_error() branch of multi_update ## send_error() branch of multi_update
...@@ -586,7 +580,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB; ...@@ -586,7 +580,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
--error ER_DUP_ENTRY --error ER_DUP_ENTRY
delete from t2; delete from t2;
# check # check
show master status /* the offset must denote there is the query */; source include/show_binlog_events.inc; /* the output must denote there is the query */;
select count(*) from t1 /* must be 1 */; select count(*) from t1 /* must be 1 */;
# cleanup # cleanup
...@@ -607,7 +601,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB; ...@@ -607,7 +601,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
delete t2.* from t2,t5 where t2.a=t5.a + 1; delete t2.* from t2,t5 where t2.a=t5.a + 1;
# check # check
show master status /* the offset must denote there is the query */; source include/show_binlog_events.inc; /* the output must denote there is the query */;
select count(*) from t1 /* must be 1 */; select count(*) from t1 /* must be 1 */;
...@@ -627,7 +621,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB; ...@@ -627,7 +621,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
# check # check
select * from t4; select * from t4;
select count(*) from t1 /* must be 2 */; select count(*) from t1 /* must be 2 */;
show master status /* the offset must denote there is the query */; source include/show_binlog_events.inc; /* the output must denote there is the query */;
# #
# bug#23333 cleanup # bug#23333 cleanup
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
create temporary table tt (a int unique); create temporary table tt (a int unique);
create table ti (a int) engine=innodb; create table ti (a int) engine=innodb;
reset master; reset master;
show master status;
# action # action
...@@ -31,7 +30,6 @@ rollback; ...@@ -31,7 +30,6 @@ rollback;
# check # check
select count(*) from tt /* 2 */; select count(*) from tt /* 2 */;
show master status;
source include/show_binlog_events.inc; source include/show_binlog_events.inc;
select count(*) from ti /* zero */; select count(*) from ti /* zero */;
insert into ti select * from tt; insert into ti select * from tt;
...@@ -42,7 +40,6 @@ select * from ti /* that is what slave would miss - bug#28960 */; ...@@ -42,7 +40,6 @@ select * from ti /* that is what slave would miss - bug#28960 */;
delete from ti; delete from ti;
delete from tt where a=1; delete from tt where a=1;
reset master; reset master;
show master status;
# action # action
...@@ -55,7 +52,6 @@ rollback; ...@@ -55,7 +52,6 @@ rollback;
# check # check
show master status;
source include/show_binlog_events.inc; # nothing in binlog with row bilog format source include/show_binlog_events.inc; # nothing in binlog with row bilog format
select count(*) from ti /* zero */; select count(*) from ti /* zero */;
insert into ti select * from tt; insert into ti select * from tt;
......
...@@ -43,7 +43,7 @@ set global max_relay_log_size=8192-1; # mapped to 4096 ...@@ -43,7 +43,7 @@ set global max_relay_log_size=8192-1; # mapped to 4096
select @@global.max_relay_log_size; select @@global.max_relay_log_size;
start slave; start slave;
sync_with_master; sync_with_master;
source include/show_slave_status.inc; source include/show_slave_status2.inc;
--echo # --echo #
--echo # Test 2 --echo # Test 2
...@@ -55,7 +55,7 @@ set global max_relay_log_size=(5*4096); ...@@ -55,7 +55,7 @@ set global max_relay_log_size=(5*4096);
query_vertical select @@global.max_relay_log_size; query_vertical select @@global.max_relay_log_size;
start slave; start slave;
sync_with_master; sync_with_master;
source include/show_slave_status.inc; source include/show_slave_status2.inc;
--echo # --echo #
--echo # Test 3: max_relay_log_size = 0 --echo # Test 3: max_relay_log_size = 0
...@@ -67,7 +67,7 @@ set global max_relay_log_size=0; ...@@ -67,7 +67,7 @@ set global max_relay_log_size=0;
query_vertical select @@global.max_relay_log_size; query_vertical select @@global.max_relay_log_size;
start slave; start slave;
sync_with_master; sync_with_master;
source include/show_slave_status.inc; source include/show_slave_status2.inc;
--echo # --echo #
--echo # Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions --echo # Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions
...@@ -78,7 +78,7 @@ reset slave; ...@@ -78,7 +78,7 @@ reset slave;
# test of relay log rotation when the slave is stopped # test of relay log rotation when the slave is stopped
# (to make sure it does not crash). # (to make sure it does not crash).
flush logs; flush logs;
source include/show_slave_status.inc; source include/show_slave_status2.inc;
--echo # --echo #
--echo # Test 5 --echo # Test 5
...@@ -96,7 +96,7 @@ create table t1 (a int); ...@@ -96,7 +96,7 @@ create table t1 (a int);
save_master_pos; save_master_pos;
connection slave; connection slave;
sync_with_master; sync_with_master;
source include/show_slave_status.inc; source include/show_slave_status2.inc;
--echo # --echo #
--echo # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated --echo # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
...@@ -108,13 +108,12 @@ drop table t1; ...@@ -108,13 +108,12 @@ drop table t1;
save_master_pos; save_master_pos;
connection slave; connection slave;
sync_with_master; sync_with_master;
source include/show_slave_status.inc; source include/show_slave_status2.inc;
connection master; connection master;
# test that the absence of relay logs does not make a master crash # test that the absence of relay logs does not make a master crash
flush logs; flush logs;
-- replace_column 3 <Binlog_Ignore_DB> source include/show_master_status.inc;
query_vertical show master status;
# Restore max_binlog_size # Restore max_binlog_size
connection slave; connection slave;
......
...@@ -13,18 +13,18 @@ connection master; ...@@ -13,18 +13,18 @@ connection master;
save_master_pos; save_master_pos;
connection slave; connection slave;
sync_with_master; sync_with_master;
source include/show_slave_status.inc; source include/show_slave_status2.inc;
stop slave; stop slave;
change master to master_user='test'; change master to master_user='test';
source include/show_slave_status.inc; source include/show_slave_status2.inc;
reset slave; reset slave;
source include/show_slave_status.inc; source include/show_slave_status2.inc;
start slave; start slave;
sync_with_master; sync_with_master;
source include/show_slave_status.inc; source include/show_slave_status2.inc;
# test of crash with temp tables & RESET SLAVE # test of crash with temp tables & RESET SLAVE
# (test to see if RESET SLAVE clears temp tables in memory and disk) # (test to see if RESET SLAVE clears temp tables in memory and disk)
......
...@@ -122,7 +122,7 @@ INSERT INTO t1_nodef VALUES (1,2); ...@@ -122,7 +122,7 @@ INSERT INTO t1_nodef VALUES (1,2);
connection slave; connection slave;
--source include/wait_for_slave_sql_to_stop.inc --source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # --replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 36 <Last_IO_Error> 38 <Last_SQL_Error>
--query_vertical SHOW SLAVE STATUS --query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
...@@ -142,7 +142,7 @@ sync_slave_with_master; ...@@ -142,7 +142,7 @@ sync_slave_with_master;
--echo **** On Slave **** --echo **** On Slave ****
SELECT * FROM t2; SELECT * FROM t2;
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # --replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 36 <Last_IO_Error> 38 <Last_SQL_Error>
--query_vertical SHOW SLAVE STATUS --query_vertical SHOW SLAVE STATUS
connection master; connection master;
...@@ -154,7 +154,7 @@ INSERT INTO t4 VALUES (4); ...@@ -154,7 +154,7 @@ INSERT INTO t4 VALUES (4);
connection slave; connection slave;
--source include/wait_for_slave_sql_to_stop.inc --source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # --replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 36 <Last_IO_Error> 38 <Last_SQL_Error>
--query_vertical SHOW SLAVE STATUS --query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
...@@ -168,7 +168,7 @@ INSERT INTO t5 VALUES (5,10,25); ...@@ -168,7 +168,7 @@ INSERT INTO t5 VALUES (5,10,25);
connection slave; connection slave;
--source include/wait_for_slave_sql_to_stop.inc --source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # --replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 36 <Last_IO_Error> 38 <Last_SQL_Error>
--query_vertical SHOW SLAVE STATUS --query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
...@@ -182,7 +182,7 @@ INSERT INTO t6 VALUES (6,12,36); ...@@ -182,7 +182,7 @@ INSERT INTO t6 VALUES (6,12,36);
connection slave; connection slave;
--source include/wait_for_slave_sql_to_stop.inc --source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # --replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 36 <Last_IO_Error> 38 <Last_SQL_Error>
--query_vertical SHOW SLAVE STATUS --query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
...@@ -191,7 +191,7 @@ connection master; ...@@ -191,7 +191,7 @@ connection master;
INSERT INTO t9 VALUES (6); INSERT INTO t9 VALUES (6);
sync_slave_with_master; sync_slave_with_master;
--replace_result $SLAVE_MYPORT SLAVE_PORT --replace_result $SLAVE_MYPORT SLAVE_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # --replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 36 <Last_IO_Error> 38 <Last_SQL_Error>
--query_vertical SHOW SLAVE STATUS --query_vertical SHOW SLAVE STATUS
# Testing some tables extra field that can be null and cannot be null # Testing some tables extra field that can be null and cannot be null
......
# show binary logs
# mask out the binlog position
-- replace_column 2 #
show binary logs;
# --let $binlog_start=98
# Differs slightly from show_binlog events in showing server_id
# which is important for some tests
#
--let $binlog_start=106
--replace_result $binlog_start <binlog_start> --replace_result $binlog_start <binlog_start>
--replace_column 2 # 5 # --replace_column 2 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ --replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
......
# show master logs
# mask out the binlog position
-- replace_column 2 #
query_vertical show master logs;
# show master status
# mask out the binlog position
-- replace_column 2 # 3 <Binlog_Do_DB> 4 <Binlog_Ignore_DB>
show master status;
# Include file to show the slave status, masking out some information
# that varies depending on where the test is executed.
# masked out log positions
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
query_vertical SHOW SLAVE STATUS;
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t2 (id int not null primary key auto_increment);
select @@session.read_buffer_size - @@session.max_allowed_packet > 0 ;
@@session.read_buffer_size - @@session.max_allowed_packet > 0
1
load data infile 'MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' into table t2;
select count(*) from t2 /* 5 000 */;
count(*)
5000
show binlog events in 'master-bin.000002' from 98;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000002 98 Query 1 # use `test`; create table t2 (id int not null primary key auto_increment)
master-bin.000002 221 Begin_load_query 1 # ;file_id=1;block_len=7168
master-bin.000002 7412 Append_block 1 # ;file_id=1;block_len=7168
master-bin.000002 14603 Append_block 1 # ;file_id=1;block_len=2048
master-bin.000002 16674 Append_block 1 # ;file_id=1;block_len=7168
master-bin.000002 23865 Append_block 1 # ;file_id=1;block_len=341
master-bin.000002 24229 Execute_load_query 1 # use `test`; load data infile 'MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' into table t2 ;file_id=1
select count(*) from t2 /* 5 000 */;
count(*)
5000
drop table t1, t2;
end of the tests
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
reset master;
delete from mysql.user where Host='fakehost';
create user 'foo'@'fakehost';
create user 'foo'@'fakehost', 'bar'@'fakehost';
ERROR HY000: Operation CREATE USER failed for 'foo'@'fakehost'
create user 'foo'@'fakehost', 'bar'@'fakehost';
ERROR HY000: Operation CREATE USER failed for 'foo'@'fakehost','bar'@'fakehost'
select Host,User from mysql.user where Host='fakehost';
Host User
fakehost bar
fakehost foo
rename user 'foo'@'fakehost' to 'foofoo'@'fakehost';
rename user 'not_exist_user1'@'fakehost' to 'foobar'@'fakehost', 'bar'@'fakehost' to 'barbar'@'fakehost';
ERROR HY000: Operation RENAME USER failed for 'not_exist_user1'@'fakehost'
rename user 'not_exist_user1'@'fakehost' to 'foobar'@'fakehost', 'not_exist_user2'@'fakehost' to 'barfoo'@'fakehost';
ERROR HY000: Operation RENAME USER failed for 'not_exist_user1'@'fakehost','not_exist_user2'@'fakehost'
select Host,User from mysql.user where Host='fakehost';
Host User
fakehost barbar
fakehost foofoo
drop user 'foofoo'@'fakehost';
drop user 'not_exist_user1'@'fakehost', 'barbar'@'fakehost';
ERROR HY000: Operation DROP USER failed for 'not_exist_user1'@'fakehost'
drop user 'not_exist_user1'@'fakehost', 'not_exist_user2'@'fakehost';
ERROR HY000: Operation DROP USER failed for 'not_exist_user1'@'fakehost','not_exist_user2'@'fakehost'
select Host,User from mysql.user where Host='fakehost';
Host User
show binlog events from 98;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 98 Query 1 # use `test`; delete from mysql.user where Host='fakehost'
master-bin.000001 205 Query 1 # use `test`; create user 'foo'@'fakehost'
master-bin.000001 296 Query 1 # use `test`; create user 'foo'@'fakehost', 'bar'@'fakehost'
master-bin.000001 405 Query 1 # use `test`; rename user 'foo'@'fakehost' to 'foofoo'@'fakehost'
master-bin.000001 519 Query 1 # use `test`; rename user 'not_exist_user1'@'fakehost' to 'foobar'@'fakehost', 'bar'@'fakehost' to 'barbar'@'fakehost'
master-bin.000001 686 Query 1 # use `test`; drop user 'foofoo'@'fakehost'
master-bin.000001 778 Query 1 # use `test`; drop user 'not_exist_user1'@'fakehost', 'barbar'@'fakehost'
This diff is collapsed.
This diff is collapsed.
DROP TABLE IF EXISTS t1, t2, t3;
==== Read modern binlog (version 5.1.23) ====
SELECT * FROM t1 ORDER BY a;
a b
0 last_insert_id
1 one
3 last stm in trx: next event should be xid
4 four
674568 random
SELECT * FROM t2 ORDER BY a;
a b
3 first stm in trx
SELECT COUNT(*) FROM t3;
COUNT(*)
17920
DROP TABLE t1, t2, t3;
==== Read binlog from version 5.1.17 ====
SELECT * FROM t1 ORDER BY a;
a b
0 last_insert_id
1 one
3 last stm in trx: next event should be xid
4 four
764247 random
SELECT * FROM t2 ORDER BY a;
a b
3 first stm in trx
SELECT COUNT(*) FROM t3;
COUNT(*)
17920
DROP TABLE t1, t2, t3;
==== Read binlog from alcatel tree (mysql-5.1-wl2325-5.0-drop6) ====
SELECT * FROM t1 ORDER BY a;
a b
0 last_insert_id
1 one
3 last stm in trx: next event should be xid
4 four
781729 random
SELECT * FROM t2 ORDER BY a;
a b
3 first stm in trx
SELECT COUNT(*) FROM t3;
COUNT(*)
17920
DROP TABLE t1, t2, t3;
==== Read binlog from ndb tree (mysql-5.1-telco-6.1) ====
SELECT * FROM t1 ORDER BY a;
a b
0 last_insert_id
1 one
3 last stm in trx: next event should be xid
4 four
703356 random
SELECT * FROM t2 ORDER BY a;
a b
3 first stm in trx
SELECT COUNT(*) FROM t3;
COUNT(*)
17920
DROP TABLE t1, t2, t3;
...@@ -104,8 +104,9 @@ select * from t2; ...@@ -104,8 +104,9 @@ select * from t2;
a a
select * from t3; select * from t3;
a a
show binlog events from <binlog_start>; show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Format_desc # # Server ver: VERSION, Binlog ver: 4
master-bin.000001 # Query # # use `test`; drop table t1,t2 master-bin.000001 # Query # # use `test`; drop table t1,t2
master-bin.000001 # Query # # use `test`; create table t1 (a int) engine=blackhole master-bin.000001 # Query # # use `test`; create table t1 (a int) engine=blackhole
master-bin.000001 # Query # # use `test`; BEGIN master-bin.000001 # Query # # use `test`; BEGIN
...@@ -163,8 +164,9 @@ start transaction; ...@@ -163,8 +164,9 @@ start transaction;
insert into t1 values(2); insert into t1 values(2);
rollback; rollback;
set autocommit=1; set autocommit=1;
show binlog events from <binlog_start>; show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Format_desc # # Server ver: VERSION, Binlog ver: 4
master-bin.000001 # Query # # use `test`; create table t1 (a int) engine=blackhole master-bin.000001 # Query # # use `test`; create table t1 (a int) engine=blackhole
master-bin.000001 # Query # # use `test`; BEGIN master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Query # # use `test`; insert into t1 values(1) master-bin.000001 # Query # # use `test`; insert into t1 values(1)
......
# Test that old binlog formats can be read.
# Some previous versions of MySQL use their own binlog format,
# especially in row-based replication. This test uses saved binlogs
# from those old versions to test that we can replicate from old
# versions to the present version.
# Replicating from old versions to new versions is necessary in an
# online upgrade scenario, where the .
# The previous versions we currently test are:
# - version 5.1.17 and earlier trees
# - mysql-5.1-wl2325-xxx trees (AKA alcatel trees)
# - mysql-5.1-telco-6.1 trees (AKA ndb trees)
# For completeness, we also test mysql-5.1-new_rpl, which is supposed
# to be the "correct" version.
# All binlogs were generated with the same commands (listed at the end
# of this test for reference). The binlogs contain the following
# events: Table_map, Write_rows, Update_rows, Delete_rows Query, Xid,
# User_var, Int_var, Rand, Begin_load, Append_file, Execute_load.
# Related bugs: BUG#27779, BUG#31581, BUG#31582, BUG#31583, BUG#32407
--disable_warnings
DROP TABLE IF EXISTS t1, t2, t3;
--echo ==== Read modern binlog (version 5.1.23) ====
# Read binlog.
--exec $MYSQL_BINLOG suite/binlog/std_data/binlog_old_version_5_1_23.000001 | $MYSQL
# Show result.
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
SELECT COUNT(*) FROM t3;
# Reset.
DROP TABLE t1, t2, t3;
--echo ==== Read binlog from version 5.1.17 ====
# Read binlog.
--exec $MYSQL_BINLOG suite/binlog/std_data/binlog_old_version_5_1_17.000001 | $MYSQL
# Show result.
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
SELECT COUNT(*) FROM t3;
# Reset.
DROP TABLE t1, t2, t3;
--echo ==== Read binlog from alcatel tree (mysql-5.1-wl2325-5.0-drop6) ====
# In this version, it was not possible to switch between row-based and
# statement-based binlogging without restarting the server. So, we
# have two binlogs; one for row based and one for statement based
# replication.
# Read rbr binlog.
--exec $MYSQL_BINLOG suite/binlog/std_data/binlog_old_version_5_1-wl2325_row.000001 | $MYSQL
# Read stm binlog.
--exec $MYSQL_BINLOG suite/binlog/std_data/binlog_old_version_5_1-wl2325_stm.000001 | $MYSQL
# Show result.
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
SELECT COUNT(*) FROM t3;
# Reset.
DROP TABLE t1, t2, t3;
--echo ==== Read binlog from ndb tree (mysql-5.1-telco-6.1) ====
# Read binlog.
--exec $MYSQL_BINLOG suite/binlog/std_data/binlog_old_version_5_1-telco.000001 | $MYSQL
# Show resulting tablea.
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
SELECT COUNT(*) FROM t3;
# Reset.
DROP TABLE t1, t2, t3;
#### The following commands were used to generate the binlogs ####
#
#source include/master-slave.inc;
#
## ==== initialize ====
#USE test;
#CREATE TABLE t1 (a int, b char(50)) ENGINE = MyISAM;
#CREATE TABLE t2 (a int, b char(50)) ENGINE = InnoDB;
#CREATE TABLE t3 (a char(20));
#
#
## ==== row based tests ====
#SET BINLOG_FORMAT='row';
#
## ---- get write, update, and delete rows events ----
#INSERT INTO t1 VALUES (0, 'one'), (1, 'two');
#UPDATE t1 SET a=a+1;
#DELETE FROM t1 WHERE a=2;
#
#
## ==== statement based tests ====
#SET BINLOG_FORMAT = 'statement';
#
## ---- get xid events ----
#BEGIN;
#INSERT INTO t2 VALUES (3, 'first stm in trx');
#INSERT INTO t1 VALUES (3, 'last stm in trx: next event should be xid');
#COMMIT;
#
## ---- get user var events ----
#SET @x = 4;
#INSERT INTO t1 VALUES (@x, 'four');
#
## ---- get rand event ----
#INSERT INTO t1 VALUES (RAND() * 1000000, 'random');
#
## ---- get intvar event ----
#INSERT INTO t1 VALUES (LAST_INSERT_ID(), 'last_insert_id');
#
## ---- get begin, append and execute load events ----
## double the file until we have more than 2^17 bytes, so that the
## event has to be split and we can use Append_file_log_event.
#
#SET SQL_LOG_BIN=0;
#CREATE TABLE temp (a char(20));
#LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE temp;
#INSERT INTO temp SELECT * FROM temp;
#INSERT INTO temp SELECT * FROM temp;
#INSERT INTO temp SELECT * FROM temp;
#INSERT INTO temp SELECT * FROM temp;
#INSERT INTO temp SELECT * FROM temp;
#INSERT INTO temp SELECT * FROM temp;
#INSERT INTO temp SELECT * FROM temp;
#INSERT INTO temp SELECT * FROM temp;
#SELECT a FROM temp INTO OUTFILE 'big_file.dat';
#DROP TABLE temp;
#SET SQL_LOG_BIN=1;
#
#LOAD DATA INFILE 'big_file.dat' INTO TABLE t3;
#
#SELECT * FROM t1 ORDER BY a;
#SELECT * FROM t2 ORDER BY a;
#SELECT COUNT(*) FROM t3;
reset master; reset master;
show master status; show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 106 master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
reset slave; reset slave;
SHOW SLAVE STATUS; SHOW SLAVE STATUS;
change master to master_host='127.0.0.1'; change master to master_host='127.0.0.1';
...@@ -12,7 +12,7 @@ Master_User test ...@@ -12,7 +12,7 @@ Master_User test
Master_Port 3306 Master_Port 3306
Connect_Retry 7 Connect_Retry 7
Master_Log_File Master_Log_File
Read_Master_Log_Pos 4 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File Relay_Master_Log_File
...@@ -27,7 +27,7 @@ Replicate_Wild_Ignore_Table ...@@ -27,7 +27,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 0 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
...@@ -53,7 +53,7 @@ Master_User root ...@@ -53,7 +53,7 @@ Master_User root
Master_Port MASTER_PORT Master_Port MASTER_PORT
Connect_Retry 7 Connect_Retry 7
Master_Log_File Master_Log_File
Read_Master_Log_Pos 4 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File Relay_Master_Log_File
...@@ -68,7 +68,7 @@ Replicate_Wild_Ignore_Table ...@@ -68,7 +68,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 0 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
...@@ -93,7 +93,7 @@ Master_User root ...@@ -93,7 +93,7 @@ Master_User root
Master_Port MASTER_PORT Master_Port MASTER_PORT
Connect_Retry 7 Connect_Retry 7
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos 106 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001 Relay_Master_Log_File master-bin.000001
...@@ -108,7 +108,7 @@ Replicate_Wild_Ignore_Table ...@@ -108,7 +108,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 106 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
......
...@@ -33,7 +33,7 @@ Replicate_Wild_Ignore_Table ...@@ -33,7 +33,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 191 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
...@@ -73,7 +73,7 @@ Replicate_Wild_Ignore_Table ...@@ -73,7 +73,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 191 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
......
...@@ -7,40 +7,40 @@ start slave; ...@@ -7,40 +7,40 @@ start slave;
**** On Master **** **** On Master ****
CREATE USER dummy@localhost; CREATE USER dummy@localhost;
CREATE USER dummy1@localhost, dummy2@localhost; CREATE USER dummy1@localhost, dummy2@localhost;
SELECT user, host FROM mysql.user WHERE user != 'root'; SELECT user, host FROM mysql.user WHERE user like 'dummy%';
user host user host
dummy localhost dummy localhost
dummy1 localhost dummy1 localhost
dummy2 localhost dummy2 localhost
SELECT COUNT(*) FROM mysql.user; SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
COUNT(*) COUNT(*)
6 3
**** On Slave **** **** On Slave ****
SELECT user,host FROM mysql.user WHERE user != 'root'; SELECT user,host FROM mysql.user WHERE user like 'dummy%';
user host user host
dummy localhost dummy localhost
dummy1 localhost dummy1 localhost
dummy2 localhost dummy2 localhost
SELECT COUNT(*) FROM mysql.user; SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
COUNT(*) COUNT(*)
6 3
**** On Master **** **** On Master ****
DROP USER nonexisting@localhost; DROP USER nonexisting@localhost;
ERROR HY000: Operation DROP USER failed for 'nonexisting'@'localhost' ERROR HY000: Operation DROP USER failed for 'nonexisting'@'localhost'
DROP USER nonexisting@localhost, dummy@localhost; DROP USER nonexisting@localhost, dummy@localhost;
ERROR HY000: Operation DROP USER failed for 'nonexisting'@'localhost' ERROR HY000: Operation DROP USER failed for 'nonexisting'@'localhost'
DROP USER dummy1@localhost, dummy2@localhost; DROP USER dummy1@localhost, dummy2@localhost;
SELECT user, host FROM mysql.user WHERE user != 'root'; SELECT user, host FROM mysql.user WHERE user like 'dummy%';
user host user host
SELECT COUNT(*) FROM mysql.user; SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
COUNT(*) COUNT(*)
3 0
**** On Slave **** **** On Slave ****
SELECT user,host FROM mysql.user WHERE user != 'root'; SELECT user,host FROM mysql.user WHERE user like 'dummy%';
user host user host
SELECT COUNT(*) FROM mysql.user; SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
COUNT(*) COUNT(*)
3 0
SHOW SLAVE STATUS; SHOW SLAVE STATUS;
Slave_IO_State # Slave_IO_State #
Master_Host 127.0.0.1 Master_Host 127.0.0.1
...@@ -48,7 +48,7 @@ Master_User root ...@@ -48,7 +48,7 @@ Master_User root
Master_Port MASTER_PORT Master_Port MASTER_PORT
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos 617 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001 Relay_Master_Log_File master-bin.000001
...@@ -57,13 +57,13 @@ Slave_SQL_Running Yes ...@@ -57,13 +57,13 @@ Slave_SQL_Running Yes
Replicate_Do_DB Replicate_Do_DB
Replicate_Ignore_DB Replicate_Ignore_DB
Replicate_Do_Table Replicate_Do_Table
Replicate_Ignore_Table Replicate_Ignore_Table #
Replicate_Wild_Do_Table Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 617 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
...@@ -76,7 +76,7 @@ Master_SSL_Cipher ...@@ -76,7 +76,7 @@ Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0 Last_IO_Errno #
Last_IO_Error Last_IO_Error #
Last_SQL_Errno 0 Last_SQL_Errno 0
Last_SQL_Error Last_SQL_Error
...@@ -4,6 +4,7 @@ reset master; ...@@ -4,6 +4,7 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
set global max_connections=151;
stop slave; stop slave;
start slave; start slave;
show variables like 'init_slave'; show variables like 'init_slave';
......
...@@ -6,7 +6,7 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; ...@@ -6,7 +6,7 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
show master status; show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 106 <Binlog_Ignore_DB> master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
stop slave; stop slave;
change master to master_log_pos=75; change master to master_log_pos=75;
SHOW SLAVE STATUS; SHOW SLAVE STATUS;
...@@ -16,7 +16,7 @@ Master_User root ...@@ -16,7 +16,7 @@ Master_User root
Master_Port MASTER_PORT Master_Port MASTER_PORT
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos 75 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001 Relay_Master_Log_File master-bin.000001
...@@ -31,7 +31,7 @@ Replicate_Wild_Ignore_Table ...@@ -31,7 +31,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 75 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
...@@ -91,12 +91,12 @@ Last_SQL_Errno 0 ...@@ -91,12 +91,12 @@ Last_SQL_Errno 0
Last_SQL_Error Last_SQL_Error
show master status; show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 106 <Binlog_Ignore_DB> master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
create table if not exists t1 (n int); create table if not exists t1 (n int);
drop table if exists t1; drop table if exists t1;
create table t1 (n int); create table t1 (n int);
insert into t1 values (1),(2),(3); insert into t1 values (1),(2),(3);
change master to master_log_pos=106; change master to master_log_pos=4;
start slave; start slave;
select * from t1 ORDER BY n; select * from t1 ORDER BY n;
n n
......
...@@ -21,7 +21,7 @@ Master_User root ...@@ -21,7 +21,7 @@ Master_User root
Master_Port MASTER_PORT Master_Port MASTER_PORT
Connect_Retry 60 Connect_Retry 60
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos 556 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001 Relay_Master_Log_File master-bin.000001
...@@ -36,7 +36,7 @@ Replicate_Wild_Ignore_Table ...@@ -36,7 +36,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 556 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
...@@ -63,9 +63,9 @@ insert into t2 values (34),(67),(123); ...@@ -63,9 +63,9 @@ insert into t2 values (34),(67),(123);
flush logs; flush logs;
show binary logs; show binary logs;
Log_name File_size Log_name File_size
master-bin.000001 600 master-bin.000001 #
master-bin.000002 371 master-bin.000002 #
master-bin.000003 106 master-bin.000003 #
create table t3 select * from temp_table; create table t3 select * from temp_table;
select * from t3; select * from t3;
a a
...@@ -78,21 +78,22 @@ set global sql_slave_skip_counter=1; ...@@ -78,21 +78,22 @@ set global sql_slave_skip_counter=1;
start slave; start slave;
purge master logs to 'master-bin.000002'; purge master logs to 'master-bin.000002';
show master logs; show master logs;
Log_name File_size Log_name master-bin.000002
master-bin.000002 371 File_size #
master-bin.000003 415 Log_name master-bin.000003
File_size #
purge binary logs to 'master-bin.000002'; purge binary logs to 'master-bin.000002';
show binary logs; show binary logs;
Log_name File_size Log_name File_size
master-bin.000002 371 master-bin.000002 #
master-bin.000003 415 master-bin.000003 #
select @time_for_purge:=DATE_ADD(UPDATE_TIME, INTERVAL 1 SECOND) select @time_for_purge:=DATE_ADD(UPDATE_TIME, INTERVAL 1 SECOND)
from information_schema.tables from information_schema.tables
where TABLE_SCHEMA="test" and TABLE_NAME="t2"; where TABLE_SCHEMA="test" and TABLE_NAME="t2";
purge master logs before (@time_for_purge); purge master logs before (@time_for_purge);
show binary logs; show binary logs;
Log_name File_size Log_name File_size
master-bin.000003 415 master-bin.000003 #
insert into t2 values (65); insert into t2 values (65);
SHOW SLAVE STATUS; SHOW SLAVE STATUS;
Slave_IO_State # Slave_IO_State #
...@@ -101,7 +102,7 @@ Master_User root ...@@ -101,7 +102,7 @@ Master_User root
Master_Port MASTER_PORT Master_Port MASTER_PORT
Connect_Retry 60 Connect_Retry 60
Master_Log_File master-bin.000003 Master_Log_File master-bin.000003
Read_Master_Log_Pos 504 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File master-bin.000003 Relay_Master_Log_File master-bin.000003
...@@ -116,7 +117,7 @@ Replicate_Wild_Ignore_Table ...@@ -116,7 +117,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 504 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
...@@ -149,12 +150,12 @@ count(*) ...@@ -149,12 +150,12 @@ count(*)
create table t4 select * from temp_table; create table t4 select * from temp_table;
show binary logs; show binary logs;
Log_name File_size Log_name File_size
master-bin.000003 4193 master-bin.000003 #
master-bin.000004 4198 master-bin.000004 #
master-bin.000005 2040 master-bin.000005 #
show master status; show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000005 2040 master-bin.000005 # <Binlog_Do_DB> <Binlog_Ignore_DB>
select * from t4; select * from t4;
a a
testing temporary tables part 2 testing temporary tables part 2
...@@ -165,7 +166,7 @@ Master_User root ...@@ -165,7 +166,7 @@ Master_User root
Master_Port MASTER_PORT Master_Port MASTER_PORT
Connect_Retry 60 Connect_Retry 60
Master_Log_File master-bin.000005 Master_Log_File master-bin.000005
Read_Master_Log_Pos 2040 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File master-bin.000005 Relay_Master_Log_File master-bin.000005
...@@ -180,7 +181,7 @@ Replicate_Wild_Ignore_Table ...@@ -180,7 +181,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 2040 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
......
...@@ -30,7 +30,7 @@ Master_User root ...@@ -30,7 +30,7 @@ Master_User root
Master_Port MASTER_PORT Master_Port MASTER_PORT
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos 60268 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001 Relay_Master_Log_File master-bin.000001
...@@ -45,7 +45,7 @@ Replicate_Wild_Ignore_Table ...@@ -45,7 +45,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 60268 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
...@@ -78,7 +78,7 @@ Master_User root ...@@ -78,7 +78,7 @@ Master_User root
Master_Port MASTER_PORT Master_Port MASTER_PORT
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos 60268 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001 Relay_Master_Log_File master-bin.000001
...@@ -93,7 +93,7 @@ Replicate_Wild_Ignore_Table ...@@ -93,7 +93,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 60268 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
...@@ -126,7 +126,7 @@ Master_User root ...@@ -126,7 +126,7 @@ Master_User root
Master_Port MASTER_PORT Master_Port MASTER_PORT
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos 60268 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001 Relay_Master_Log_File master-bin.000001
...@@ -141,7 +141,7 @@ Replicate_Wild_Ignore_Table ...@@ -141,7 +141,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 60268 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
...@@ -171,7 +171,7 @@ Master_User root ...@@ -171,7 +171,7 @@ Master_User root
Master_Port MASTER_PORT Master_Port MASTER_PORT
Connect_Retry 1 Connect_Retry 1
Master_Log_File Master_Log_File
Read_Master_Log_Pos 4 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File Relay_Master_Log_File
...@@ -186,7 +186,7 @@ Replicate_Wild_Ignore_Table ...@@ -186,7 +186,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 0 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
...@@ -217,7 +217,7 @@ Master_User root ...@@ -217,7 +217,7 @@ Master_User root
Master_Port MASTER_PORT Master_Port MASTER_PORT
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos 60354 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001 Relay_Master_Log_File master-bin.000001
...@@ -232,7 +232,7 @@ Replicate_Wild_Ignore_Table ...@@ -232,7 +232,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 60354 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
...@@ -261,7 +261,7 @@ Master_User root ...@@ -261,7 +261,7 @@ Master_User root
Master_Port MASTER_PORT Master_Port MASTER_PORT
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos 60430 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001 Relay_Master_Log_File master-bin.000001
...@@ -276,7 +276,7 @@ Replicate_Wild_Ignore_Table ...@@ -276,7 +276,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 60430 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
...@@ -295,10 +295,8 @@ Last_SQL_Errno 0 ...@@ -295,10 +295,8 @@ Last_SQL_Errno 0
Last_SQL_Error Last_SQL_Error
flush logs; flush logs;
show master status; show master status;
File master-bin.000002 File Position Binlog_Do_DB Binlog_Ignore_DB
Position 106 master-bin.000002 # <Binlog_Do_DB> <Binlog_Ignore_DB>
Binlog_Do_DB <Binlog_Ignore_DB>
Binlog_Ignore_DB
set global max_binlog_size= @my_max_binlog_size; set global max_binlog_size= @my_max_binlog_size;
# #
# End of 4.1 tests # End of 4.1 tests
......
...@@ -11,7 +11,7 @@ Master_User root ...@@ -11,7 +11,7 @@ Master_User root
Master_Port MASTER_PORT Master_Port MASTER_PORT
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos 106 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001 Relay_Master_Log_File master-bin.000001
...@@ -26,7 +26,7 @@ Replicate_Wild_Ignore_Table ...@@ -26,7 +26,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 106 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
...@@ -52,7 +52,7 @@ Master_User test ...@@ -52,7 +52,7 @@ Master_User test
Master_Port MASTER_PORT Master_Port MASTER_PORT
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos 106 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001 Relay_Master_Log_File master-bin.000001
...@@ -67,7 +67,7 @@ Replicate_Wild_Ignore_Table ...@@ -67,7 +67,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 106 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
...@@ -92,7 +92,7 @@ Master_User root ...@@ -92,7 +92,7 @@ Master_User root
Master_Port MASTER_PORT Master_Port MASTER_PORT
Connect_Retry 1 Connect_Retry 1
Master_Log_File Master_Log_File
Read_Master_Log_Pos 4 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File Relay_Master_Log_File
...@@ -107,7 +107,7 @@ Replicate_Wild_Ignore_Table ...@@ -107,7 +107,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 0 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
...@@ -132,7 +132,7 @@ Master_User root ...@@ -132,7 +132,7 @@ Master_User root
Master_Port MASTER_PORT Master_Port MASTER_PORT
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos 106 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001 Relay_Master_Log_File master-bin.000001
...@@ -147,7 +147,7 @@ Replicate_Wild_Ignore_Table ...@@ -147,7 +147,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 106 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
......
...@@ -125,7 +125,7 @@ Replicate_Ignore_Table ...@@ -125,7 +125,7 @@ Replicate_Ignore_Table
Replicate_Wild_Do_Table Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table Replicate_Wild_Ignore_Table
Last_Errno 1364 Last_Errno 1364
Last_Error Field 'x' doesn't have a default value Last_Error <Last_Error>
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos # Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
...@@ -141,9 +141,9 @@ Master_SSL_Key ...@@ -141,9 +141,9 @@ Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0 Last_IO_Errno 0
Last_IO_Error Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 1364 Last_SQL_Errno 1364
Last_SQL_Error Field 'x' doesn't have a default value Last_SQL_Error <Last_SQL_Error>
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
INSERT INTO t9 VALUES (2); INSERT INTO t9 VALUES (2);
...@@ -176,7 +176,7 @@ Replicate_Ignore_Table ...@@ -176,7 +176,7 @@ Replicate_Ignore_Table
Replicate_Wild_Do_Table Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error <Last_Error>
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos # Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
...@@ -192,9 +192,9 @@ Master_SSL_Key ...@@ -192,9 +192,9 @@ Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0 Last_IO_Errno 0
Last_IO_Error Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 0 Last_SQL_Errno 0
Last_SQL_Error Last_SQL_Error <Last_SQL_Error>
INSERT INTO t9 VALUES (4); INSERT INTO t9 VALUES (4);
INSERT INTO t4 VALUES (4); INSERT INTO t4 VALUES (4);
SHOW SLAVE STATUS; SHOW SLAVE STATUS;
...@@ -217,7 +217,7 @@ Replicate_Ignore_Table ...@@ -217,7 +217,7 @@ Replicate_Ignore_Table
Replicate_Wild_Do_Table Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table Replicate_Wild_Ignore_Table
Last_Errno 1535 Last_Errno 1535
Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 3, test.t4 has type 4 Last_Error <Last_Error>
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos # Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
...@@ -233,9 +233,9 @@ Master_SSL_Key ...@@ -233,9 +233,9 @@ Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0 Last_IO_Errno 0
Last_IO_Error Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 1535 Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 3, test.t4 has type 4 Last_SQL_Error <Last_SQL_Error>
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
INSERT INTO t9 VALUES (5); INSERT INTO t9 VALUES (5);
...@@ -260,7 +260,7 @@ Replicate_Ignore_Table ...@@ -260,7 +260,7 @@ Replicate_Ignore_Table
Replicate_Wild_Do_Table Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table Replicate_Wild_Ignore_Table
Last_Errno 1535 Last_Errno 1535
Last_Error Table definition on master and slave does not match: Column 1 type mismatch - received type 3, test.t5 has type 4 Last_Error <Last_Error>
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos # Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
...@@ -276,9 +276,9 @@ Master_SSL_Key ...@@ -276,9 +276,9 @@ Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0 Last_IO_Errno 0
Last_IO_Error Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 1535 Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 1 type mismatch - received type 3, test.t5 has type 4 Last_SQL_Error <Last_SQL_Error>
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
INSERT INTO t9 VALUES (6); INSERT INTO t9 VALUES (6);
...@@ -303,7 +303,7 @@ Replicate_Ignore_Table ...@@ -303,7 +303,7 @@ Replicate_Ignore_Table
Replicate_Wild_Do_Table Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table Replicate_Wild_Ignore_Table
Last_Errno 1535 Last_Errno 1535
Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 3, test.t6 has type 4 Last_Error <Last_Error>
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos # Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
...@@ -319,9 +319,9 @@ Master_SSL_Key ...@@ -319,9 +319,9 @@ Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0 Last_IO_Errno 0
Last_IO_Error Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 1535 Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 3, test.t6 has type 4 Last_SQL_Error <Last_SQL_Error>
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
INSERT INTO t9 VALUES (6); INSERT INTO t9 VALUES (6);
...@@ -345,7 +345,7 @@ Replicate_Ignore_Table ...@@ -345,7 +345,7 @@ Replicate_Ignore_Table
Replicate_Wild_Do_Table Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error <Last_Error>
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos # Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
...@@ -361,9 +361,9 @@ Master_SSL_Key ...@@ -361,9 +361,9 @@ Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0 Last_IO_Errno 0
Last_IO_Error Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 0 Last_SQL_Errno 0
Last_SQL_Error Last_SQL_Error <Last_SQL_Error>
INSERT INTO t7 VALUES (1),(2),(3); INSERT INTO t7 VALUES (1),(2),(3);
INSERT INTO t8 VALUES (1),(2),(3); INSERT INTO t8 VALUES (1),(2),(3);
SELECT * FROM t7 ORDER BY a; SELECT * FROM t7 ORDER BY a;
......
...@@ -125,7 +125,7 @@ Replicate_Ignore_Table ...@@ -125,7 +125,7 @@ Replicate_Ignore_Table
Replicate_Wild_Do_Table Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table Replicate_Wild_Ignore_Table
Last_Errno 1364 Last_Errno 1364
Last_Error Field 'x' doesn't have a default value Last_Error <Last_Error>
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos # Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
...@@ -141,9 +141,9 @@ Master_SSL_Key ...@@ -141,9 +141,9 @@ Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0 Last_IO_Errno 0
Last_IO_Error Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 1364 Last_SQL_Errno 1364
Last_SQL_Error Field 'x' doesn't have a default value Last_SQL_Error <Last_SQL_Error>
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
INSERT INTO t9 VALUES (2); INSERT INTO t9 VALUES (2);
...@@ -176,7 +176,7 @@ Replicate_Ignore_Table ...@@ -176,7 +176,7 @@ Replicate_Ignore_Table
Replicate_Wild_Do_Table Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error <Last_Error>
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos # Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
...@@ -192,9 +192,9 @@ Master_SSL_Key ...@@ -192,9 +192,9 @@ Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0 Last_IO_Errno 0
Last_IO_Error Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 0 Last_SQL_Errno 0
Last_SQL_Error Last_SQL_Error <Last_SQL_Error>
INSERT INTO t9 VALUES (4); INSERT INTO t9 VALUES (4);
INSERT INTO t4 VALUES (4); INSERT INTO t4 VALUES (4);
SHOW SLAVE STATUS; SHOW SLAVE STATUS;
...@@ -217,7 +217,7 @@ Replicate_Ignore_Table ...@@ -217,7 +217,7 @@ Replicate_Ignore_Table
Replicate_Wild_Do_Table Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table Replicate_Wild_Ignore_Table
Last_Errno 1535 Last_Errno 1535
Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 3, test.t4 has type 4 Last_Error <Last_Error>
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos # Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
...@@ -233,9 +233,9 @@ Master_SSL_Key ...@@ -233,9 +233,9 @@ Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0 Last_IO_Errno 0
Last_IO_Error Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 1535 Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 3, test.t4 has type 4 Last_SQL_Error <Last_SQL_Error>
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
INSERT INTO t9 VALUES (5); INSERT INTO t9 VALUES (5);
...@@ -260,7 +260,7 @@ Replicate_Ignore_Table ...@@ -260,7 +260,7 @@ Replicate_Ignore_Table
Replicate_Wild_Do_Table Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table Replicate_Wild_Ignore_Table
Last_Errno 1535 Last_Errno 1535
Last_Error Table definition on master and slave does not match: Column 1 type mismatch - received type 3, test.t5 has type 4 Last_Error <Last_Error>
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos # Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
...@@ -276,9 +276,9 @@ Master_SSL_Key ...@@ -276,9 +276,9 @@ Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0 Last_IO_Errno 0
Last_IO_Error Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 1535 Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 1 type mismatch - received type 3, test.t5 has type 4 Last_SQL_Error <Last_SQL_Error>
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
INSERT INTO t9 VALUES (6); INSERT INTO t9 VALUES (6);
...@@ -303,7 +303,7 @@ Replicate_Ignore_Table ...@@ -303,7 +303,7 @@ Replicate_Ignore_Table
Replicate_Wild_Do_Table Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table Replicate_Wild_Ignore_Table
Last_Errno 1535 Last_Errno 1535
Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 3, test.t6 has type 4 Last_Error <Last_Error>
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos # Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
...@@ -319,9 +319,9 @@ Master_SSL_Key ...@@ -319,9 +319,9 @@ Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0 Last_IO_Errno 0
Last_IO_Error Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 1535 Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 3, test.t6 has type 4 Last_SQL_Error <Last_SQL_Error>
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
INSERT INTO t9 VALUES (6); INSERT INTO t9 VALUES (6);
...@@ -345,7 +345,7 @@ Replicate_Ignore_Table ...@@ -345,7 +345,7 @@ Replicate_Ignore_Table
Replicate_Wild_Do_Table Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error <Last_Error>
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos # Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
...@@ -361,9 +361,9 @@ Master_SSL_Key ...@@ -361,9 +361,9 @@ Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0 Last_IO_Errno 0
Last_IO_Error Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 0 Last_SQL_Errno 0
Last_SQL_Error Last_SQL_Error <Last_SQL_Error>
INSERT INTO t7 VALUES (1),(2),(3); INSERT INTO t7 VALUES (1),(2),(3);
INSERT INTO t8 VALUES (1),(2),(3); INSERT INTO t8 VALUES (1),(2),(3);
SELECT * FROM t7 ORDER BY a; SELECT * FROM t7 ORDER BY a;
......
...@@ -29,7 +29,43 @@ select * from t1; ...@@ -29,7 +29,43 @@ select * from t1;
a a
1 1
2 2
show slave status; SHOW SLAVE STATUS;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Slave_IO_State #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 851 # # master-bin.000001 Yes Yes 0 0 851 # None 0 No # No 0 0 Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos #
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
drop table t1; drop table t1;
...@@ -28,7 +28,7 @@ Master_User root ...@@ -28,7 +28,7 @@ Master_User root
Master_Port MASTER_PORT Master_Port MASTER_PORT
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos 72960 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001 Relay_Master_Log_File master-bin.000001
...@@ -43,7 +43,7 @@ Replicate_Wild_Ignore_Table ...@@ -43,7 +43,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 72960 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
...@@ -76,7 +76,7 @@ Master_User root ...@@ -76,7 +76,7 @@ Master_User root
Master_Port MASTER_PORT Master_Port MASTER_PORT
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos 72960 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001 Relay_Master_Log_File master-bin.000001
...@@ -91,7 +91,7 @@ Replicate_Wild_Ignore_Table ...@@ -91,7 +91,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 72960 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
...@@ -124,7 +124,7 @@ Master_User root ...@@ -124,7 +124,7 @@ Master_User root
Master_Port MASTER_PORT Master_Port MASTER_PORT
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos 72960 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001 Relay_Master_Log_File master-bin.000001
...@@ -139,7 +139,7 @@ Replicate_Wild_Ignore_Table ...@@ -139,7 +139,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 72960 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
...@@ -169,7 +169,7 @@ Master_User root ...@@ -169,7 +169,7 @@ Master_User root
Master_Port MASTER_PORT Master_Port MASTER_PORT
Connect_Retry 1 Connect_Retry 1
Master_Log_File Master_Log_File
Read_Master_Log_Pos 4 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File Relay_Master_Log_File
...@@ -184,7 +184,7 @@ Replicate_Wild_Ignore_Table ...@@ -184,7 +184,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 0 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
...@@ -215,7 +215,7 @@ Master_User root ...@@ -215,7 +215,7 @@ Master_User root
Master_Port MASTER_PORT Master_Port MASTER_PORT
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos 73046 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001 Relay_Master_Log_File master-bin.000001
...@@ -230,7 +230,7 @@ Replicate_Wild_Ignore_Table ...@@ -230,7 +230,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 73046 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
...@@ -259,7 +259,7 @@ Master_User root ...@@ -259,7 +259,7 @@ Master_User root
Master_Port MASTER_PORT Master_Port MASTER_PORT
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos 73122 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001 Relay_Master_Log_File master-bin.000001
...@@ -274,7 +274,7 @@ Replicate_Wild_Ignore_Table ...@@ -274,7 +274,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 73122 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
...@@ -293,10 +293,8 @@ Last_SQL_Errno 0 ...@@ -293,10 +293,8 @@ Last_SQL_Errno 0
Last_SQL_Error Last_SQL_Error
flush logs; flush logs;
show master status; show master status;
File master-bin.000002 File Position Binlog_Do_DB Binlog_Ignore_DB
Position 106 master-bin.000002 # <Binlog_Do_DB> <Binlog_Ignore_DB>
Binlog_Do_DB <Binlog_Ignore_DB>
Binlog_Ignore_DB
set global max_binlog_size= @my_max_binlog_size; set global max_binlog_size= @my_max_binlog_size;
# #
# End of 4.1 tests # End of 4.1 tests
......
...@@ -11,7 +11,7 @@ Master_User root ...@@ -11,7 +11,7 @@ Master_User root
Master_Port MASTER_PORT Master_Port MASTER_PORT
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos 106 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001 Relay_Master_Log_File master-bin.000001
...@@ -26,7 +26,7 @@ Replicate_Wild_Ignore_Table ...@@ -26,7 +26,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 106 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
...@@ -52,7 +52,7 @@ Master_User test ...@@ -52,7 +52,7 @@ Master_User test
Master_Port MASTER_PORT Master_Port MASTER_PORT
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos 106 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001 Relay_Master_Log_File master-bin.000001
...@@ -67,7 +67,7 @@ Replicate_Wild_Ignore_Table ...@@ -67,7 +67,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 106 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
...@@ -92,7 +92,7 @@ Master_User root ...@@ -92,7 +92,7 @@ Master_User root
Master_Port MASTER_PORT Master_Port MASTER_PORT
Connect_Retry 1 Connect_Retry 1
Master_Log_File Master_Log_File
Read_Master_Log_Pos 4 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File Relay_Master_Log_File
...@@ -107,7 +107,7 @@ Replicate_Wild_Ignore_Table ...@@ -107,7 +107,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 0 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
...@@ -132,7 +132,7 @@ Master_User root ...@@ -132,7 +132,7 @@ Master_User root
Master_Port MASTER_PORT Master_Port MASTER_PORT
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos 106 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001 Relay_Master_Log_File master-bin.000001
...@@ -147,7 +147,7 @@ Replicate_Wild_Ignore_Table ...@@ -147,7 +147,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 106 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
......
...@@ -26,7 +26,7 @@ Master_User root ...@@ -26,7 +26,7 @@ Master_User root
Master_Port MASTER_PORT Master_Port MASTER_PORT
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos 784 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001 Relay_Master_Log_File master-bin.000001
...@@ -41,7 +41,7 @@ Replicate_Wild_Ignore_Table ...@@ -41,7 +41,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 327 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition Master Until_Condition Master
Until_Log_File master-bin.000001 Until_Log_File master-bin.000001
...@@ -72,7 +72,7 @@ Master_User root ...@@ -72,7 +72,7 @@ Master_User root
Master_Port MASTER_PORT Master_Port MASTER_PORT
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos 784 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001 Relay_Master_Log_File master-bin.000001
...@@ -87,7 +87,7 @@ Replicate_Wild_Ignore_Table ...@@ -87,7 +87,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 327 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition Master Until_Condition Master
Until_Log_File master-no-such-bin.000001 Until_Log_File master-no-such-bin.000001
...@@ -116,7 +116,7 @@ Master_User root ...@@ -116,7 +116,7 @@ Master_User root
Master_Port MASTER_PORT Master_Port MASTER_PORT
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos 784 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001 Relay_Master_Log_File master-bin.000001
...@@ -131,7 +131,7 @@ Replicate_Wild_Ignore_Table ...@@ -131,7 +131,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 616 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition Relay Until_Condition Relay
Until_Log_File slave-relay-bin.000004 Until_Log_File slave-relay-bin.000004
...@@ -158,7 +158,7 @@ Master_User root ...@@ -158,7 +158,7 @@ Master_User root
Master_Port MASTER_PORT Master_Port MASTER_PORT
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos 784 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001 Relay_Master_Log_File master-bin.000001
...@@ -173,7 +173,7 @@ Replicate_Wild_Ignore_Table ...@@ -173,7 +173,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 784 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition Master Until_Condition Master
Until_Log_File master-bin.000001 Until_Log_File master-bin.000001
......
...@@ -46,7 +46,7 @@ Master_User root ...@@ -46,7 +46,7 @@ Master_User root
Master_Port MASTER_PORT Master_Port MASTER_PORT
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos 408 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001 Relay_Master_Log_File master-bin.000001
...@@ -61,7 +61,7 @@ Replicate_Wild_Ignore_Table ...@@ -61,7 +61,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 408 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
......
...@@ -9,22 +9,22 @@ connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK); ...@@ -9,22 +9,22 @@ connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
connect (slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK); connect (slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK);
connection master; connection master;
reset master; reset master;
show master status; source include/show_master_status.inc;
save_master_pos; save_master_pos;
connection slave; connection slave;
reset slave; reset slave;
source include/show_slave_status.inc; source include/show_slave_status2.inc;
change master to master_host='127.0.0.1'; change master to master_host='127.0.0.1';
# The following needs to be cleaned up when change master is fixed # The following needs to be cleaned up when change master is fixed
source include/show_slave_status.inc; source include/show_slave_status2.inc;
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
eval change master to master_host='127.0.0.1',master_user='root', eval change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=$MASTER_MYPORT; master_password='',master_port=$MASTER_MYPORT;
source include/show_slave_status.inc; source include/show_slave_status2.inc;
start slave; start slave;
sync_with_master; sync_with_master;
source include/show_slave_status.inc; source include/show_slave_status2.inc;
connection master; connection master;
--disable_warnings --disable_warnings
drop table if exists t1; drop table if exists t1;
......
...@@ -18,13 +18,9 @@ save_master_pos; ...@@ -18,13 +18,9 @@ save_master_pos;
connection slave; connection slave;
--real_sleep 3 # wait for I/O thread to have read updates --real_sleep 3 # wait for I/O thread to have read updates
stop slave; stop slave;
--replace_result $MASTER_MYPORT MASTER_PORT source include/show_slave_status2.inc;
--replace_column 1 # 7 # 8 # 9 # 16 # 23 # 33 # 35 # 36 #
query_vertical SHOW SLAVE STATUS;
change master to master_user='root'; change master to master_user='root';
--replace_result $MASTER_MYPORT MASTER_PORT source include/show_slave_status2.inc;
--replace_column 1 # 7 # 8 # 9 # 16 # 23 # 33 # 35 # 36 #
query_vertical SHOW SLAVE STATUS;
start slave; start slave;
sync_with_master; sync_with_master;
select * from t1; select * from t1;
......
...@@ -147,12 +147,14 @@ INSERT INTO t1 VALUES ("This is a test of col a.", ...@@ -147,12 +147,14 @@ INSERT INTO t1 VALUES ("This is a test of col a.",
"This is a test of the large col c.", "This is a test of the large col c.",
"Col d"); "Col d");
SELECT * FROM t1; SELECT * FROM t1;
--replace_result default DEFAULT
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
sync_slave_with_master slave; sync_slave_with_master slave;
--echo Insert some values and select them on slave --echo Insert some values and select them on slave
SELECT * FROM t1; SELECT * FROM t1;
--replace_result default DEFAULT
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
...@@ -200,12 +202,14 @@ INSERT INTO t1 VALUES ( ...@@ -200,12 +202,14 @@ INSERT INTO t1 VALUES (
); );
SELECT BIN(a), BIN(b), BIN(c), BIN(d), BIN(e) FROM t1; SELECT BIN(a), BIN(b), BIN(c), BIN(d), BIN(e) FROM t1;
--replace_result default DEFAULT
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
sync_slave_with_master slave; sync_slave_with_master slave;
--echo Insert some values and select them on master --echo Insert some values and select them on master
SELECT BIN(a), BIN(b), BIN(c), BIN(d), BIN(e) FROM t1; SELECT BIN(a), BIN(b), BIN(c), BIN(d), BIN(e) FROM t1;
--replace_result default DEFAULT
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
--echo *** Cleanup *** --echo *** Cleanup ***
......
...@@ -9,12 +9,12 @@ connection master; ...@@ -9,12 +9,12 @@ connection master;
CREATE USER dummy@localhost; CREATE USER dummy@localhost;
CREATE USER dummy1@localhost, dummy2@localhost; CREATE USER dummy1@localhost, dummy2@localhost;
SELECT user, host FROM mysql.user WHERE user != 'root'; # root host non-determ SELECT user, host FROM mysql.user WHERE user like 'dummy%';
SELECT COUNT(*) FROM mysql.user; SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
sync_slave_with_master; sync_slave_with_master;
--echo **** On Slave **** --echo **** On Slave ****
SELECT user,host FROM mysql.user WHERE user != 'root'; # root host non-determ SELECT user,host FROM mysql.user WHERE user like 'dummy%';
SELECT COUNT(*) FROM mysql.user; SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
--echo **** On Master **** --echo **** On Master ****
connection master; connection master;
...@@ -30,13 +30,11 @@ DROP USER nonexisting@localhost, dummy@localhost; ...@@ -30,13 +30,11 @@ DROP USER nonexisting@localhost, dummy@localhost;
# All users exist # All users exist
DROP USER dummy1@localhost, dummy2@localhost; DROP USER dummy1@localhost, dummy2@localhost;
SELECT user, host FROM mysql.user WHERE user != 'root'; # root host non-determ SELECT user, host FROM mysql.user WHERE user like 'dummy%';
SELECT COUNT(*) FROM mysql.user; SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
sync_slave_with_master; sync_slave_with_master;
--echo **** On Slave **** --echo **** On Slave ****
SELECT user,host FROM mysql.user WHERE user != 'root'; # root host non-determ SELECT user,host FROM mysql.user WHERE user like 'dummy%';
SELECT COUNT(*) FROM mysql.user; SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
--replace_result $MASTER_MYPORT MASTER_PORT source include/show_slave_status2.inc;
--replace_column 1 # 8 # 9 # 23 # 33 #
query_vertical SHOW SLAVE STATUS;
...@@ -4,6 +4,8 @@ source include/master-slave.inc; ...@@ -4,6 +4,8 @@ source include/master-slave.inc;
# Test of init_slave variable # Test of init_slave variable
# #
set global max_connections=151;
connection slave; connection slave;
stop slave; stop slave;
source include/wait_for_slave_to_stop.inc; source include/wait_for_slave_to_stop.inc;
......
...@@ -11,14 +11,13 @@ ...@@ -11,14 +11,13 @@
# Passes with rbr no problem, removed statement include [jbm] # Passes with rbr no problem, removed statement include [jbm]
source include/master-slave.inc; source include/master-slave.inc;
--replace_column 3 <Binlog_Ignore_DB> source include/show_master_status.inc;
show master status;
sync_slave_with_master; sync_slave_with_master;
stop slave; stop slave;
--source include/wait_for_slave_to_stop.inc --source include/wait_for_slave_to_stop.inc
change master to master_log_pos=75; change master to master_log_pos=75;
source include/show_slave_status.inc; source include/show_slave_status2.inc;
start slave; start slave;
let $slave_param= Slave_SQL_Running; let $slave_param= Slave_SQL_Running;
let $slave_param_value= Yes; let $slave_param_value= Yes;
...@@ -31,15 +30,14 @@ stop slave; ...@@ -31,15 +30,14 @@ stop slave;
source include/show_slave_status.inc; source include/show_slave_status.inc;
connection master; connection master;
--replace_column 3 <Binlog_Ignore_DB> source include/show_master_status.inc;
show master status;
create table if not exists t1 (n int); create table if not exists t1 (n int);
drop table if exists t1; drop table if exists t1;
create table t1 (n int); create table t1 (n int);
insert into t1 values (1),(2),(3); insert into t1 values (1),(2),(3);
save_master_pos; save_master_pos;
connection slave; connection slave;
change master to master_log_pos=106; change master to master_log_pos=4;
start slave; start slave;
sync_with_master; sync_with_master;
select * from t1 ORDER BY n; select * from t1 ORDER BY n;
......
...@@ -65,14 +65,14 @@ insert into temp_table values ("testing temporary tables"); ...@@ -65,14 +65,14 @@ insert into temp_table values ("testing temporary tables");
create table t1 (s text); create table t1 (s text);
insert into t1 values('Could not break slave'),('Tried hard'); insert into t1 values('Could not break slave'),('Tried hard');
sync_slave_with_master; sync_slave_with_master;
source include/show_slave_status.inc; source include/show_slave_status2.inc;
select * from t1; select * from t1;
connection master; connection master;
flush logs; flush logs;
create table t2(m int not null auto_increment primary key); create table t2(m int not null auto_increment primary key);
insert into t2 values (34),(67),(123); insert into t2 values (34),(67),(123);
flush logs; flush logs;
show binary logs; source include/show_binary_logs.inc;
create table t3 select * from temp_table; create table t3 select * from temp_table;
sync_slave_with_master; sync_slave_with_master;
...@@ -106,10 +106,10 @@ connection master; ...@@ -106,10 +106,10 @@ connection master;
sync_slave_with_master; sync_slave_with_master;
connection master; connection master;
purge master logs to 'master-bin.000002'; purge master logs to 'master-bin.000002';
show master logs; source include/show_master_logs.inc;
# we just tests if synonyms are accepted # we just tests if synonyms are accepted
purge binary logs to 'master-bin.000002'; purge binary logs to 'master-bin.000002';
show binary logs; source include/show_binary_logs.inc;
# Calculate time to use in "purge master logs before" by taking # Calculate time to use in "purge master logs before" by taking
# last modification time of t2 and adding 1 second # last modification time of t2 and adding 1 second
...@@ -122,10 +122,10 @@ select @time_for_purge:=DATE_ADD(UPDATE_TIME, INTERVAL 1 SECOND) ...@@ -122,10 +122,10 @@ select @time_for_purge:=DATE_ADD(UPDATE_TIME, INTERVAL 1 SECOND)
--enable_result_log --enable_result_log
purge master logs before (@time_for_purge); purge master logs before (@time_for_purge);
show binary logs; source include/show_binary_logs.inc;
insert into t2 values (65); insert into t2 values (65);
sync_slave_with_master; sync_slave_with_master;
source include/show_slave_status.inc; source include/show_slave_status2.inc;
select * from t2; select * from t2;
# #
...@@ -148,14 +148,14 @@ while ($1) ...@@ -148,14 +148,14 @@ while ($1)
enable_query_log; enable_query_log;
select count(*) from t3 where n >= 4; select count(*) from t3 where n >= 4;
create table t4 select * from temp_table; create table t4 select * from temp_table;
show binary logs; source include/show_binary_logs.inc;
show master status; source include/show_master_status.inc;
save_master_pos; save_master_pos;
connection slave; connection slave;
sync_with_master; sync_with_master;
select * from t4; select * from t4;
source include/show_slave_status.inc; source include/show_slave_status2.inc;
# because of concurrent insert, the table may not be up to date # because of concurrent insert, the table may not be up to date
# if we do not lock # if we do not lock
lock tables t3 read; lock tables t3 read;
......
...@@ -50,9 +50,7 @@ sync_slave_with_master; ...@@ -50,9 +50,7 @@ sync_slave_with_master;
connection slave; connection slave;
select @@server_id; select @@server_id;
select * from t1; select * from t1;
--replace_column 1 # 8 # 9 # 23 # 33 # source include/show_slave_status2.inc;
--replace_result $MASTER_MYPORT MASTER_PORT
show slave status;
connection master; connection master;
drop table t1; drop table t1;
sync_with_master; sync_with_master;
......
...@@ -31,20 +31,20 @@ start slave until master_log_file='master-bin.000001', master_log_pos=323; ...@@ -31,20 +31,20 @@ start slave until master_log_file='master-bin.000001', master_log_pos=323;
--source include/wait_for_slave_sql_to_stop.inc --source include/wait_for_slave_sql_to_stop.inc
# here table should be still not deleted # here table should be still not deleted
select * from t1; select * from t1;
source include/show_slave_status.inc; source include/show_slave_status2.inc;
# this should fail right after start # this should fail right after start
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291; start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
--source include/wait_for_slave_sql_to_stop.inc --source include/wait_for_slave_sql_to_stop.inc
# again this table should be still not deleted # again this table should be still not deleted
select * from t1; select * from t1;
source include/show_slave_status.inc; source include/show_slave_status2.inc;
# try replicate all up to and not including the second insert to t2; # try replicate all up to and not including the second insert to t2;
start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=746; start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=746;
--source include/wait_for_slave_sql_to_stop.inc --source include/wait_for_slave_sql_to_stop.inc
select * from t2; select * from t2;
source include/show_slave_status.inc; source include/show_slave_status2.inc;
# clean up # clean up
start slave; start slave;
...@@ -61,7 +61,7 @@ start slave until master_log_file='master-bin.000001', master_log_pos=776; ...@@ -61,7 +61,7 @@ start slave until master_log_file='master-bin.000001', master_log_pos=776;
--source include/wait_for_slave_sql_to_stop.inc --source include/wait_for_slave_sql_to_stop.inc
# here the sql slave thread should be stopped # here the sql slave thread should be stopped
--replace_result bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004 --replace_result bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004
source include/show_slave_status.inc; source include/show_slave_status2.inc;
#testing various error conditions #testing various error conditions
--error 1277 --error 1277
......
...@@ -23,7 +23,7 @@ sync_slave_with_master; ...@@ -23,7 +23,7 @@ sync_slave_with_master;
set @@global.slave_exec_mode= default; set @@global.slave_exec_mode= default;
SHOW STATUS LIKE 'Slave_retried_transactions'; SHOW STATUS LIKE 'Slave_retried_transactions';
SELECT * FROM t1; SELECT * FROM t1;
source include/show_slave_status.inc; source include/show_slave_status2.inc;
DROP TABLE t1; DROP TABLE t1;
--echo **** On Master **** --echo **** On Master ****
......
--read_buffer_size=9K --max_allowed_packet=8K
#
# check replication of load data with the server parameters subjected to
# read_buffer_size > max_allowed_packet
#
# BUG#30435 loading large LOAD DATA INFILE breaks slave with
# read_buffer_size set on master
# BUG#33413 show binlog events fails if binlog has event size of close
# to max_allowed_packet
source include/master-slave.inc;
source include/have_innodb.inc;
--disable_query_log
let $rows= 5000;
create table t1 (id int not null primary key auto_increment);
while($rows)
{
eval insert into t1 values (null);
dec $rows;
}
eval select * into outfile '$MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' from t1;
flush logs;
--enable_query_log
connection master;
create table t2 (id int not null primary key auto_increment);
select @@session.read_buffer_size - @@session.max_allowed_packet > 0 ;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval load data infile '$MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' into table t2;
select count(*) from t2 /* 5 000 */;
# the binglog will show fragmented Append_block events
--let $binlog_start=98
--replace_column 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\//
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--eval show binlog events in 'master-bin.000002' from $binlog_start
sync_slave_with_master;
#connection slave;
select count(*) from t2 /* 5 000 */;
connection master;
drop table t1, t2;
sync_slave_with_master;
remove_file $MYSQLTEST_VARDIR/tmp/bug30435_5k.txt;
--echo end of the tests
# BUG#33862 completely failed DROP USER statement gets replicated
--source include/master-slave.inc
reset master;
#
# remove all users will be used in the test
#
delete from mysql.user where Host='fakehost';
sync_slave_with_master;
#
# Test create user
#
connection master;
create user 'foo'@'fakehost';
--error ER_CANNOT_USER
create user 'foo'@'fakehost', 'bar'@'fakehost';
--error ER_CANNOT_USER
create user 'foo'@'fakehost', 'bar'@'fakehost';
sync_slave_with_master;
select Host,User from mysql.user where Host='fakehost';
#
# Test rename user
#
connection master;
rename user 'foo'@'fakehost' to 'foofoo'@'fakehost';
--error ER_CANNOT_USER
rename user 'not_exist_user1'@'fakehost' to 'foobar'@'fakehost', 'bar'@'fakehost' to 'barbar'@'fakehost';
--error ER_CANNOT_USER
rename user 'not_exist_user1'@'fakehost' to 'foobar'@'fakehost', 'not_exist_user2'@'fakehost' to 'barfoo'@'fakehost';
sync_slave_with_master;
select Host,User from mysql.user where Host='fakehost';
#
# Test drop user
#
connection master;
drop user 'foofoo'@'fakehost';
--error ER_CANNOT_USER
drop user 'not_exist_user1'@'fakehost', 'barbar'@'fakehost';
--error ER_CANNOT_USER
drop user 'not_exist_user1'@'fakehost', 'not_exist_user2'@'fakehost';
sync_slave_with_master;
select Host,User from mysql.user where Host='fakehost';
#
# show the binlog events on the master
#
connection master;
source include/show_binlog_events.inc;
...@@ -1071,6 +1071,29 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len, ...@@ -1071,6 +1071,29 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len,
} }
else else
{ {
/*
In some previuos versions (see comment in
Format_description_log_event::Format_description_log_event(char*,...)),
event types were assigned different id numbers than in the
present version. In order to replicate from such versions to the
present version, we must map those event type id's to our event
type id's. The mapping is done with the event_type_permutation
array, which was set up when the Format_description_log_event
was read.
*/
if (description_event->event_type_permutation)
{
IF_DBUG({
int new_event_type=
description_event->event_type_permutation[event_type];
DBUG_PRINT("info",
("converting event type %d to %d (%s)",
event_type, new_event_type,
get_type_str((Log_event_type)new_event_type)));
});
event_type= description_event->event_type_permutation[event_type];
}
switch(event_type) { switch(event_type) {
case QUERY_EVENT: case QUERY_EVENT:
ev = new Query_log_event(buf, event_len, description_event, QUERY_EVENT); ev = new Query_log_event(buf, event_len, description_event, QUERY_EVENT);
...@@ -2773,7 +2796,7 @@ int Start_log_event_v3::do_apply_event(Relay_log_info const *rli) ...@@ -2773,7 +2796,7 @@ int Start_log_event_v3::do_apply_event(Relay_log_info const *rli)
Format_description_log_event:: Format_description_log_event::
Format_description_log_event(uint8 binlog_ver, const char* server_ver) Format_description_log_event(uint8 binlog_ver, const char* server_ver)
:Start_log_event_v3() :Start_log_event_v3(), event_type_permutation(0)
{ {
binlog_version= binlog_ver; binlog_version= binlog_ver;
switch (binlog_ver) { switch (binlog_ver) {
...@@ -2898,7 +2921,7 @@ Format_description_log_event(const char* buf, ...@@ -2898,7 +2921,7 @@ Format_description_log_event(const char* buf,
const const
Format_description_log_event* Format_description_log_event*
description_event) description_event)
:Start_log_event_v3(buf, description_event) :Start_log_event_v3(buf, description_event), event_type_permutation(0)
{ {
DBUG_ENTER("Format_description_log_event::Format_description_log_event(char*,...)"); DBUG_ENTER("Format_description_log_event::Format_description_log_event(char*,...)");
buf+= LOG_EVENT_MINIMAL_HEADER_LEN; buf+= LOG_EVENT_MINIMAL_HEADER_LEN;
...@@ -2913,6 +2936,65 @@ Format_description_log_event(const char* buf, ...@@ -2913,6 +2936,65 @@ Format_description_log_event(const char* buf,
number_of_event_types* number_of_event_types*
sizeof(*post_header_len), MYF(0)); sizeof(*post_header_len), MYF(0));
calc_server_version_split(); calc_server_version_split();
/*
In some previous versions, the events were given other event type
id numbers than in the present version. When replicating from such
a version, we therefore set up an array that maps those id numbers
to the id numbers of the present server.
If post_header_len is null, it means malloc failed, and is_valid
will fail, so there is no need to do anything.
The trees which have wrong event id's are:
mysql-5.1-wl2325-5.0-drop6p13-alpha, mysql-5.1-wl2325-5.0-drop6,
mysql-5.1-wl2325-5.0, mysql-5.1-wl2325-no-dd (`grep -C2
BEGIN_LOAD_QUERY_EVENT /home/bk/ * /sql/log_event.h`). The
corresponding version (`grep mysql, configure.in` in those trees)
strings are 5.2.2-a_drop6p13-alpha, 5.2.2-a_drop6p13c,
5.1.5-a_drop5p20, 5.1.2-a_drop5p5.
*/
if (post_header_len &&
(strncmp(server_version, "5.1.2-a_drop5", 13) == 0 ||
strncmp(server_version, "5.1.5-a_drop5", 13) == 0 ||
strncmp(server_version, "5.2.2-a_drop6", 13) == 0))
{
if (number_of_event_types != 22)
{
DBUG_PRINT("info", (" number_of_event_types=%d",
number_of_event_types));
/* this makes is_valid() return false. */
my_free(post_header_len, MYF(MY_ALLOW_ZERO_PTR));
post_header_len= NULL;
DBUG_VOID_RETURN;
}
static const uint8 perm[23]=
{
UNKNOWN_EVENT, START_EVENT_V3, QUERY_EVENT, STOP_EVENT, ROTATE_EVENT,
INTVAR_EVENT, LOAD_EVENT, SLAVE_EVENT, CREATE_FILE_EVENT,
APPEND_BLOCK_EVENT, EXEC_LOAD_EVENT, DELETE_FILE_EVENT,
NEW_LOAD_EVENT,
RAND_EVENT, USER_VAR_EVENT,
FORMAT_DESCRIPTION_EVENT,
TABLE_MAP_EVENT,
PRE_GA_WRITE_ROWS_EVENT,
PRE_GA_UPDATE_ROWS_EVENT,
PRE_GA_DELETE_ROWS_EVENT,
XID_EVENT,
BEGIN_LOAD_QUERY_EVENT,
EXECUTE_LOAD_QUERY_EVENT,
};
event_type_permutation= perm;
/*
Since we use (permuted) event id's to index the post_header_len
array, we need to permute the post_header_len array too.
*/
uint8 post_header_len_temp[23];
for (int i= 1; i < 23; i++)
post_header_len_temp[perm[i] - 1]= post_header_len[i - 1];
for (int i= 0; i < 22; i++)
post_header_len[i] = post_header_len_temp[i];
}
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
......
...@@ -2106,12 +2106,16 @@ public: ...@@ -2106,12 +2106,16 @@ public:
/* The list of post-headers' lengthes */ /* The list of post-headers' lengthes */
uint8 *post_header_len; uint8 *post_header_len;
uchar server_version_split[3]; uchar server_version_split[3];
const uint8 *event_type_permutation;
Format_description_log_event(uint8 binlog_ver, const char* server_ver=0); Format_description_log_event(uint8 binlog_ver, const char* server_ver=0);
Format_description_log_event(const char* buf, uint event_len, Format_description_log_event(const char* buf, uint event_len,
const Format_description_log_event const Format_description_log_event
*description_event); *description_event);
~Format_description_log_event() { my_free((uchar*)post_header_len, MYF(0)); } ~Format_description_log_event()
{
my_free((uchar*)post_header_len, MYF(MY_ALLOW_ZERO_PTR));
}
Log_event_type get_type_code() { return FORMAT_DESCRIPTION_EVENT;} Log_event_type get_type_code() { return FORMAT_DESCRIPTION_EVENT;}
#ifndef MYSQL_CLIENT #ifndef MYSQL_CLIENT
bool write(IO_CACHE* file); bool write(IO_CACHE* file);
......
...@@ -5579,6 +5579,7 @@ bool mysql_create_user(THD *thd, List <LEX_USER> &list) ...@@ -5579,6 +5579,7 @@ bool mysql_create_user(THD *thd, List <LEX_USER> &list)
LEX_USER *user_name, *tmp_user_name; LEX_USER *user_name, *tmp_user_name;
List_iterator <LEX_USER> user_list(list); List_iterator <LEX_USER> user_list(list);
TABLE_LIST tables[GRANT_TABLES]; TABLE_LIST tables[GRANT_TABLES];
bool some_users_created= FALSE;
DBUG_ENTER("mysql_create_user"); DBUG_ENTER("mysql_create_user");
/* /*
...@@ -5614,6 +5615,7 @@ bool mysql_create_user(THD *thd, List <LEX_USER> &list) ...@@ -5614,6 +5615,7 @@ bool mysql_create_user(THD *thd, List <LEX_USER> &list)
continue; continue;
} }
some_users_created= TRUE;
sql_mode= thd->variables.sql_mode; sql_mode= thd->variables.sql_mode;
if (replace_user_table(thd, tables[0].table, *user_name, 0, 0, 1, 0)) if (replace_user_table(thd, tables[0].table, *user_name, 0, 0, 1, 0))
{ {
...@@ -5624,12 +5626,14 @@ bool mysql_create_user(THD *thd, List <LEX_USER> &list) ...@@ -5624,12 +5626,14 @@ bool mysql_create_user(THD *thd, List <LEX_USER> &list)
VOID(pthread_mutex_unlock(&acl_cache->lock)); VOID(pthread_mutex_unlock(&acl_cache->lock));
if (result)
my_error(ER_CANNOT_USER, MYF(0), "CREATE USER", wrong_users.c_ptr_safe());
if (some_users_created)
write_bin_log(thd, FALSE, thd->query, thd->query_length); write_bin_log(thd, FALSE, thd->query, thd->query_length);
rw_unlock(&LOCK_grant); rw_unlock(&LOCK_grant);
close_thread_tables(thd); close_thread_tables(thd);
if (result)
my_error(ER_CANNOT_USER, MYF(0), "CREATE USER", wrong_users.c_ptr_safe());
DBUG_RETURN(result); DBUG_RETURN(result);
} }
...@@ -5654,6 +5658,7 @@ bool mysql_drop_user(THD *thd, List <LEX_USER> &list) ...@@ -5654,6 +5658,7 @@ bool mysql_drop_user(THD *thd, List <LEX_USER> &list)
LEX_USER *user_name, *tmp_user_name; LEX_USER *user_name, *tmp_user_name;
List_iterator <LEX_USER> user_list(list); List_iterator <LEX_USER> user_list(list);
TABLE_LIST tables[GRANT_TABLES]; TABLE_LIST tables[GRANT_TABLES];
bool some_users_deleted= FALSE;
DBUG_ENTER("mysql_drop_user"); DBUG_ENTER("mysql_drop_user");
/* /*
...@@ -5682,7 +5687,9 @@ bool mysql_drop_user(THD *thd, List <LEX_USER> &list) ...@@ -5682,7 +5687,9 @@ bool mysql_drop_user(THD *thd, List <LEX_USER> &list)
{ {
append_user(&wrong_users, user_name); append_user(&wrong_users, user_name);
result= TRUE; result= TRUE;
continue;
} }
some_users_deleted= TRUE;
} }
/* Rebuild 'acl_check_hosts' since 'acl_users' has been modified */ /* Rebuild 'acl_check_hosts' since 'acl_users' has been modified */
...@@ -5693,6 +5700,7 @@ bool mysql_drop_user(THD *thd, List <LEX_USER> &list) ...@@ -5693,6 +5700,7 @@ bool mysql_drop_user(THD *thd, List <LEX_USER> &list)
if (result) if (result)
my_error(ER_CANNOT_USER, MYF(0), "DROP USER", wrong_users.c_ptr_safe()); my_error(ER_CANNOT_USER, MYF(0), "DROP USER", wrong_users.c_ptr_safe());
if (some_users_deleted)
write_bin_log(thd, FALSE, thd->query, thd->query_length); write_bin_log(thd, FALSE, thd->query, thd->query_length);
rw_unlock(&LOCK_grant); rw_unlock(&LOCK_grant);
...@@ -5722,6 +5730,7 @@ bool mysql_rename_user(THD *thd, List <LEX_USER> &list) ...@@ -5722,6 +5730,7 @@ bool mysql_rename_user(THD *thd, List <LEX_USER> &list)
LEX_USER *user_to, *tmp_user_to; LEX_USER *user_to, *tmp_user_to;
List_iterator <LEX_USER> user_list(list); List_iterator <LEX_USER> user_list(list);
TABLE_LIST tables[GRANT_TABLES]; TABLE_LIST tables[GRANT_TABLES];
bool some_users_renamed= FALSE;
DBUG_ENTER("mysql_rename_user"); DBUG_ENTER("mysql_rename_user");
/* /*
...@@ -5762,7 +5771,9 @@ bool mysql_rename_user(THD *thd, List <LEX_USER> &list) ...@@ -5762,7 +5771,9 @@ bool mysql_rename_user(THD *thd, List <LEX_USER> &list)
{ {
append_user(&wrong_users, user_from); append_user(&wrong_users, user_from);
result= TRUE; result= TRUE;
continue;
} }
some_users_renamed= TRUE;
} }
/* Rebuild 'acl_check_hosts' since 'acl_users' has been modified */ /* Rebuild 'acl_check_hosts' since 'acl_users' has been modified */
...@@ -5770,12 +5781,14 @@ bool mysql_rename_user(THD *thd, List <LEX_USER> &list) ...@@ -5770,12 +5781,14 @@ bool mysql_rename_user(THD *thd, List <LEX_USER> &list)
VOID(pthread_mutex_unlock(&acl_cache->lock)); VOID(pthread_mutex_unlock(&acl_cache->lock));
if (result)
my_error(ER_CANNOT_USER, MYF(0), "RENAME USER", wrong_users.c_ptr_safe());
if (some_users_renamed && mysql_bin_log.is_open())
write_bin_log(thd, FALSE, thd->query, thd->query_length); write_bin_log(thd, FALSE, thd->query, thd->query_length);
rw_unlock(&LOCK_grant); rw_unlock(&LOCK_grant);
close_thread_tables(thd); close_thread_tables(thd);
if (result)
my_error(ER_CANNOT_USER, MYF(0), "RENAME USER", wrong_users.c_ptr_safe());
DBUG_RETURN(result); DBUG_RETURN(result);
} }
......
...@@ -1272,7 +1272,6 @@ bool dispatch_command(enum enum_server_command command, THD *thd, ...@@ -1272,7 +1272,6 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
unregister_slave(thd,1,1); unregister_slave(thd,1,1);
/* fake COM_QUIT -- if we get here, the thread needs to terminate */ /* fake COM_QUIT -- if we get here, the thread needs to terminate */
error = TRUE; error = TRUE;
net->error = 0;
break; break;
} }
#endif #endif
......
...@@ -1243,9 +1243,6 @@ bool change_master(THD* thd, Master_info* mi) ...@@ -1243,9 +1243,6 @@ bool change_master(THD* thd, Master_info* mi)
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
} }
} }
mi->rli.group_master_log_pos = mi->master_log_pos;
DBUG_PRINT("info", ("master_log_pos: %lu", (ulong) mi->master_log_pos));
/* /*
Coordinates in rli were spoilt by the 'if (need_relay_log_purge)' block, Coordinates in rli were spoilt by the 'if (need_relay_log_purge)' block,
so restore them to good values. If we left them to ''/0, that would work; so restore them to good values. If we left them to ''/0, that would work;
...@@ -1257,6 +1254,7 @@ bool change_master(THD* thd, Master_info* mi) ...@@ -1257,6 +1254,7 @@ bool change_master(THD* thd, Master_info* mi)
That's why we always save good coords in rli. That's why we always save good coords in rli.
*/ */
mi->rli.group_master_log_pos= mi->master_log_pos; mi->rli.group_master_log_pos= mi->master_log_pos;
DBUG_PRINT("info", ("master_log_pos: %lu", (ulong) mi->master_log_pos));
strmake(mi->rli.group_master_log_name,mi->master_log_name, strmake(mi->rli.group_master_log_name,mi->master_log_name,
sizeof(mi->rli.group_master_log_name)-1); sizeof(mi->rli.group_master_log_name)-1);
...@@ -1376,6 +1374,11 @@ bool mysql_show_binlog_events(THD* thd) ...@@ -1376,6 +1374,11 @@ bool mysql_show_binlog_events(THD* thd)
if ((file=open_binlog(&log, linfo.log_file_name, &errmsg)) < 0) if ((file=open_binlog(&log, linfo.log_file_name, &errmsg)) < 0)
goto err; goto err;
/*
to account binlog event header size
*/
thd->variables.max_allowed_packet += MAX_LOG_EVENT_HEADER;
pthread_mutex_lock(log_lock); pthread_mutex_lock(log_lock);
/* /*
...@@ -1386,7 +1389,6 @@ bool mysql_show_binlog_events(THD* thd) ...@@ -1386,7 +1389,6 @@ bool mysql_show_binlog_events(THD* thd)
This code will fail on a mixed relay log (one which has Format_desc then This code will fail on a mixed relay log (one which has Format_desc then
Rotate then Format_desc). Rotate then Format_desc).
*/ */
ev = Log_event::read_log_event(&log,(pthread_mutex_t*)0,description_event); ev = Log_event::read_log_event(&log,(pthread_mutex_t*)0,description_event);
if (ev) if (ev)
{ {
...@@ -1578,39 +1580,54 @@ err: ...@@ -1578,39 +1580,54 @@ err:
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
} }
/**
Load data's io cache specific hook to be executed
before a chunk of data is being read into the cache's buffer
The fuction instantianates and writes into the binlog
replication events along LOAD DATA processing.
@param file pointer to io-cache
@return 0
*/
int log_loaded_block(IO_CACHE* file) int log_loaded_block(IO_CACHE* file)
{ {
DBUG_ENTER("log_loaded_block");
LOAD_FILE_INFO *lf_info; LOAD_FILE_INFO *lf_info;
uint block_len ; uint block_len;
/* buffer contains position where we started last read */
/* file->request_pos contains position where we started last read */ char* buffer= my_b_get_buffer_start(file);
char* buffer = (char*) file->request_pos; uint max_event_size= current_thd->variables.max_allowed_packet;
if (!(block_len = (char*) file->read_end - (char*) buffer)) lf_info= (LOAD_FILE_INFO*) file->arg;
return 0;
lf_info = (LOAD_FILE_INFO*) file->arg;
if (lf_info->thd->current_stmt_binlog_row_based) if (lf_info->thd->current_stmt_binlog_row_based)
return 0; return 0;
if (lf_info->last_pos_in_file != HA_POS_ERROR && if (lf_info->last_pos_in_file != HA_POS_ERROR &&
lf_info->last_pos_in_file >= file->pos_in_file) lf_info->last_pos_in_file >= my_b_get_pos_in_file(file))
return 0; DBUG_RETURN(0);
lf_info->last_pos_in_file = file->pos_in_file;
for (block_len= my_b_get_bytes_in_buffer(file); block_len > 0;
buffer += min(block_len, max_event_size),
block_len -= min(block_len, max_event_size))
{
lf_info->last_pos_in_file= my_b_get_pos_in_file(file);
if (lf_info->wrote_create_file) if (lf_info->wrote_create_file)
{ {
Append_block_log_event a(lf_info->thd, lf_info->thd->db, buffer, Append_block_log_event a(lf_info->thd, lf_info->thd->db, buffer,
block_len, lf_info->log_delayed); min(block_len, max_event_size),
lf_info->log_delayed);
mysql_bin_log.write(&a); mysql_bin_log.write(&a);
} }
else else
{ {
Begin_load_query_log_event b(lf_info->thd, lf_info->thd->db, Begin_load_query_log_event b(lf_info->thd, lf_info->thd->db,
buffer, block_len, buffer,
min(block_len, max_event_size),
lf_info->log_delayed); lf_info->log_delayed);
mysql_bin_log.write(&b); mysql_bin_log.write(&b);
lf_info->wrote_create_file = 1; lf_info->wrote_create_file= 1;
DBUG_SYNC_POINT("debug_lock.created_file_event",10); DBUG_SYNC_POINT("debug_lock.created_file_event",10);
} }
return 0; }
DBUG_RETURN(0);
} }
/* /*
......
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