mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 20:12:31 +01:00
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.
This commit is contained in:
commit
9a51d88bfd
60 changed files with 15992 additions and 404 deletions
|
@ -521,6 +521,11 @@ typedef int (*qsort2_cmp)(const void *, const void *, const void *);
|
|||
#define my_b_tell(info) ((info)->pos_in_file + \
|
||||
(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 */
|
||||
int my_b_copy_to_file(IO_CACHE *cache, FILE *file);
|
||||
my_off_t my_b_append_tell(IO_CACHE* info);
|
||||
|
|
|
@ -126,7 +126,12 @@ select * from t2;
|
|||
select * from t3;
|
||||
|
||||
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;
|
||||
|
||||
#
|
||||
|
@ -178,7 +183,14 @@ start transaction;
|
|||
insert into t1 values(2);
|
||||
rollback;
|
||||
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;
|
||||
|
||||
# End of 5.1 tests
|
||||
|
|
|
@ -355,7 +355,6 @@ drop table t1, t2;
|
|||
create temporary table tt (a int unique);
|
||||
create table ti (a int) engine=innodb;
|
||||
reset master;
|
||||
show master status;
|
||||
|
||||
# action
|
||||
|
||||
|
@ -368,9 +367,7 @@ rollback;
|
|||
# check
|
||||
|
||||
select count(*) from tt /* 2 */;
|
||||
show master status;
|
||||
--replace_column 2 # 5 #
|
||||
show binlog events from 106;
|
||||
source include/show_binlog_events.inc;
|
||||
select count(*) from ti /* zero */;
|
||||
insert into ti select * from tt;
|
||||
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 tt where a=1;
|
||||
reset master;
|
||||
show master status;
|
||||
|
||||
# action
|
||||
|
||||
|
@ -393,9 +389,7 @@ rollback;
|
|||
|
||||
# check
|
||||
|
||||
show master status;
|
||||
--replace_column 2 # 5 #
|
||||
show binlog events from 106;
|
||||
source include/show_binlog_events.inc;
|
||||
select count(*) from ti /* zero */;
|
||||
insert into ti select * from tt;
|
||||
select * from tt /* that is what otherwise slave missed - the bug */;
|
||||
|
@ -439,14 +433,14 @@ reset master;
|
|||
|
||||
--error ER_DUP_ENTRY
|
||||
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 */;
|
||||
|
||||
reset master;
|
||||
select count(*) from t2;
|
||||
delete from t2 where a=bug27417(3);
|
||||
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 */;
|
||||
|
||||
--enable_info
|
||||
|
@ -488,7 +482,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
|
|||
|
||||
# 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 */;
|
||||
|
||||
#
|
||||
|
@ -508,7 +502,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
|
|||
|
||||
# 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 */;
|
||||
|
||||
#
|
||||
|
@ -525,7 +519,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
|
|||
update t3 set b=b+bug27417(1);
|
||||
|
||||
# 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 */;
|
||||
|
||||
## multi_update::send_eof() branch
|
||||
|
@ -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 */;
|
||||
|
||||
# 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 */;
|
||||
|
||||
## send_error() branch of multi_update
|
||||
|
@ -586,7 +580,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
|
|||
--error ER_DUP_ENTRY
|
||||
delete from t2;
|
||||
# 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 */;
|
||||
|
||||
# cleanup
|
||||
|
@ -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;
|
||||
|
||||
# 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 */;
|
||||
|
||||
|
||||
|
@ -627,7 +621,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
|
|||
# check
|
||||
select * from t4;
|
||||
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
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
create temporary table tt (a int unique);
|
||||
create table ti (a int) engine=innodb;
|
||||
reset master;
|
||||
show master status;
|
||||
|
||||
# action
|
||||
|
||||
|
@ -31,7 +30,6 @@ rollback;
|
|||
# check
|
||||
|
||||
select count(*) from tt /* 2 */;
|
||||
show master status;
|
||||
source include/show_binlog_events.inc;
|
||||
select count(*) from ti /* zero */;
|
||||
insert into ti select * from tt;
|
||||
|
@ -42,7 +40,6 @@ select * from ti /* that is what slave would miss - bug#28960 */;
|
|||
delete from ti;
|
||||
delete from tt where a=1;
|
||||
reset master;
|
||||
show master status;
|
||||
|
||||
# action
|
||||
|
||||
|
@ -55,7 +52,6 @@ rollback;
|
|||
|
||||
# check
|
||||
|
||||
show master status;
|
||||
source include/show_binlog_events.inc; # nothing in binlog with row bilog format
|
||||
select count(*) from ti /* zero */;
|
||||
insert into ti select * from tt;
|
||||
|
|
|
@ -43,7 +43,7 @@ set global max_relay_log_size=8192-1; # mapped to 4096
|
|||
select @@global.max_relay_log_size;
|
||||
start slave;
|
||||
sync_with_master;
|
||||
source include/show_slave_status.inc;
|
||||
source include/show_slave_status2.inc;
|
||||
|
||||
--echo #
|
||||
--echo # Test 2
|
||||
|
@ -55,7 +55,7 @@ set global max_relay_log_size=(5*4096);
|
|||
query_vertical select @@global.max_relay_log_size;
|
||||
start slave;
|
||||
sync_with_master;
|
||||
source include/show_slave_status.inc;
|
||||
source include/show_slave_status2.inc;
|
||||
|
||||
--echo #
|
||||
--echo # Test 3: max_relay_log_size = 0
|
||||
|
@ -67,7 +67,7 @@ set global max_relay_log_size=0;
|
|||
query_vertical select @@global.max_relay_log_size;
|
||||
start slave;
|
||||
sync_with_master;
|
||||
source include/show_slave_status.inc;
|
||||
source include/show_slave_status2.inc;
|
||||
|
||||
--echo #
|
||||
--echo # Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions
|
||||
|
@ -78,7 +78,7 @@ reset slave;
|
|||
# test of relay log rotation when the slave is stopped
|
||||
# (to make sure it does not crash).
|
||||
flush logs;
|
||||
source include/show_slave_status.inc;
|
||||
source include/show_slave_status2.inc;
|
||||
|
||||
--echo #
|
||||
--echo # Test 5
|
||||
|
@ -96,7 +96,7 @@ create table t1 (a int);
|
|||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
source include/show_slave_status.inc;
|
||||
source include/show_slave_status2.inc;
|
||||
|
||||
--echo #
|
||||
--echo # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
|
||||
|
@ -108,13 +108,12 @@ drop table t1;
|
|||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
source include/show_slave_status.inc;
|
||||
source include/show_slave_status2.inc;
|
||||
|
||||
connection master;
|
||||
# test that the absence of relay logs does not make a master crash
|
||||
flush logs;
|
||||
-- replace_column 3 <Binlog_Ignore_DB>
|
||||
query_vertical show master status;
|
||||
source include/show_master_status.inc;
|
||||
|
||||
# Restore max_binlog_size
|
||||
connection slave;
|
||||
|
|
|
@ -13,18 +13,18 @@ connection master;
|
|||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
source include/show_slave_status.inc;
|
||||
source include/show_slave_status2.inc;
|
||||
|
||||
stop slave;
|
||||
change master to master_user='test';
|
||||
source include/show_slave_status.inc;
|
||||
source include/show_slave_status2.inc;
|
||||
|
||||
reset slave;
|
||||
source include/show_slave_status.inc;
|
||||
source include/show_slave_status2.inc;
|
||||
|
||||
start slave;
|
||||
sync_with_master;
|
||||
source include/show_slave_status.inc;
|
||||
source include/show_slave_status2.inc;
|
||||
|
||||
# test of crash with temp tables & RESET SLAVE
|
||||
# (test to see if RESET SLAVE clears temp tables in memory and disk)
|
||||
|
|
|
@ -122,7 +122,7 @@ INSERT INTO t1_nodef VALUES (1,2);
|
|||
connection slave;
|
||||
--source include/wait_for_slave_sql_to_stop.inc
|
||||
--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
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
|
@ -142,7 +142,7 @@ sync_slave_with_master;
|
|||
--echo **** On Slave ****
|
||||
SELECT * FROM t2;
|
||||
--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
|
||||
|
||||
connection master;
|
||||
|
@ -154,7 +154,7 @@ INSERT INTO t4 VALUES (4);
|
|||
connection slave;
|
||||
--source include/wait_for_slave_sql_to_stop.inc
|
||||
--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
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
|
@ -168,7 +168,7 @@ INSERT INTO t5 VALUES (5,10,25);
|
|||
connection slave;
|
||||
--source include/wait_for_slave_sql_to_stop.inc
|
||||
--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
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
|
@ -182,7 +182,7 @@ INSERT INTO t6 VALUES (6,12,36);
|
|||
connection slave;
|
||||
--source include/wait_for_slave_sql_to_stop.inc
|
||||
--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
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
|
@ -191,7 +191,7 @@ connection master;
|
|||
INSERT INTO t9 VALUES (6);
|
||||
sync_slave_with_master;
|
||||
--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
|
||||
|
||||
# Testing some tables extra field that can be null and cannot be null
|
||||
|
|
5
mysql-test/include/show_binary_logs.inc
Normal file
5
mysql-test/include/show_binary_logs.inc
Normal file
|
@ -0,0 +1,5 @@
|
|||
# show binary logs
|
||||
|
||||
# mask out the binlog position
|
||||
-- replace_column 2 #
|
||||
show binary logs;
|
|
@ -1,8 +1,4 @@
|
|||
#
|
||||
# Differs slightly from show_binlog events in showing server_id
|
||||
# which is important for some tests
|
||||
#
|
||||
--let $binlog_start=106
|
||||
--let $binlog_start=98
|
||||
--replace_result $binlog_start <binlog_start>
|
||||
--replace_column 2 # 5 #
|
||||
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
|
||||
|
|
5
mysql-test/include/show_master_logs.inc
Normal file
5
mysql-test/include/show_master_logs.inc
Normal file
|
@ -0,0 +1,5 @@
|
|||
# show master logs
|
||||
|
||||
# mask out the binlog position
|
||||
-- replace_column 2 #
|
||||
query_vertical show master logs;
|
5
mysql-test/include/show_master_status.inc
Normal file
5
mysql-test/include/show_master_status.inc
Normal file
|
@ -0,0 +1,5 @@
|
|||
# show master status
|
||||
|
||||
# mask out the binlog position
|
||||
-- replace_column 2 # 3 <Binlog_Do_DB> 4 <Binlog_Ignore_DB>
|
||||
show master status;
|
8
mysql-test/include/show_slave_status2.inc
Normal file
8
mysql-test/include/show_slave_status2.inc
Normal file
|
@ -0,0 +1,8 @@
|
|||
# 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;
|
28
mysql-test/r/rpl_loaddata_map.result
Normal file
28
mysql-test/r/rpl_loaddata_map.result
Normal file
|
@ -0,0 +1,28 @@
|
|||
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
|
42
mysql-test/r/rpl_user.result
Normal file
42
mysql-test/r/rpl_user.result
Normal file
|
@ -0,0 +1,42 @@
|
|||
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'
|
10000
mysql-test/std_data/bug30435_10k_items.txt
Normal file
10000
mysql-test/std_data/bug30435_10k_items.txt
Normal file
File diff suppressed because it is too large
Load diff
5000
mysql-test/std_data/bug30435_5k.txt
Normal file
5000
mysql-test/std_data/bug30435_5k.txt
Normal file
File diff suppressed because it is too large
Load diff
61
mysql-test/suite/binlog/r/binlog_old_versions.result
Normal file
61
mysql-test/suite/binlog/r/binlog_old_versions.result
Normal file
|
@ -0,0 +1,61 @@
|
|||
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;
|
|
@ -423,9 +423,6 @@ drop table t1, t2;
|
|||
create temporary table tt (a int unique);
|
||||
create table ti (a int) engine=innodb;
|
||||
reset master;
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 106
|
||||
begin;
|
||||
insert into ti values (1);
|
||||
insert into ti values (2) ;
|
||||
|
@ -436,17 +433,14 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back
|
|||
select count(*) from tt /* 2 */;
|
||||
count(*)
|
||||
2
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 395
|
||||
show binlog events from 106;
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 # Table_map 1 # table_id: 27 (test.ti)
|
||||
master-bin.000001 # Write_rows 1 # table_id: 27 flags: STMT_END_F
|
||||
master-bin.000001 # Table_map 1 # table_id: 27 (test.ti)
|
||||
master-bin.000001 # Write_rows 1 # table_id: 27 flags: STMT_END_F
|
||||
master-bin.000001 # Query 1 # use `test`; ROLLBACK
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (test.ti)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Table_map # # table_id: # (test.ti)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Query # # use `test`; ROLLBACK
|
||||
select count(*) from ti /* zero */;
|
||||
count(*)
|
||||
0
|
||||
|
@ -458,19 +452,13 @@ a
|
|||
delete from ti;
|
||||
delete from tt where a=1;
|
||||
reset master;
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 106
|
||||
begin;
|
||||
insert into ti values (1);
|
||||
insert into ti values (2) /* to make the dup error in the following */;
|
||||
insert into tt select * from ti /* one affected and error */;
|
||||
ERROR 23000: Duplicate entry '2' for key 'a'
|
||||
rollback;
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 106
|
||||
show binlog events from 106;
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
select count(*) from ti /* zero */;
|
||||
count(*)
|
||||
|
@ -497,9 +485,11 @@ insert into t2 select bug27417(2);
|
|||
reset master;
|
||||
insert into t2 values (bug27417(2));
|
||||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 222
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t2)
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
/* only (!) with fixes for #23333 will show there is the query */;
|
||||
select count(*) from t1 /* must be 3 */;
|
||||
count(*)
|
||||
|
@ -512,9 +502,11 @@ delete from t2 where a=bug27417(3);
|
|||
select count(*) from t2 /* nothing got deleted */;
|
||||
count(*)
|
||||
2
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 227
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t2)
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
/* the query must be in regardless of #23333 */;
|
||||
select count(*) from t1 /* must be 5 */;
|
||||
count(*)
|
||||
|
@ -534,9 +526,14 @@ insert into t2 values (1);
|
|||
reset master;
|
||||
insert into t2 values (bug27417(1));
|
||||
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
|
||||
show master status /* the offset must denote there is the query */;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 361
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t2)
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Query # # use `test`; ROLLBACK
|
||||
/* the output must denote there is the query */;
|
||||
select count(*) from t1 /* must be 1 */;
|
||||
count(*)
|
||||
1
|
||||
|
@ -546,9 +543,15 @@ insert into t2 values (2);
|
|||
reset master;
|
||||
insert into t2 select bug27417(1) union select bug27417(2);
|
||||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
show master status /* the offset must denote there is the query */;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 400
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t2)
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: #
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Query # # use `test`; ROLLBACK
|
||||
/* the output must denote there is the query */;
|
||||
select count(*) from t1 /* must be 2 */;
|
||||
count(*)
|
||||
2
|
||||
|
@ -557,9 +560,14 @@ insert into t3 values (1,1),(2,3),(3,4);
|
|||
reset master;
|
||||
update t3 set b=b+bug27417(1);
|
||||
ERROR 23000: Duplicate entry '4' for key 'b'
|
||||
show master status /* the offset must denote there is the query */;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 305
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t3)
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: #
|
||||
master-bin.000001 # Update_rows # # table_id: #
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
/* the output must denote there is the query */;
|
||||
select count(*) from t1 /* must be 2 */;
|
||||
count(*)
|
||||
2
|
||||
|
@ -570,9 +578,14 @@ insert into t4 values (1,1),(2,2);
|
|||
reset master;
|
||||
UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */;
|
||||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
show master status /* the offset must denote there is the query */;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 367
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t4)
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Query # # use `test`; ROLLBACK
|
||||
/* the output must denote there is the query */;
|
||||
select count(*) from t1 /* must be 4 */;
|
||||
count(*)
|
||||
4
|
||||
|
@ -598,9 +611,15 @@ insert into t3 values (bug27417(1), 2);
|
|||
reset master;
|
||||
delete from t2;
|
||||
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
|
||||
show master status /* the offset must denote there is the query */;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 403
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t2)
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t3)
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Query # # use `test`; ROLLBACK
|
||||
/* the output must denote there is the query */;
|
||||
select count(*) from t1 /* must be 1 */;
|
||||
count(*)
|
||||
1
|
||||
|
@ -615,9 +634,16 @@ insert into t5 values (1),(2);
|
|||
reset master;
|
||||
delete t2.* from t2,t5 where t2.a=t5.a + 1;
|
||||
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
|
||||
show master status /* the offset must denote there is the query */;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 429
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t2)
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Delete_rows # # table_id: #
|
||||
master-bin.000001 # Write_rows # # table_id: #
|
||||
master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Query # # use `test`; ROLLBACK
|
||||
/* the output must denote there is the query */;
|
||||
select count(*) from t1 /* must be 1 */;
|
||||
count(*)
|
||||
1
|
||||
|
@ -633,9 +659,16 @@ a b
|
|||
select count(*) from t1 /* must be 2 */;
|
||||
count(*)
|
||||
2
|
||||
show master status /* the offset must denote there is the query */;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 430
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t4)
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: #
|
||||
master-bin.000001 # Write_rows # # table_id: #
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Query # # use `test`; ROLLBACK
|
||||
/* the output must denote there is the query */;
|
||||
drop trigger trg_del_t2;
|
||||
drop table t1,t2,t3,t4,t5;
|
||||
drop function bug27417;
|
||||
|
@ -643,9 +676,6 @@ end of tests
|
|||
create temporary table tt (a int unique);
|
||||
create table ti (a int) engine=innodb;
|
||||
reset master;
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 106
|
||||
begin;
|
||||
insert into ti values (1);
|
||||
insert into ti values (2) ;
|
||||
|
@ -656,9 +686,6 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back
|
|||
select count(*) from tt /* 2 */;
|
||||
count(*)
|
||||
2
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 395
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
|
@ -678,18 +705,12 @@ a
|
|||
delete from ti;
|
||||
delete from tt where a=1;
|
||||
reset master;
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 106
|
||||
begin;
|
||||
insert into ti values (1);
|
||||
insert into ti values (2) /* to make the dup error in the following */;
|
||||
insert into tt select * from ti /* one affected and error */;
|
||||
ERROR 23000: Duplicate entry '2' for key 'a'
|
||||
rollback;
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 106
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
select count(*) from ti /* zero */;
|
||||
|
|
|
@ -104,8 +104,9 @@ select * from t2;
|
|||
a
|
||||
select * from t3;
|
||||
a
|
||||
show binlog events from <binlog_start>;
|
||||
show binlog events;
|
||||
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`; create table t1 (a int) engine=blackhole
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
|
@ -163,8 +164,9 @@ start transaction;
|
|||
insert into t1 values(2);
|
||||
rollback;
|
||||
set autocommit=1;
|
||||
show binlog events from <binlog_start>;
|
||||
show binlog events;
|
||||
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`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; insert into t1 values(1)
|
||||
|
|
|
@ -392,9 +392,6 @@ drop table t1, t2;
|
|||
create temporary table tt (a int unique);
|
||||
create table ti (a int) engine=innodb;
|
||||
reset master;
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 106
|
||||
begin;
|
||||
insert into ti values (1);
|
||||
insert into ti values (2) ;
|
||||
|
@ -405,16 +402,13 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back
|
|||
select count(*) from tt /* 2 */;
|
||||
count(*)
|
||||
2
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 515
|
||||
show binlog events from 106;
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test`; insert into ti values (1)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into ti values (2)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into tt select * from ti
|
||||
master-bin.000001 # Query 1 # use `test`; ROLLBACK
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; insert into ti values (1)
|
||||
master-bin.000001 # Query # # use `test`; insert into ti values (2)
|
||||
master-bin.000001 # Query # # use `test`; insert into tt select * from ti
|
||||
master-bin.000001 # Query # # use `test`; ROLLBACK
|
||||
select count(*) from ti /* zero */;
|
||||
count(*)
|
||||
0
|
||||
|
@ -426,9 +420,6 @@ a
|
|||
delete from ti;
|
||||
delete from tt where a=1;
|
||||
reset master;
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 106
|
||||
begin;
|
||||
insert into ti values (1);
|
||||
insert into ti values (2) /* to make the dup error in the following */;
|
||||
|
@ -437,16 +428,13 @@ ERROR 23000: Duplicate entry '2' for key 'a'
|
|||
rollback;
|
||||
Warnings:
|
||||
Warning 1196 Some non-transactional changed tables couldn't be rolled back
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 589
|
||||
show binlog events from 106;
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test`; insert into ti values (1)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into ti values (2) /* to make the dup error in the following */
|
||||
master-bin.000001 # Query 1 # use `test`; insert into tt select * from ti /* one affected and error */
|
||||
master-bin.000001 # Query 1 # use `test`; ROLLBACK
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; insert into ti values (1)
|
||||
master-bin.000001 # Query # # use `test`; insert into ti values (2) /* to make the dup error in the following */
|
||||
master-bin.000001 # Query # # use `test`; insert into tt select * from ti /* one affected and error */
|
||||
master-bin.000001 # Query # # use `test`; ROLLBACK
|
||||
select count(*) from ti /* zero */;
|
||||
count(*)
|
||||
0
|
||||
|
@ -472,9 +460,11 @@ insert into t2 select bug27417(2);
|
|||
reset master;
|
||||
insert into t2 values (bug27417(2));
|
||||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 232
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t2)
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
/* only (!) with fixes for #23333 will show there is the query */;
|
||||
select count(*) from t1 /* must be 3 */;
|
||||
count(*)
|
||||
|
@ -487,9 +477,11 @@ delete from t2 where a=bug27417(3);
|
|||
select count(*) from t2 /* nothing got deleted */;
|
||||
count(*)
|
||||
2
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 231
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t2)
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
/* the query must be in regardless of #23333 */;
|
||||
select count(*) from t1 /* must be 5 */;
|
||||
count(*)
|
||||
|
@ -509,9 +501,13 @@ insert into t2 values (1);
|
|||
reset master;
|
||||
insert into t2 values (bug27417(1));
|
||||
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
|
||||
show master status /* the offset must denote there is the query */;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 371
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Intvar # # INSERT_ID=1
|
||||
master-bin.000001 # Query # # use `test`; insert into t2 values (bug27417(1))
|
||||
master-bin.000001 # Query # # use `test`; ROLLBACK
|
||||
/* the output must denote there is the query */;
|
||||
select count(*) from t1 /* must be 1 */;
|
||||
count(*)
|
||||
1
|
||||
|
@ -521,9 +517,13 @@ insert into t2 values (2);
|
|||
reset master;
|
||||
insert into t2 select bug27417(1) union select bug27417(2);
|
||||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
show master status /* the offset must denote there is the query */;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 394
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Intvar # # INSERT_ID=2
|
||||
master-bin.000001 # Query # # use `test`; insert into t2 select bug27417(1) union select bug27417(2)
|
||||
master-bin.000001 # Query # # use `test`; ROLLBACK
|
||||
/* the output must denote there is the query */;
|
||||
select count(*) from t1 /* must be 2 */;
|
||||
count(*)
|
||||
2
|
||||
|
@ -532,9 +532,11 @@ insert into t3 values (1,1),(2,3),(3,4);
|
|||
reset master;
|
||||
update t3 set b=b+bug27417(1);
|
||||
ERROR 23000: Duplicate entry '4' for key 'b'
|
||||
show master status /* the offset must denote there is the query */;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 226
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Intvar # # INSERT_ID=4
|
||||
master-bin.000001 # Query # # use `test`; update t3 set b=b+bug27417(1)
|
||||
/* the output must denote there is the query */;
|
||||
select count(*) from t1 /* must be 2 */;
|
||||
count(*)
|
||||
2
|
||||
|
@ -545,9 +547,13 @@ insert into t4 values (1,1),(2,2);
|
|||
reset master;
|
||||
UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */;
|
||||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
show master status /* the offset must denote there is the query */;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 405
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Intvar # # INSERT_ID=6
|
||||
master-bin.000001 # Query # # use `test`; UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */
|
||||
master-bin.000001 # Query # # use `test`; ROLLBACK
|
||||
/* the output must denote there is the query */;
|
||||
select count(*) from t1 /* must be 4 */;
|
||||
count(*)
|
||||
4
|
||||
|
@ -573,9 +579,13 @@ insert into t3 values (bug27417(1), 2);
|
|||
reset master;
|
||||
delete from t2;
|
||||
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
|
||||
show master status /* the offset must denote there is the query */;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 350
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Intvar # # INSERT_ID=9
|
||||
master-bin.000001 # Query # # use `test`; delete from t2
|
||||
master-bin.000001 # Query # # use `test`; ROLLBACK
|
||||
/* the output must denote there is the query */;
|
||||
select count(*) from t1 /* must be 1 */;
|
||||
count(*)
|
||||
1
|
||||
|
@ -590,9 +600,12 @@ insert into t5 values (1),(2);
|
|||
reset master;
|
||||
delete t2.* from t2,t5 where t2.a=t5.a + 1;
|
||||
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
|
||||
show master status /* the offset must denote there is the query */;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 350
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; delete t2.* from t2,t5 where t2.a=t5.a + 1
|
||||
master-bin.000001 # Query # # use `test`; ROLLBACK
|
||||
/* the output must denote there is the query */;
|
||||
select count(*) from t1 /* must be 1 */;
|
||||
count(*)
|
||||
1
|
||||
|
@ -608,9 +621,15 @@ a b
|
|||
select count(*) from t1 /* must be 2 */;
|
||||
count(*)
|
||||
2
|
||||
show master status /* the offset must denote there is the query */;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 508
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Intvar # # INSERT_ID=10
|
||||
master-bin.000001 # Begin_load_query # # ;file_id=1;block_len=12
|
||||
master-bin.000001 # Intvar # # INSERT_ID=10
|
||||
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=1
|
||||
master-bin.000001 # Query # # use `test`; ROLLBACK
|
||||
/* the output must denote there is the query */;
|
||||
drop trigger trg_del_t2;
|
||||
drop table t1,t2,t3,t4,t5;
|
||||
drop function bug27417;
|
||||
|
@ -619,9 +638,6 @@ set @@session.binlog_format=statement;
|
|||
create temporary table tt (a int unique);
|
||||
create table ti (a int) engine=innodb;
|
||||
reset master;
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 106
|
||||
begin;
|
||||
insert into ti values (1);
|
||||
insert into ti values (2) ;
|
||||
|
@ -632,9 +648,6 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back
|
|||
select count(*) from tt /* 2 */;
|
||||
count(*)
|
||||
2
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 515
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
|
@ -653,9 +666,6 @@ a
|
|||
delete from ti;
|
||||
delete from tt where a=1;
|
||||
reset master;
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 106
|
||||
begin;
|
||||
insert into ti values (1);
|
||||
insert into ti values (2) /* to make the dup error in the following */;
|
||||
|
@ -664,9 +674,6 @@ ERROR 23000: Duplicate entry '2' for key 'a'
|
|||
rollback;
|
||||
Warnings:
|
||||
Warning 1196 Some non-transactional changed tables couldn't be rolled back
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 589
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
|
@ -855,10 +862,10 @@ Log_name Pos Event_type Server_id End_log_pos Info
|
|||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Intvar # # INSERT_ID=10
|
||||
master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
|
||||
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=12
|
||||
master-bin.000001 # Begin_load_query # # ;file_id=2;block_len=12
|
||||
master-bin.000001 # Intvar # # INSERT_ID=10
|
||||
master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
|
||||
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=#
|
||||
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=2
|
||||
master-bin.000001 # Query # # use `test`; ROLLBACK
|
||||
drop trigger trg_del_t2;
|
||||
drop table t1,t2,t3,t4,t5;
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
147
mysql-test/suite/binlog/t/binlog_old_versions.test
Normal file
147
mysql-test/suite/binlog/t/binlog_old_versions.test
Normal file
|
@ -0,0 +1,147 @@
|
|||
# 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;
|
|
@ -1,7 +1,7 @@
|
|||
reset master;
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 106
|
||||
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
|
||||
reset slave;
|
||||
SHOW SLAVE STATUS;
|
||||
change master to master_host='127.0.0.1';
|
||||
|
@ -12,7 +12,7 @@ Master_User test
|
|||
Master_Port 3306
|
||||
Connect_Retry 7
|
||||
Master_Log_File
|
||||
Read_Master_Log_Pos 4
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File
|
||||
|
@ -27,7 +27,7 @@ Replicate_Wild_Ignore_Table
|
|||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
|
@ -53,7 +53,7 @@ Master_User root
|
|||
Master_Port MASTER_PORT
|
||||
Connect_Retry 7
|
||||
Master_Log_File
|
||||
Read_Master_Log_Pos 4
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File
|
||||
|
@ -68,7 +68,7 @@ Replicate_Wild_Ignore_Table
|
|||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
|
@ -93,7 +93,7 @@ Master_User root
|
|||
Master_Port MASTER_PORT
|
||||
Connect_Retry 7
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos 106
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
|
@ -108,7 +108,7 @@ Replicate_Wild_Ignore_Table
|
|||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 106
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
|
|
|
@ -33,7 +33,7 @@ Replicate_Wild_Ignore_Table
|
|||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 191
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
|
@ -73,7 +73,7 @@ Replicate_Wild_Ignore_Table
|
|||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 191
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
|
|
|
@ -7,40 +7,40 @@ start slave;
|
|||
**** On Master ****
|
||||
CREATE USER dummy@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
|
||||
dummy localhost
|
||||
dummy1 localhost
|
||||
dummy2 localhost
|
||||
SELECT COUNT(*) FROM mysql.user;
|
||||
SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
|
||||
COUNT(*)
|
||||
6
|
||||
3
|
||||
**** On Slave ****
|
||||
SELECT user,host FROM mysql.user WHERE user != 'root';
|
||||
SELECT user,host FROM mysql.user WHERE user like 'dummy%';
|
||||
user host
|
||||
dummy localhost
|
||||
dummy1 localhost
|
||||
dummy2 localhost
|
||||
SELECT COUNT(*) FROM mysql.user;
|
||||
SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
|
||||
COUNT(*)
|
||||
6
|
||||
3
|
||||
**** On Master ****
|
||||
DROP USER nonexisting@localhost;
|
||||
ERROR HY000: Operation DROP USER failed for 'nonexisting'@'localhost'
|
||||
DROP USER nonexisting@localhost, dummy@localhost;
|
||||
ERROR HY000: Operation DROP USER failed for 'nonexisting'@'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
|
||||
SELECT COUNT(*) FROM mysql.user;
|
||||
SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
|
||||
COUNT(*)
|
||||
3
|
||||
0
|
||||
**** On Slave ****
|
||||
SELECT user,host FROM mysql.user WHERE user != 'root';
|
||||
SELECT user,host FROM mysql.user WHERE user like 'dummy%';
|
||||
user host
|
||||
SELECT COUNT(*) FROM mysql.user;
|
||||
SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
|
||||
COUNT(*)
|
||||
3
|
||||
0
|
||||
SHOW SLAVE STATUS;
|
||||
Slave_IO_State #
|
||||
Master_Host 127.0.0.1
|
||||
|
@ -48,7 +48,7 @@ Master_User root
|
|||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos 617
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
|
@ -57,13 +57,13 @@ Slave_SQL_Running Yes
|
|||
Replicate_Do_DB
|
||||
Replicate_Ignore_DB
|
||||
Replicate_Do_Table
|
||||
Replicate_Ignore_Table
|
||||
Replicate_Ignore_Table #
|
||||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 617
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
|
@ -76,7 +76,7 @@ Master_SSL_Cipher
|
|||
Master_SSL_Key
|
||||
Seconds_Behind_Master #
|
||||
Master_SSL_Verify_Server_Cert No
|
||||
Last_IO_Errno 0
|
||||
Last_IO_Error
|
||||
Last_IO_Errno #
|
||||
Last_IO_Error #
|
||||
Last_SQL_Errno 0
|
||||
Last_SQL_Error
|
||||
|
|
|
@ -4,6 +4,7 @@ reset master;
|
|||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
set global max_connections=151;
|
||||
stop slave;
|
||||
start slave;
|
||||
show variables like 'init_slave';
|
||||
|
|
|
@ -6,7 +6,7 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
|||
start slave;
|
||||
show master status;
|
||||
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;
|
||||
change master to master_log_pos=75;
|
||||
SHOW SLAVE STATUS;
|
||||
|
@ -16,7 +16,7 @@ Master_User root
|
|||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos 75
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
|
@ -31,7 +31,7 @@ Replicate_Wild_Ignore_Table
|
|||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 75
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
|
@ -91,12 +91,12 @@ Last_SQL_Errno 0
|
|||
Last_SQL_Error
|
||||
show master status;
|
||||
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);
|
||||
drop table if exists t1;
|
||||
create table t1 (n int);
|
||||
insert into t1 values (1),(2),(3);
|
||||
change master to master_log_pos=106;
|
||||
change master to master_log_pos=4;
|
||||
start slave;
|
||||
select * from t1 ORDER BY n;
|
||||
n
|
||||
|
|
|
@ -21,7 +21,7 @@ Master_User root
|
|||
Master_Port MASTER_PORT
|
||||
Connect_Retry 60
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos 556
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
|
@ -36,7 +36,7 @@ Replicate_Wild_Ignore_Table
|
|||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 556
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
|
@ -63,9 +63,9 @@ insert into t2 values (34),(67),(123);
|
|||
flush logs;
|
||||
show binary logs;
|
||||
Log_name File_size
|
||||
master-bin.000001 600
|
||||
master-bin.000002 371
|
||||
master-bin.000003 106
|
||||
master-bin.000001 #
|
||||
master-bin.000002 #
|
||||
master-bin.000003 #
|
||||
create table t3 select * from temp_table;
|
||||
select * from t3;
|
||||
a
|
||||
|
@ -78,21 +78,22 @@ set global sql_slave_skip_counter=1;
|
|||
start slave;
|
||||
purge master logs to 'master-bin.000002';
|
||||
show master logs;
|
||||
Log_name File_size
|
||||
master-bin.000002 371
|
||||
master-bin.000003 415
|
||||
Log_name master-bin.000002
|
||||
File_size #
|
||||
Log_name master-bin.000003
|
||||
File_size #
|
||||
purge binary logs to 'master-bin.000002';
|
||||
show binary logs;
|
||||
Log_name File_size
|
||||
master-bin.000002 371
|
||||
master-bin.000003 415
|
||||
master-bin.000002 #
|
||||
master-bin.000003 #
|
||||
select @time_for_purge:=DATE_ADD(UPDATE_TIME, INTERVAL 1 SECOND)
|
||||
from information_schema.tables
|
||||
where TABLE_SCHEMA="test" and TABLE_NAME="t2";
|
||||
purge master logs before (@time_for_purge);
|
||||
show binary logs;
|
||||
Log_name File_size
|
||||
master-bin.000003 415
|
||||
master-bin.000003 #
|
||||
insert into t2 values (65);
|
||||
SHOW SLAVE STATUS;
|
||||
Slave_IO_State #
|
||||
|
@ -101,7 +102,7 @@ Master_User root
|
|||
Master_Port MASTER_PORT
|
||||
Connect_Retry 60
|
||||
Master_Log_File master-bin.000003
|
||||
Read_Master_Log_Pos 504
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000003
|
||||
|
@ -116,7 +117,7 @@ Replicate_Wild_Ignore_Table
|
|||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 504
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
|
@ -149,12 +150,12 @@ count(*)
|
|||
create table t4 select * from temp_table;
|
||||
show binary logs;
|
||||
Log_name File_size
|
||||
master-bin.000003 4193
|
||||
master-bin.000004 4198
|
||||
master-bin.000005 2040
|
||||
master-bin.000003 #
|
||||
master-bin.000004 #
|
||||
master-bin.000005 #
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000005 2040
|
||||
master-bin.000005 # <Binlog_Do_DB> <Binlog_Ignore_DB>
|
||||
select * from t4;
|
||||
a
|
||||
testing temporary tables part 2
|
||||
|
@ -165,7 +166,7 @@ Master_User root
|
|||
Master_Port MASTER_PORT
|
||||
Connect_Retry 60
|
||||
Master_Log_File master-bin.000005
|
||||
Read_Master_Log_Pos 2040
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000005
|
||||
|
@ -180,7 +181,7 @@ Replicate_Wild_Ignore_Table
|
|||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 2040
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
|
|
|
@ -30,7 +30,7 @@ Master_User root
|
|||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos 60268
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
|
@ -45,7 +45,7 @@ Replicate_Wild_Ignore_Table
|
|||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 60268
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
|
@ -78,7 +78,7 @@ Master_User root
|
|||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos 60268
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
|
@ -93,7 +93,7 @@ Replicate_Wild_Ignore_Table
|
|||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 60268
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
|
@ -126,7 +126,7 @@ Master_User root
|
|||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos 60268
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
|
@ -141,7 +141,7 @@ Replicate_Wild_Ignore_Table
|
|||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 60268
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
|
@ -171,7 +171,7 @@ Master_User root
|
|||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File
|
||||
Read_Master_Log_Pos 4
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File
|
||||
|
@ -186,7 +186,7 @@ Replicate_Wild_Ignore_Table
|
|||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
|
@ -217,7 +217,7 @@ Master_User root
|
|||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos 60354
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
|
@ -232,7 +232,7 @@ Replicate_Wild_Ignore_Table
|
|||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 60354
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
|
@ -261,7 +261,7 @@ Master_User root
|
|||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos 60430
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
|
@ -276,7 +276,7 @@ Replicate_Wild_Ignore_Table
|
|||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 60430
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
|
@ -295,10 +295,8 @@ Last_SQL_Errno 0
|
|||
Last_SQL_Error
|
||||
flush logs;
|
||||
show master status;
|
||||
File master-bin.000002
|
||||
Position 106
|
||||
Binlog_Do_DB <Binlog_Ignore_DB>
|
||||
Binlog_Ignore_DB
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000002 # <Binlog_Do_DB> <Binlog_Ignore_DB>
|
||||
set global max_binlog_size= @my_max_binlog_size;
|
||||
#
|
||||
# End of 4.1 tests
|
||||
|
|
|
@ -11,7 +11,7 @@ Master_User root
|
|||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos 106
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
|
@ -26,7 +26,7 @@ Replicate_Wild_Ignore_Table
|
|||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 106
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
|
@ -52,7 +52,7 @@ Master_User test
|
|||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos 106
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
|
@ -67,7 +67,7 @@ Replicate_Wild_Ignore_Table
|
|||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 106
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
|
@ -92,7 +92,7 @@ Master_User root
|
|||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File
|
||||
Read_Master_Log_Pos 4
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File
|
||||
|
@ -107,7 +107,7 @@ Replicate_Wild_Ignore_Table
|
|||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
|
@ -132,7 +132,7 @@ Master_User root
|
|||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos 106
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
|
@ -147,7 +147,7 @@ Replicate_Wild_Ignore_Table
|
|||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 106
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
|
|
|
@ -125,7 +125,7 @@ Replicate_Ignore_Table
|
|||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 1364
|
||||
Last_Error Field 'x' doesn't have a default value
|
||||
Last_Error <Last_Error>
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
|
@ -141,9 +141,9 @@ Master_SSL_Key
|
|||
Seconds_Behind_Master #
|
||||
Master_SSL_Verify_Server_Cert No
|
||||
Last_IO_Errno 0
|
||||
Last_IO_Error
|
||||
Last_IO_Error <Last_IO_Error>
|
||||
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;
|
||||
START SLAVE;
|
||||
INSERT INTO t9 VALUES (2);
|
||||
|
@ -176,7 +176,7 @@ Replicate_Ignore_Table
|
|||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 0
|
||||
Last_Error
|
||||
Last_Error <Last_Error>
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
|
@ -192,9 +192,9 @@ Master_SSL_Key
|
|||
Seconds_Behind_Master #
|
||||
Master_SSL_Verify_Server_Cert No
|
||||
Last_IO_Errno 0
|
||||
Last_IO_Error
|
||||
Last_IO_Error <Last_IO_Error>
|
||||
Last_SQL_Errno 0
|
||||
Last_SQL_Error
|
||||
Last_SQL_Error <Last_SQL_Error>
|
||||
INSERT INTO t9 VALUES (4);
|
||||
INSERT INTO t4 VALUES (4);
|
||||
SHOW SLAVE STATUS;
|
||||
|
@ -217,7 +217,7 @@ Replicate_Ignore_Table
|
|||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
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
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
|
@ -233,9 +233,9 @@ Master_SSL_Key
|
|||
Seconds_Behind_Master #
|
||||
Master_SSL_Verify_Server_Cert No
|
||||
Last_IO_Errno 0
|
||||
Last_IO_Error
|
||||
Last_IO_Error <Last_IO_Error>
|
||||
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;
|
||||
START SLAVE;
|
||||
INSERT INTO t9 VALUES (5);
|
||||
|
@ -260,7 +260,7 @@ Replicate_Ignore_Table
|
|||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
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
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
|
@ -276,9 +276,9 @@ Master_SSL_Key
|
|||
Seconds_Behind_Master #
|
||||
Master_SSL_Verify_Server_Cert No
|
||||
Last_IO_Errno 0
|
||||
Last_IO_Error
|
||||
Last_IO_Error <Last_IO_Error>
|
||||
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;
|
||||
START SLAVE;
|
||||
INSERT INTO t9 VALUES (6);
|
||||
|
@ -303,7 +303,7 @@ Replicate_Ignore_Table
|
|||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
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
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
|
@ -319,9 +319,9 @@ Master_SSL_Key
|
|||
Seconds_Behind_Master #
|
||||
Master_SSL_Verify_Server_Cert No
|
||||
Last_IO_Errno 0
|
||||
Last_IO_Error
|
||||
Last_IO_Error <Last_IO_Error>
|
||||
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;
|
||||
START SLAVE;
|
||||
INSERT INTO t9 VALUES (6);
|
||||
|
@ -345,7 +345,7 @@ Replicate_Ignore_Table
|
|||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 0
|
||||
Last_Error
|
||||
Last_Error <Last_Error>
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
|
@ -361,9 +361,9 @@ Master_SSL_Key
|
|||
Seconds_Behind_Master #
|
||||
Master_SSL_Verify_Server_Cert No
|
||||
Last_IO_Errno 0
|
||||
Last_IO_Error
|
||||
Last_IO_Error <Last_IO_Error>
|
||||
Last_SQL_Errno 0
|
||||
Last_SQL_Error
|
||||
Last_SQL_Error <Last_SQL_Error>
|
||||
INSERT INTO t7 VALUES (1),(2),(3);
|
||||
INSERT INTO t8 VALUES (1),(2),(3);
|
||||
SELECT * FROM t7 ORDER BY a;
|
||||
|
|
|
@ -125,7 +125,7 @@ Replicate_Ignore_Table
|
|||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 1364
|
||||
Last_Error Field 'x' doesn't have a default value
|
||||
Last_Error <Last_Error>
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
|
@ -141,9 +141,9 @@ Master_SSL_Key
|
|||
Seconds_Behind_Master #
|
||||
Master_SSL_Verify_Server_Cert No
|
||||
Last_IO_Errno 0
|
||||
Last_IO_Error
|
||||
Last_IO_Error <Last_IO_Error>
|
||||
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;
|
||||
START SLAVE;
|
||||
INSERT INTO t9 VALUES (2);
|
||||
|
@ -176,7 +176,7 @@ Replicate_Ignore_Table
|
|||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 0
|
||||
Last_Error
|
||||
Last_Error <Last_Error>
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
|
@ -192,9 +192,9 @@ Master_SSL_Key
|
|||
Seconds_Behind_Master #
|
||||
Master_SSL_Verify_Server_Cert No
|
||||
Last_IO_Errno 0
|
||||
Last_IO_Error
|
||||
Last_IO_Error <Last_IO_Error>
|
||||
Last_SQL_Errno 0
|
||||
Last_SQL_Error
|
||||
Last_SQL_Error <Last_SQL_Error>
|
||||
INSERT INTO t9 VALUES (4);
|
||||
INSERT INTO t4 VALUES (4);
|
||||
SHOW SLAVE STATUS;
|
||||
|
@ -217,7 +217,7 @@ Replicate_Ignore_Table
|
|||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
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
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
|
@ -233,9 +233,9 @@ Master_SSL_Key
|
|||
Seconds_Behind_Master #
|
||||
Master_SSL_Verify_Server_Cert No
|
||||
Last_IO_Errno 0
|
||||
Last_IO_Error
|
||||
Last_IO_Error <Last_IO_Error>
|
||||
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;
|
||||
START SLAVE;
|
||||
INSERT INTO t9 VALUES (5);
|
||||
|
@ -260,7 +260,7 @@ Replicate_Ignore_Table
|
|||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
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
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
|
@ -276,9 +276,9 @@ Master_SSL_Key
|
|||
Seconds_Behind_Master #
|
||||
Master_SSL_Verify_Server_Cert No
|
||||
Last_IO_Errno 0
|
||||
Last_IO_Error
|
||||
Last_IO_Error <Last_IO_Error>
|
||||
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;
|
||||
START SLAVE;
|
||||
INSERT INTO t9 VALUES (6);
|
||||
|
@ -303,7 +303,7 @@ Replicate_Ignore_Table
|
|||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
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
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
|
@ -319,9 +319,9 @@ Master_SSL_Key
|
|||
Seconds_Behind_Master #
|
||||
Master_SSL_Verify_Server_Cert No
|
||||
Last_IO_Errno 0
|
||||
Last_IO_Error
|
||||
Last_IO_Error <Last_IO_Error>
|
||||
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;
|
||||
START SLAVE;
|
||||
INSERT INTO t9 VALUES (6);
|
||||
|
@ -345,7 +345,7 @@ Replicate_Ignore_Table
|
|||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 0
|
||||
Last_Error
|
||||
Last_Error <Last_Error>
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
|
@ -361,9 +361,9 @@ Master_SSL_Key
|
|||
Seconds_Behind_Master #
|
||||
Master_SSL_Verify_Server_Cert No
|
||||
Last_IO_Errno 0
|
||||
Last_IO_Error
|
||||
Last_IO_Error <Last_IO_Error>
|
||||
Last_SQL_Errno 0
|
||||
Last_SQL_Error
|
||||
Last_SQL_Error <Last_SQL_Error>
|
||||
INSERT INTO t7 VALUES (1),(2),(3);
|
||||
INSERT INTO t8 VALUES (1),(2),(3);
|
||||
SELECT * FROM t7 ORDER BY a;
|
||||
|
|
|
@ -29,7 +29,43 @@ select * from t1;
|
|||
a
|
||||
1
|
||||
2
|
||||
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
|
||||
# 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
|
||||
SHOW SLAVE STATUS;
|
||||
Slave_IO_State #
|
||||
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;
|
||||
|
|
|
@ -28,7 +28,7 @@ Master_User root
|
|||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos 72960
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
|
@ -43,7 +43,7 @@ Replicate_Wild_Ignore_Table
|
|||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 72960
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
|
@ -76,7 +76,7 @@ Master_User root
|
|||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos 72960
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
|
@ -91,7 +91,7 @@ Replicate_Wild_Ignore_Table
|
|||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 72960
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
|
@ -124,7 +124,7 @@ Master_User root
|
|||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos 72960
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
|
@ -139,7 +139,7 @@ Replicate_Wild_Ignore_Table
|
|||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 72960
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
|
@ -169,7 +169,7 @@ Master_User root
|
|||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File
|
||||
Read_Master_Log_Pos 4
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File
|
||||
|
@ -184,7 +184,7 @@ Replicate_Wild_Ignore_Table
|
|||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
|
@ -215,7 +215,7 @@ Master_User root
|
|||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos 73046
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
|
@ -230,7 +230,7 @@ Replicate_Wild_Ignore_Table
|
|||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 73046
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
|
@ -259,7 +259,7 @@ Master_User root
|
|||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos 73122
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
|
@ -274,7 +274,7 @@ Replicate_Wild_Ignore_Table
|
|||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 73122
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
|
@ -293,10 +293,8 @@ Last_SQL_Errno 0
|
|||
Last_SQL_Error
|
||||
flush logs;
|
||||
show master status;
|
||||
File master-bin.000002
|
||||
Position 106
|
||||
Binlog_Do_DB <Binlog_Ignore_DB>
|
||||
Binlog_Ignore_DB
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000002 # <Binlog_Do_DB> <Binlog_Ignore_DB>
|
||||
set global max_binlog_size= @my_max_binlog_size;
|
||||
#
|
||||
# End of 4.1 tests
|
||||
|
|
|
@ -11,7 +11,7 @@ Master_User root
|
|||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos 106
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
|
@ -26,7 +26,7 @@ Replicate_Wild_Ignore_Table
|
|||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 106
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
|
@ -52,7 +52,7 @@ Master_User test
|
|||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos 106
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
|
@ -67,7 +67,7 @@ Replicate_Wild_Ignore_Table
|
|||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 106
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
|
@ -92,7 +92,7 @@ Master_User root
|
|||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File
|
||||
Read_Master_Log_Pos 4
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File
|
||||
|
@ -107,7 +107,7 @@ Replicate_Wild_Ignore_Table
|
|||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
|
@ -132,7 +132,7 @@ Master_User root
|
|||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos 106
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
|
@ -147,7 +147,7 @@ Replicate_Wild_Ignore_Table
|
|||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 106
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
|
|
|
@ -26,7 +26,7 @@ Master_User root
|
|||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos 784
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
|
@ -41,7 +41,7 @@ Replicate_Wild_Ignore_Table
|
|||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 327
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition Master
|
||||
Until_Log_File master-bin.000001
|
||||
|
@ -72,7 +72,7 @@ Master_User root
|
|||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos 784
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
|
@ -87,7 +87,7 @@ Replicate_Wild_Ignore_Table
|
|||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 327
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition Master
|
||||
Until_Log_File master-no-such-bin.000001
|
||||
|
@ -116,7 +116,7 @@ Master_User root
|
|||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos 784
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
|
@ -131,7 +131,7 @@ Replicate_Wild_Ignore_Table
|
|||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 616
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition Relay
|
||||
Until_Log_File slave-relay-bin.000004
|
||||
|
@ -158,7 +158,7 @@ Master_User root
|
|||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos 784
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
|
@ -173,7 +173,7 @@ Replicate_Wild_Ignore_Table
|
|||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 784
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition Master
|
||||
Until_Log_File master-bin.000001
|
||||
|
|
|
@ -46,7 +46,7 @@ Master_User root
|
|||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos 408
|
||||
Read_Master_Log_Pos #
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
|
@ -61,7 +61,7 @@ Replicate_Wild_Ignore_Table
|
|||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 408
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
|
|
|
@ -9,22 +9,22 @@ connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
|
|||
connect (slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK);
|
||||
connection master;
|
||||
reset master;
|
||||
show master status;
|
||||
source include/show_master_status.inc;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
reset slave;
|
||||
source include/show_slave_status.inc;
|
||||
source include/show_slave_status2.inc;
|
||||
|
||||
change master to master_host='127.0.0.1';
|
||||
# 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
|
||||
eval change master to master_host='127.0.0.1',master_user='root',
|
||||
master_password='',master_port=$MASTER_MYPORT;
|
||||
source include/show_slave_status.inc;
|
||||
source include/show_slave_status2.inc;
|
||||
start slave;
|
||||
sync_with_master;
|
||||
source include/show_slave_status.inc;
|
||||
source include/show_slave_status2.inc;
|
||||
connection master;
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
|
|
|
@ -18,13 +18,9 @@ save_master_pos;
|
|||
connection slave;
|
||||
--real_sleep 3 # wait for I/O thread to have read updates
|
||||
stop slave;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 1 # 7 # 8 # 9 # 16 # 23 # 33 # 35 # 36 #
|
||||
query_vertical SHOW SLAVE STATUS;
|
||||
source include/show_slave_status2.inc;
|
||||
change master to master_user='root';
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 1 # 7 # 8 # 9 # 16 # 23 # 33 # 35 # 36 #
|
||||
query_vertical SHOW SLAVE STATUS;
|
||||
source include/show_slave_status2.inc;
|
||||
start slave;
|
||||
sync_with_master;
|
||||
select * from t1;
|
||||
|
|
|
@ -147,12 +147,14 @@ INSERT INTO t1 VALUES ("This is a test of col a.",
|
|||
"This is a test of the large col c.",
|
||||
"Col d");
|
||||
SELECT * FROM t1;
|
||||
--replace_result default DEFAULT
|
||||
SHOW CREATE TABLE t1;
|
||||
|
||||
sync_slave_with_master slave;
|
||||
|
||||
--echo Insert some values and select them on slave
|
||||
SELECT * FROM t1;
|
||||
--replace_result default DEFAULT
|
||||
SHOW CREATE TABLE t1;
|
||||
|
||||
|
||||
|
@ -200,12 +202,14 @@ INSERT INTO t1 VALUES (
|
|||
);
|
||||
|
||||
SELECT BIN(a), BIN(b), BIN(c), BIN(d), BIN(e) FROM t1;
|
||||
--replace_result default DEFAULT
|
||||
SHOW CREATE TABLE t1;
|
||||
|
||||
sync_slave_with_master slave;
|
||||
|
||||
--echo Insert some values and select them on master
|
||||
SELECT BIN(a), BIN(b), BIN(c), BIN(d), BIN(e) FROM t1;
|
||||
--replace_result default DEFAULT
|
||||
SHOW CREATE TABLE t1;
|
||||
|
||||
--echo *** Cleanup ***
|
||||
|
|
|
@ -9,12 +9,12 @@ connection master;
|
|||
CREATE USER dummy@localhost;
|
||||
CREATE USER dummy1@localhost, dummy2@localhost;
|
||||
|
||||
SELECT user, host FROM mysql.user WHERE user != 'root'; # root host non-determ
|
||||
SELECT COUNT(*) FROM mysql.user;
|
||||
SELECT user, host FROM mysql.user WHERE user like 'dummy%';
|
||||
SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
|
||||
sync_slave_with_master;
|
||||
--echo **** On Slave ****
|
||||
SELECT user,host FROM mysql.user WHERE user != 'root'; # root host non-determ
|
||||
SELECT COUNT(*) FROM mysql.user;
|
||||
SELECT user,host FROM mysql.user WHERE user like 'dummy%';
|
||||
SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
|
||||
|
||||
--echo **** On Master ****
|
||||
connection master;
|
||||
|
@ -30,13 +30,11 @@ DROP USER nonexisting@localhost, dummy@localhost;
|
|||
# All users exist
|
||||
DROP USER dummy1@localhost, dummy2@localhost;
|
||||
|
||||
SELECT user, host FROM mysql.user WHERE user != 'root'; # root host non-determ
|
||||
SELECT COUNT(*) FROM mysql.user;
|
||||
SELECT user, host FROM mysql.user WHERE user like 'dummy%';
|
||||
SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
|
||||
sync_slave_with_master;
|
||||
--echo **** On Slave ****
|
||||
SELECT user,host FROM mysql.user WHERE user != 'root'; # root host non-determ
|
||||
SELECT COUNT(*) FROM mysql.user;
|
||||
SELECT user,host FROM mysql.user WHERE user like 'dummy%';
|
||||
SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
|
||||
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 1 # 8 # 9 # 23 # 33 #
|
||||
query_vertical SHOW SLAVE STATUS;
|
||||
source include/show_slave_status2.inc;
|
||||
|
|
|
@ -4,6 +4,8 @@ source include/master-slave.inc;
|
|||
# Test of init_slave variable
|
||||
#
|
||||
|
||||
set global max_connections=151;
|
||||
|
||||
connection slave;
|
||||
stop slave;
|
||||
source include/wait_for_slave_to_stop.inc;
|
||||
|
|
|
@ -11,14 +11,13 @@
|
|||
# Passes with rbr no problem, removed statement include [jbm]
|
||||
|
||||
source include/master-slave.inc;
|
||||
--replace_column 3 <Binlog_Ignore_DB>
|
||||
show master status;
|
||||
source include/show_master_status.inc;
|
||||
sync_slave_with_master;
|
||||
stop slave;
|
||||
--source include/wait_for_slave_to_stop.inc
|
||||
|
||||
change master to master_log_pos=75;
|
||||
source include/show_slave_status.inc;
|
||||
source include/show_slave_status2.inc;
|
||||
start slave;
|
||||
let $slave_param= Slave_SQL_Running;
|
||||
let $slave_param_value= Yes;
|
||||
|
@ -31,15 +30,14 @@ stop slave;
|
|||
|
||||
source include/show_slave_status.inc;
|
||||
connection master;
|
||||
--replace_column 3 <Binlog_Ignore_DB>
|
||||
show master status;
|
||||
source include/show_master_status.inc;
|
||||
create table if not exists t1 (n int);
|
||||
drop table if exists t1;
|
||||
create table t1 (n int);
|
||||
insert into t1 values (1),(2),(3);
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
change master to master_log_pos=106;
|
||||
change master to master_log_pos=4;
|
||||
start slave;
|
||||
sync_with_master;
|
||||
select * from t1 ORDER BY n;
|
||||
|
|
|
@ -65,14 +65,14 @@ insert into temp_table values ("testing temporary tables");
|
|||
create table t1 (s text);
|
||||
insert into t1 values('Could not break slave'),('Tried hard');
|
||||
sync_slave_with_master;
|
||||
source include/show_slave_status.inc;
|
||||
source include/show_slave_status2.inc;
|
||||
select * from t1;
|
||||
connection master;
|
||||
flush logs;
|
||||
create table t2(m int not null auto_increment primary key);
|
||||
insert into t2 values (34),(67),(123);
|
||||
flush logs;
|
||||
show binary logs;
|
||||
source include/show_binary_logs.inc;
|
||||
create table t3 select * from temp_table;
|
||||
|
||||
sync_slave_with_master;
|
||||
|
@ -106,10 +106,10 @@ connection master;
|
|||
sync_slave_with_master;
|
||||
connection master;
|
||||
purge master logs to 'master-bin.000002';
|
||||
show master logs;
|
||||
source include/show_master_logs.inc;
|
||||
# we just tests if synonyms are accepted
|
||||
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
|
||||
# last modification time of t2 and adding 1 second
|
||||
|
@ -122,10 +122,10 @@ select @time_for_purge:=DATE_ADD(UPDATE_TIME, INTERVAL 1 SECOND)
|
|||
--enable_result_log
|
||||
|
||||
purge master logs before (@time_for_purge);
|
||||
show binary logs;
|
||||
source include/show_binary_logs.inc;
|
||||
insert into t2 values (65);
|
||||
sync_slave_with_master;
|
||||
source include/show_slave_status.inc;
|
||||
source include/show_slave_status2.inc;
|
||||
select * from t2;
|
||||
|
||||
#
|
||||
|
@ -148,14 +148,14 @@ while ($1)
|
|||
enable_query_log;
|
||||
select count(*) from t3 where n >= 4;
|
||||
create table t4 select * from temp_table;
|
||||
show binary logs;
|
||||
show master status;
|
||||
source include/show_binary_logs.inc;
|
||||
source include/show_master_status.inc;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
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
|
||||
# if we do not lock
|
||||
lock tables t3 read;
|
||||
|
|
|
@ -50,9 +50,7 @@ sync_slave_with_master;
|
|||
connection slave;
|
||||
select @@server_id;
|
||||
select * from t1;
|
||||
--replace_column 1 # 8 # 9 # 23 # 33 #
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
show slave status;
|
||||
source include/show_slave_status2.inc;
|
||||
connection master;
|
||||
drop table t1;
|
||||
sync_with_master;
|
||||
|
|
|
@ -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
|
||||
# here table should be still not deleted
|
||||
select * from t1;
|
||||
source include/show_slave_status.inc;
|
||||
source include/show_slave_status2.inc;
|
||||
|
||||
# this should fail right after start
|
||||
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
|
||||
--source include/wait_for_slave_sql_to_stop.inc
|
||||
# again this table should be still not deleted
|
||||
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;
|
||||
start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=746;
|
||||
--source include/wait_for_slave_sql_to_stop.inc
|
||||
select * from t2;
|
||||
source include/show_slave_status.inc;
|
||||
source include/show_slave_status2.inc;
|
||||
|
||||
# clean up
|
||||
start slave;
|
||||
|
@ -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
|
||||
# here the sql slave thread should be stopped
|
||||
--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
|
||||
--error 1277
|
||||
|
|
|
@ -23,7 +23,7 @@ sync_slave_with_master;
|
|||
set @@global.slave_exec_mode= default;
|
||||
SHOW STATUS LIKE 'Slave_retried_transactions';
|
||||
SELECT * FROM t1;
|
||||
source include/show_slave_status.inc;
|
||||
source include/show_slave_status2.inc;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo **** On Master ****
|
||||
|
|
1
mysql-test/t/rpl_loaddata_map-master.opt
Normal file
1
mysql-test/t/rpl_loaddata_map-master.opt
Normal file
|
@ -0,0 +1 @@
|
|||
--read_buffer_size=9K --max_allowed_packet=8K
|
1
mysql-test/t/rpl_loaddata_map-slave.opt
Normal file
1
mysql-test/t/rpl_loaddata_map-slave.opt
Normal file
|
@ -0,0 +1 @@
|
|||
--max_allowed_packet=8K
|
52
mysql-test/t/rpl_loaddata_map.test
Normal file
52
mysql-test/t/rpl_loaddata_map.test
Normal file
|
@ -0,0 +1,52 @@
|
|||
#
|
||||
# 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
|
56
mysql-test/t/rpl_user.test
Normal file
56
mysql-test/t/rpl_user.test
Normal file
|
@ -0,0 +1,56 @@
|
|||
# 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,
|
|||
}
|
||||
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) {
|
||||
case 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)
|
|||
|
||||
Format_description_log_event::
|
||||
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;
|
||||
switch (binlog_ver) {
|
||||
|
@ -2898,7 +2921,7 @@ Format_description_log_event(const char* buf,
|
|||
const
|
||||
Format_description_log_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*,...)");
|
||||
buf+= LOG_EVENT_MINIMAL_HEADER_LEN;
|
||||
|
@ -2913,6 +2936,65 @@ Format_description_log_event(const char* buf,
|
|||
number_of_event_types*
|
||||
sizeof(*post_header_len), MYF(0));
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -2106,12 +2106,16 @@ public:
|
|||
/* The list of post-headers' lengthes */
|
||||
uint8 *post_header_len;
|
||||
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(const char* buf, uint event_len,
|
||||
const Format_description_log_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;}
|
||||
#ifndef MYSQL_CLIENT
|
||||
bool write(IO_CACHE* file);
|
||||
|
|
|
@ -5579,6 +5579,7 @@ bool mysql_create_user(THD *thd, List <LEX_USER> &list)
|
|||
LEX_USER *user_name, *tmp_user_name;
|
||||
List_iterator <LEX_USER> user_list(list);
|
||||
TABLE_LIST tables[GRANT_TABLES];
|
||||
bool some_users_created= FALSE;
|
||||
DBUG_ENTER("mysql_create_user");
|
||||
|
||||
/*
|
||||
|
@ -5614,6 +5615,7 @@ bool mysql_create_user(THD *thd, List <LEX_USER> &list)
|
|||
continue;
|
||||
}
|
||||
|
||||
some_users_created= TRUE;
|
||||
sql_mode= thd->variables.sql_mode;
|
||||
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)
|
|||
|
||||
VOID(pthread_mutex_unlock(&acl_cache->lock));
|
||||
|
||||
write_bin_log(thd, FALSE, thd->query, thd->query_length);
|
||||
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);
|
||||
|
||||
rw_unlock(&LOCK_grant);
|
||||
close_thread_tables(thd);
|
||||
if (result)
|
||||
my_error(ER_CANNOT_USER, MYF(0), "CREATE USER", wrong_users.c_ptr_safe());
|
||||
DBUG_RETURN(result);
|
||||
}
|
||||
|
||||
|
@ -5654,6 +5658,7 @@ bool mysql_drop_user(THD *thd, List <LEX_USER> &list)
|
|||
LEX_USER *user_name, *tmp_user_name;
|
||||
List_iterator <LEX_USER> user_list(list);
|
||||
TABLE_LIST tables[GRANT_TABLES];
|
||||
bool some_users_deleted= FALSE;
|
||||
DBUG_ENTER("mysql_drop_user");
|
||||
|
||||
/*
|
||||
|
@ -5682,7 +5687,9 @@ bool mysql_drop_user(THD *thd, List <LEX_USER> &list)
|
|||
{
|
||||
append_user(&wrong_users, user_name);
|
||||
result= TRUE;
|
||||
continue;
|
||||
}
|
||||
some_users_deleted= TRUE;
|
||||
}
|
||||
|
||||
/* Rebuild 'acl_check_hosts' since 'acl_users' has been modified */
|
||||
|
@ -5693,7 +5700,8 @@ bool mysql_drop_user(THD *thd, List <LEX_USER> &list)
|
|||
if (result)
|
||||
my_error(ER_CANNOT_USER, MYF(0), "DROP USER", wrong_users.c_ptr_safe());
|
||||
|
||||
write_bin_log(thd, FALSE, thd->query, thd->query_length);
|
||||
if (some_users_deleted)
|
||||
write_bin_log(thd, FALSE, thd->query, thd->query_length);
|
||||
|
||||
rw_unlock(&LOCK_grant);
|
||||
close_thread_tables(thd);
|
||||
|
@ -5722,6 +5730,7 @@ bool mysql_rename_user(THD *thd, List <LEX_USER> &list)
|
|||
LEX_USER *user_to, *tmp_user_to;
|
||||
List_iterator <LEX_USER> user_list(list);
|
||||
TABLE_LIST tables[GRANT_TABLES];
|
||||
bool some_users_renamed= FALSE;
|
||||
DBUG_ENTER("mysql_rename_user");
|
||||
|
||||
/*
|
||||
|
@ -5762,7 +5771,9 @@ bool mysql_rename_user(THD *thd, List <LEX_USER> &list)
|
|||
{
|
||||
append_user(&wrong_users, user_from);
|
||||
result= TRUE;
|
||||
continue;
|
||||
}
|
||||
some_users_renamed= TRUE;
|
||||
}
|
||||
|
||||
/* Rebuild 'acl_check_hosts' since 'acl_users' has been modified */
|
||||
|
@ -5770,12 +5781,14 @@ bool mysql_rename_user(THD *thd, List <LEX_USER> &list)
|
|||
|
||||
VOID(pthread_mutex_unlock(&acl_cache->lock));
|
||||
|
||||
write_bin_log(thd, FALSE, thd->query, thd->query_length);
|
||||
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);
|
||||
|
||||
rw_unlock(&LOCK_grant);
|
||||
close_thread_tables(thd);
|
||||
if (result)
|
||||
my_error(ER_CANNOT_USER, MYF(0), "RENAME USER", wrong_users.c_ptr_safe());
|
||||
DBUG_RETURN(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -1272,7 +1272,6 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
|
|||
unregister_slave(thd,1,1);
|
||||
/* fake COM_QUIT -- if we get here, the thread needs to terminate */
|
||||
error = TRUE;
|
||||
net->error = 0;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1243,9 +1243,6 @@ bool change_master(THD* thd, Master_info* mi)
|
|||
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,
|
||||
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)
|
|||
That's why we always save good coords in rli.
|
||||
*/
|
||||
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,
|
||||
sizeof(mi->rli.group_master_log_name)-1);
|
||||
|
||||
|
@ -1376,6 +1374,11 @@ bool mysql_show_binlog_events(THD* thd)
|
|||
if ((file=open_binlog(&log, linfo.log_file_name, &errmsg)) < 0)
|
||||
goto err;
|
||||
|
||||
/*
|
||||
to account binlog event header size
|
||||
*/
|
||||
thd->variables.max_allowed_packet += MAX_LOG_EVENT_HEADER;
|
||||
|
||||
pthread_mutex_lock(log_lock);
|
||||
|
||||
/*
|
||||
|
@ -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
|
||||
Rotate then Format_desc).
|
||||
*/
|
||||
|
||||
ev = Log_event::read_log_event(&log,(pthread_mutex_t*)0,description_event);
|
||||
if (ev)
|
||||
{
|
||||
|
@ -1578,39 +1580,54 @@ err:
|
|||
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)
|
||||
{
|
||||
DBUG_ENTER("log_loaded_block");
|
||||
LOAD_FILE_INFO *lf_info;
|
||||
uint block_len ;
|
||||
|
||||
/* file->request_pos contains position where we started last read */
|
||||
char* buffer = (char*) file->request_pos;
|
||||
if (!(block_len = (char*) file->read_end - (char*) buffer))
|
||||
return 0;
|
||||
lf_info = (LOAD_FILE_INFO*) file->arg;
|
||||
uint block_len;
|
||||
/* buffer contains position where we started last read */
|
||||
char* buffer= my_b_get_buffer_start(file);
|
||||
uint max_event_size= current_thd->variables.max_allowed_packet;
|
||||
lf_info= (LOAD_FILE_INFO*) file->arg;
|
||||
if (lf_info->thd->current_stmt_binlog_row_based)
|
||||
return 0;
|
||||
if (lf_info->last_pos_in_file != HA_POS_ERROR &&
|
||||
lf_info->last_pos_in_file >= file->pos_in_file)
|
||||
return 0;
|
||||
lf_info->last_pos_in_file = file->pos_in_file;
|
||||
if (lf_info->wrote_create_file)
|
||||
lf_info->last_pos_in_file >= my_b_get_pos_in_file(file))
|
||||
DBUG_RETURN(0);
|
||||
|
||||
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))
|
||||
{
|
||||
Append_block_log_event a(lf_info->thd, lf_info->thd->db, buffer,
|
||||
block_len, lf_info->log_delayed);
|
||||
mysql_bin_log.write(&a);
|
||||
lf_info->last_pos_in_file= my_b_get_pos_in_file(file);
|
||||
if (lf_info->wrote_create_file)
|
||||
{
|
||||
Append_block_log_event a(lf_info->thd, lf_info->thd->db, buffer,
|
||||
min(block_len, max_event_size),
|
||||
lf_info->log_delayed);
|
||||
mysql_bin_log.write(&a);
|
||||
}
|
||||
else
|
||||
{
|
||||
Begin_load_query_log_event b(lf_info->thd, lf_info->thd->db,
|
||||
buffer,
|
||||
min(block_len, max_event_size),
|
||||
lf_info->log_delayed);
|
||||
mysql_bin_log.write(&b);
|
||||
lf_info->wrote_create_file= 1;
|
||||
DBUG_SYNC_POINT("debug_lock.created_file_event",10);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Begin_load_query_log_event b(lf_info->thd, lf_info->thd->db,
|
||||
buffer, block_len,
|
||||
lf_info->log_delayed);
|
||||
mysql_bin_log.write(&b);
|
||||
lf_info->wrote_create_file = 1;
|
||||
DBUG_SYNC_POINT("debug_lock.created_file_event",10);
|
||||
}
|
||||
return 0;
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue