Commit c6ffb4b7 authored by Nirbhay Choubey's avatar Nirbhay Choubey

parent 405ac384
...@@ -10,25 +10,166 @@ File Position Binlog_Do_DB Binlog_Ignore_DB ...@@ -10,25 +10,166 @@ File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 106 master-bin.000001 106
stop slave; stop slave;
reset slave; reset slave;
show slave status;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry #
Master_Log_File Master_Log_File
Read_Master_Log_Pos 4 Read_Master_Log_Pos 4
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File Relay_Master_Log_File
Slave_IO_Running No
Slave_SQL_Running No
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 0 Exec_Master_Log_Pos 0
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 0
Last_IO_Error
Last_SQL_Errno 0
Last_SQL_Error
change master to master_host='127.0.0.1'; change master to master_host='127.0.0.1';
show slave status;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry #
Master_Log_File Master_Log_File
Read_Master_Log_Pos 4 Read_Master_Log_Pos 4
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File Relay_Master_Log_File
Slave_IO_Running No
Slave_SQL_Running No
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 0 Exec_Master_Log_Pos 0
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 0
Last_IO_Error
Last_SQL_Errno 0
Last_SQL_Error
change master to master_host='127.0.0.1',master_user='root', change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=MASTER_PORT; master_password='',master_port=MASTER_PORT;
show slave status;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry #
Master_Log_File Master_Log_File
Read_Master_Log_Pos 4 Read_Master_Log_Pos 4
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File Relay_Master_Log_File
Slave_IO_Running No
Slave_SQL_Running No
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 0 Exec_Master_Log_Pos 0
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 0
Last_IO_Error
Last_SQL_Errno 0
Last_SQL_Error
start slave; start slave;
show slave status;
Slave_IO_State Waiting for master to send event
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos 106
Relay_Log_File slave-relay-bin.000002
Relay_Log_Pos 252
Relay_Master_Log_File master-bin.000001 Relay_Master_Log_File master-bin.000001
Checking that both slave threads are running. 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 106
Relay_Log_Space 407
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 0
Last_IO_Error
Last_SQL_Errno 0
Last_SQL_Error
drop table if exists t1; drop table if exists t1;
create table t1 (n int, PRIMARY KEY(n)); create table t1 (n int, PRIMARY KEY(n));
insert into t1 values (10),(45),(90); insert into t1 values (10),(45),(90);
......
...@@ -4,7 +4,8 @@ reset master; ...@@ -4,7 +4,8 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
SHOW SLAVE STATUS;; SHOW SLAVE STATUS;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error
SHOW SLAVE HOSTS; SHOW SLAVE HOSTS;
Server_id Host Port Rpl_recovery_rank Master_id Server_id Host Port Rpl_recovery_rank Master_id
2 127.0.0.1 SLAVE_PORT 0 1 2 127.0.0.1 SLAVE_PORT 0 1
......
...@@ -11,7 +11,13 @@ stop slave sql_thread; ...@@ -11,7 +11,13 @@ stop slave sql_thread;
insert into t1 values(1); insert into t1 values(1);
insert into t1 values(2); insert into t1 values(2);
stop slave; stop slave;
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_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 191 # None 0 No # No 0 0
change master to master_user='root'; change master to master_user='root';
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_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 191 # None 0 No # No 0 0
start slave; start slave;
select * from t1; select * from t1;
n n
......
...@@ -4,6 +4,8 @@ reset master; ...@@ -4,6 +4,8 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
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
load table t1 from master; load table t1 from master;
ERROR 08S01: Error connecting to master: Master is not configured ERROR 08S01: Error connecting to master: Master is not configured
load table t1 from master; load table t1 from master;
......
...@@ -17,6 +17,43 @@ let $result_pattern= '%127.0.0.1%root%slave-bin.000001%slave-bin.000001%Yes%Yes% ...@@ -17,6 +17,43 @@ let $result_pattern= '%127.0.0.1%root%slave-bin.000001%slave-bin.000001%Yes%Yes%
--source include/wait_slave_status.inc --source include/wait_slave_status.inc
flush logs; flush logs;
Relay_Log_File mysqld-relay-bin.000003 SHOW SLAVE STATUS;
Checking that both slave threads are running. Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port SLAVE_PORT
Connect_Retry 60
Master_Log_File slave-bin.000001
Read_Master_Log_Pos 106
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File slave-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 106
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 0
Last_IO_Error
Last_SQL_Errno 0
Last_SQL_Error
STOP SLAVE; STOP SLAVE;
...@@ -10,6 +10,6 @@ load data infile '../../std_data/rpl_loaddata.dat' into table test.t1; ...@@ -10,6 +10,6 @@ load data infile '../../std_data/rpl_loaddata.dat' into table test.t1;
select count(*) from test.t1; select count(*) from test.t1;
count(*) count(*)
2 2
show binlog events from <binlog_start>; show binlog events from 106;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
drop table test.t1; drop table test.t1;
...@@ -4,23 +4,39 @@ reset master; ...@@ -4,23 +4,39 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 106 <Binlog_Ignore_DB>
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 106 # # master-bin.000001 Yes Yes 0 0 106 # None 0 No # No 0 0
stop slave; stop slave;
change master to master_log_pos=MASTER_LOG_POS; change master to master_log_pos=106;
start slave; start slave;
stop slave; stop slave;
change master to master_log_pos=MASTER_LOG_POS; change master to master_log_pos=106;
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 106 # # master-bin.000001 No No 0 0 106 # None 0 No # No 0 0
start slave; start slave;
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 106 # # master-bin.000001 Yes Yes 0 0 106 # None 0 No # No 0 0
stop slave; stop slave;
# impossible position leads to an error change master to master_log_pos=177;
change master to master_log_pos=MASTER_LOG_POS;
start slave; start slave;
Last_IO_Error = Got fatal error 1236 from master when reading data from binary log: 'Client requested master to start replication from impossible position' 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 177 # # master-bin.000001 No Yes 0 0 177 # None 0 No # No 1236 Got fatal error 1236 from master when reading data from binary log: 'Client requested master to start replication from impossible position' 0
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 106 <Binlog_Ignore_DB>
create table if not exists t1 (n int); create table if not exists t1 (n int);
drop table if exists t1; drop table if exists t1;
create table t1 (n int); create table t1 (n int);
insert into t1 values (1),(2),(3); insert into t1 values (1),(2),(3);
stop slave; stop slave;
change master to master_log_pos=MASTER_LOG_POS; change master to master_log_pos=206;
start slave; start slave;
select * from t1 ORDER BY n; select * from t1 ORDER BY n;
n n
......
...@@ -14,16 +14,47 @@ MIXED MIXED ...@@ -14,16 +14,47 @@ MIXED MIXED
CREATE TABLE t1 (a INT, b LONG); CREATE TABLE t1 (a INT, b LONG);
INSERT INTO t1 VALUES (1,1), (2,2); INSERT INTO t1 VALUES (1,1), (2,2);
INSERT INTO t1 VALUES (3,UUID()), (4,UUID()); INSERT INTO t1 VALUES (3,UUID()), (4,UUID());
show binlog events from <binlog_start>; SHOW BINLOG EVENTS;
**** On Slave **** **** On Slave ****
show binlog events from <binlog_start>; SHOW SLAVE STATUS;
Log_name Pos Event_type Server_id End_log_pos Info Slave_IO_State #
slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) Master_Host 127.0.0.1
slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2) Master_User root
slave-bin.000001 # Query # # BEGIN Master_Port MASTER_PORT
slave-bin.000001 # Table_map # # table_id: # (test.t1) Connect_Retry 1
slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F Master_Log_File master-bin.000001
slave-bin.000001 # Query # # COMMIT Read_Master_Log_Pos #
show binlog events from <binlog_start>; 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 0
Last_IO_Error
Last_SQL_Errno 0
Last_SQL_Error
SHOW BINLOG EVENTS;
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
SET GLOBAL BINLOG_FORMAT=@saved_binlog_format; SET GLOBAL BINLOG_FORMAT=@saved_binlog_format;
...@@ -41,11 +41,12 @@ t1 ...@@ -41,11 +41,12 @@ t1
t2 t2
**** On Master **** **** On Master ****
DROP TABLE t1,t2; DROP TABLE t1,t2;
show binlog events from <binlog_start>; SHOW BINLOG EVENTS;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a int) master-bin.000001 4 Format_desc 1 106 Server ver: VERSION, Binlog ver: 4
master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a int) master-bin.000001 106 Query 1 192 use `test`; CREATE TABLE t1 (a int)
master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ master-bin.000001 192 Query 1 278 use `test`; CREATE TABLE t2 (a int)
master-bin.000001 278 Query 1 382 use `test`; DROP TABLE `t1` /* generated by server */
SHOW TABLES; SHOW TABLES;
Tables_in_test Tables_in_test
t2 t2
......
...@@ -17,5 +17,43 @@ a ...@@ -17,5 +17,43 @@ a
0 0
drop table t1; drop table t1;
insert into t1 values (1); insert into t1 values (1);
Last_SQL_Error = Error 'Table 'test.t1' doesn't exist' on opening tables show slave status;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_MYPORT
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 No
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table test.t2
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1146
Last_Error Error 'Table 'test.t1' doesn't exist' on opening tables
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 0
Last_IO_Error
Last_SQL_Errno 1146
Last_SQL_Error Error 'Table 'test.t1' doesn't exist' on opening tables
drop table t1, t2; drop table t1, t2;
...@@ -12,39 +12,193 @@ create table t2(n int not null auto_increment primary key); ...@@ -12,39 +12,193 @@ create table t2(n int not null auto_increment primary key);
insert into t2 values (1),(2); insert into t2 values (1),(2);
insert into t2 values (3),(4); insert into t2 values (3),(4);
drop table t2; drop table t2;
start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_LOG_POS; start slave until master_log_file='master-bin.000001', master_log_pos=311;
select * from t1; select * from t1;
n n
1 1
2 2
3 3
4 4
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=MASTER_LOG_POS; show slave status;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_MYPORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos #
Relay_Log_File slave-relay-bin.000004
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running #
Slave_SQL_Running No
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 Master
Until_Log_File master-bin.000001
Until_Log_Pos 311
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 0
Last_IO_Error
Last_SQL_Errno 0
Last_SQL_Error
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
select * from t1; select * from t1;
n n 1
1 n 2
2 n 3
3 n 4
4 show slave status;
start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=RELAY_LOG_POS; Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_MYPORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos #
Relay_Log_File slave-relay-bin.000004
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running #
Slave_SQL_Running No
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 Master
Until_Log_File master-no-such-bin.000001
Until_Log_Pos 291
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 0
Last_IO_Error
Last_SQL_Errno 0
Last_SQL_Error
start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=728;
select * from t2; select * from t2;
n show slave status;
1 Slave_IO_State #
2 Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_MYPORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos #
Relay_Log_File slave-relay-bin.000004
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running #
Slave_SQL_Running No
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 Relay
Until_Log_File slave-relay-bin.000004
Until_Log_Pos 728
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 0
Last_IO_Error
Last_SQL_Errno 0
Last_SQL_Error
start slave; start slave;
stop slave; stop slave;
start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_LOG_POS; start slave until master_log_file='master-bin.000001', master_log_pos=740;
start slave until master_log_file='master-bin', master_log_pos=MASTER_LOG_POS; show slave status;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_MYPORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos #
Relay_Log_File slave-relay-bin.000004
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running No
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 Master
Until_Log_File master-bin.000001
Until_Log_Pos 740
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 0
Last_IO_Error
Last_SQL_Errno 0
Last_SQL_Error
start slave until master_log_file='master-bin', master_log_pos=561;
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_LOG_POS, relay_log_pos=RELAY_LOG_POS; start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
start slave until master_log_file='master-bin.000001'; start slave until master_log_file='master-bin.000001';
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
start slave until relay_log_file='slave-relay-bin.000002'; start slave until relay_log_file='slave-relay-bin.000002';
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=MASTER_LOG_POS; start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
start slave sql_thread; start slave sql_thread;
start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_LOG_POS; start slave until master_log_file='master-bin.000001', master_log_pos=740;
Warnings: Warnings:
Note 1254 Slave is already running Level Note
Code 1254
Message Slave is already running
...@@ -8,8 +8,10 @@ create table t1 (n int); ...@@ -8,8 +8,10 @@ create table t1 (n int);
reset master; reset master;
stop slave; stop slave;
change master to master_port=SLAVE_PORT; change master to master_port=SLAVE_PORT;
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 SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # # 0 0 0 106 None 0 No NULL No 0 0
start slave; start slave;
Last_IO_Error = Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it).
insert into t1 values (1); insert into t1 values (1);
show status like "slave_running"; show status like "slave_running";
Variable_name Value Variable_name Value
......
...@@ -8,6 +8,9 @@ create table t1 (n int); ...@@ -8,6 +8,9 @@ create table t1 (n int);
reset master; reset master;
stop slave; stop slave;
change master to master_port=SLAVE_PORT; change master to master_port=SLAVE_PORT;
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 SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # 0 0 0 106 None 0 No NULL No 0 0
start slave; start slave;
insert into t1 values (1); insert into t1 values (1);
select * from t1; select * from t1;
......
...@@ -18,5 +18,44 @@ drop user rpl@127.0.0.1; ...@@ -18,5 +18,44 @@ drop user rpl@127.0.0.1;
flush privileges; flush privileges;
stop slave; stop slave;
start slave; start slave;
show slave status;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User rpl
Master_Port MASTER_MYPORT
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 No
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 NULL
Master_SSL_Verify_Server_Cert No
Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
drop table t1; drop table t1;
drop table t1; drop table t1;
...@@ -176,7 +176,7 @@ end| ...@@ -176,7 +176,7 @@ end|
ERROR HY000: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable) ERROR HY000: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
set global log_bin_trust_routine_creators=1; set global log_bin_trust_routine_creators=1;
Warnings: Warnings:
Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.6. Please use '@@log_bin_trust_function_creators' instead Warning 1287 '@@log_bin_trust_routine_creators' is deprecated and will be removed in a future release. Please use '@@log_bin_trust_function_creators' instead
set global log_bin_trust_function_creators=0; set global log_bin_trust_function_creators=0;
set global log_bin_trust_function_creators=1; set global log_bin_trust_function_creators=1;
set global log_bin_trust_function_creators=1; set global log_bin_trust_function_creators=1;
......
...@@ -376,7 +376,7 @@ CREATE TABLE t12 (data LONG); ...@@ -376,7 +376,7 @@ CREATE TABLE t12 (data LONG);
LOCK TABLES t12 WRITE; LOCK TABLES t12 WRITE;
INSERT INTO t12 VALUES(UUID()); INSERT INTO t12 VALUES(UUID());
UNLOCK TABLES; UNLOCK TABLES;
show binlog events from <binlog_start>; show binlog events;
show binlog events from <binlog_start>; show binlog events;
drop database mysqltest1; drop database mysqltest1;
set global binlog_format= @saved_binlog_format; set global binlog_format= @saved_binlog_format;
...@@ -5,3 +5,92 @@ crash_manycolumns_string : Bug#50495 'Row size too large' for plugin, but works ...@@ -5,3 +5,92 @@ crash_manycolumns_string : Bug#50495 'Row size too large' for plugin, but works
ix_unique_lob : Bug#52283 Innodb reports extra warnings when SELECT/WHERE is performed using invalid value ix_unique_lob : Bug#52283 Innodb reports extra warnings when SELECT/WHERE is performed using invalid value
ix_unique_string_length : Bug#52283 Innodb reports extra warnings when SELECT/WHERE is performed using invalid value ix_unique_string_length : Bug#52283 Innodb reports extra warnings when SELECT/WHERE is performed using invalid value
rpl_create_database : Result Difference Due to Change in .inc file
rpl_loaddata_m : Result Difference Due to Change in .inc file
rpl_sp_effects : Result Difference Due to Change in .inc file
rpl_variables : Result Difference Due to Change in .inc file
rpl_loaddata_s : Result Difference Due to Change in .inc file
rpl_server_id2 : Result Difference Due to Change in .inc file
rpl000010 : Result Difference Due to Change in .inc file
rpl_init_slave : Result Difference Due to Change in .inc file
rpl_dual_pos_advance : Result Difference Due to Change in .inc file
rpl_empty_master_crash : Result Difference Due to Change in .inc file
rpl000011 : Result Difference Due to Change in .inc file
rpl000013 : Result Difference Due to Change in .inc file
rpl_000015 : Result Difference Due to Change in .inc file
rpl_LD_INFILE : Result Difference Due to Change in .inc file
rpl_REDIRECT : Result Difference Due to Change in .inc file
rpl_alter : Result Difference Due to Change in .inc file
rpl_alter_db : Result Difference Due to Change in .inc file
rpl_bit : Result Difference Due to Change in .inc file
rpl_bit_npk : Result Difference Due to Change in .inc file
rpl_change_master : Result Difference Due to Change in .inc file
rpl_do_grant : Result Difference Due to Change in .inc file
rpl_drop : Result Difference Due to Change in .inc file
rpl_drop_db : Result Difference Due to Change in .inc file
rpl_flushlog_loop : Result Difference Due to Change in .inc file
rpl_get_lock : Result Difference Due to Change in .inc file
rpl_insert : Result Difference Due to Change in .inc file
rpl_insert_select : Result Difference Due to Change in .inc file
rpl_loaddata2 : Result Difference Due to Change in .inc file
rpl_loaddatalocal : Result Difference Due to Change in .inc file
rpl_loadfile : Result Difference Due to Change in .inc file
rpl_log_pos : Result Difference Due to Change in .inc file
rpl_many_optimize : Result Difference Due to Change in .inc file
rpl_master_pos_wait : Result Difference Due to Change in .inc file
rpl_misc_functions : Result Difference Due to Change in .inc file
rpl_ps : Result Difference Due to Change in .inc file
rpl_rbr_to_sbr : Result Difference Due to Change in .inc file
rpl_row_max_relay_size : Result Difference Due to Change in .inc file
rpl_server_id1 : Result Difference Due to Change in .inc file
rpl_session_var : Result Difference Due to Change in .inc file
rpl_sf : Result Difference Due to Change in .inc file
rpl_slave_status : Result Difference Due to Change in .inc file
rpl_sp004 : Result Difference Due to Change in .inc file
rpl_start_stop_slave : Result Difference Due to Change in .inc file
rpl_stm_max_relay_size : Result Difference Due to Change in .inc file
rpl_stm_mystery22 : Result Difference Due to Change in .inc file
rpl_stm_no_op : Result Difference Due to Change in .inc file
rpl_stm_reset_slave : Result Difference Due to Change in .inc file
rpl_temp_table : Result Difference Due to Change in .inc file
rpl_temporary : Result Difference Due to Change in .inc file
rpl_trigger : Result Difference Due to Change in .inc file
rpl_trunc_temp : Result Difference Due to Change in .inc file
rpl_user_variables : Result Difference Due to Change in .inc file
rpl_relayspace : Result Difference Due to Change in .inc file
rpl_multi_delete2 : Result Difference Due to Change in .inc file
rpl_view : Result Difference Due to Change in .inc file
rpl_ignore_table_update : Result Difference Due to Change in .inc file
rpl_err_ignoredtable : Result Difference Due to Change in .inc file
rpl_multi_update4 : Result Difference Due to Change in .inc file
rpl_multi_delete : Result Difference Due to Change in .inc file
rpl_ignore_grant : Result Difference Due to Change in .inc file
rpl_ignore_revoke : Result Difference Due to Change in .inc file
rpl_free_items : Result Difference Due to Change in .inc file
rpl_replicate_ignore_db : Result Difference Due to Change in .inc file
rpl000017 : Result Difference Due to Change in .inc file
rpl_skip_error : Result Difference Due to Change in .inc file
rpl_sp : Result Difference Due to Change in .inc file
rpl_row_until : Test Present in rpl suite as well . Test Fails with table t2 not found.
rpl_loaddata_s : Test Present in rpl suite as well . Test Fails due to bin log truncation.
rpl_log_pos : Test Present in rpl suite as well . Test Fails due to bin log truncation.
rpl_row_NOW : Result Difference Due to Change in .inc file
rpl_row_USER : Result Difference Due to Change in .inc file
rpl_row_drop : Result Difference Due to Change in .inc file
rpl_row_func001 : Result Difference Due to Change in .inc file
rpl_row_reset_slave : Result Difference Due to Change in .inc file
rpl_row_sp001 : Result Difference Due to Change in .inc file
rpl_row_sp005 : Result Difference Due to Change in .inc file
rpl_row_sp008 : Result Difference Due to Change in .inc file
rpl_row_sp009 : Result Difference Due to Change in .inc file
rpl_row_sp010 : Result Difference Due to Change in .inc file
rpl_row_sp011 : Result Difference Due to Change in .inc file
rpl_row_sp012 : Result Difference Due to Change in .inc file
rpl_row_stop_middle : Result Difference Due to Change in .inc file
rpl_row_trig001 : Result Difference Due to Change in .inc file
rpl_row_trig002 : Result Difference Due to Change in .inc file
rpl_row_trig003 : Result Difference Due to Change in .inc file
rpl_row_view01 : Result Difference Due to Change in .inc file
rpl_switch_stm_row_mixed : Result Difference Due to Change in .inc file
rpl_row_inexist_tbl : Result Difference Due to Change in .inc file
...@@ -11,25 +11,31 @@ save_master_pos; ...@@ -11,25 +11,31 @@ save_master_pos;
connection slave; connection slave;
stop slave; stop slave;
reset slave; reset slave;
let $status_items= Master_Log_File, Read_Master_Log_Pos, Relay_Master_Log_File, Exec_Master_Log_Pos; --vertical_results
source include/show_slave_status.inc; --replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 5 # 8 # 9 # 23 # 33 #
show slave status;
change master to master_host='127.0.0.1'; change master to master_host='127.0.0.1';
# The following needs to be cleaned up when change master is fixed # The following needs to be cleaned up when change master is fixed
source include/show_slave_status.inc; --vertical_results
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 5 # 8 # 9 # 23 # 33 #
show slave status;
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
eval change master to master_host='127.0.0.1',master_user='root', eval change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=$MASTER_MYPORT; master_password='',master_port=$MASTER_MYPORT;
source include/show_slave_status.inc; --vertical_results
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 5 # 8 # 9 # 23 # 33 #
show slave status;
start slave; start slave;
sync_with_master; sync_with_master;
let $status_items= Master_Log_File, Relay_Master_Log_File;
source include/show_slave_status.inc;
source include/check_slave_is_running.inc;
--vertical_results --vertical_results
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 5 # 8 # 9 # 23 # 33 #
--replace_column 33 #
show slave status;
connection master; connection master;
--disable_warnings --disable_warnings
drop table if exists t1; drop table if exists t1;
......
...@@ -7,11 +7,15 @@ source include/master-slave.inc; ...@@ -7,11 +7,15 @@ source include/master-slave.inc;
--disable_ps_protocol --disable_ps_protocol
#first, make sure the slave has had enough time to register #first, make sure the slave has had enough time to register
sync_slave_with_master; save_master_pos;
connection slave;
sync_with_master;
#discover slaves #discover slaves
connection master; connection master;
--query_vertical SHOW SLAVE STATUS; --replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
SHOW SLAVE STATUS;
--replace_result $SLAVE_MYPORT SLAVE_PORT --replace_result $SLAVE_MYPORT SLAVE_PORT
SHOW SLAVE HOSTS; SHOW SLAVE HOSTS;
rpl_probe; rpl_probe;
...@@ -21,7 +25,9 @@ enable_rpl_parse; ...@@ -21,7 +25,9 @@ enable_rpl_parse;
create table t1 ( n int); create table t1 ( n int);
insert into t1 values (1),(2),(3),(4); insert into t1 values (1),(2),(3),(4);
disable_rpl_parse; disable_rpl_parse;
sync_slave_with_master; save_master_pos;
connection slave;
sync_with_master;
insert into t1 values(5); insert into t1 values(5);
connection master; connection master;
enable_rpl_parse; enable_rpl_parse;
......
...@@ -18,26 +18,13 @@ save_master_pos; ...@@ -18,26 +18,13 @@ save_master_pos;
connection slave; connection slave;
--real_sleep 3 # wait for I/O thread to have read updates --real_sleep 3 # wait for I/O thread to have read updates
stop slave; stop slave;
source include/wait_for_slave_to_stop.inc; --replace_result $MASTER_MYPORT MASTER_MYPORT
--replace_column 1 # 7 # 8 # 9 # 23 # 33 #
let $read_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1); show slave status;
let $exec_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
if (`SELECT $read_pos = $exec_pos`)
{
source include/show_rpl_debug_info.inc;
echo 'Read_Master_Log_Pos: $read_pos' == 'Exec_Master_Log_Pos: $exec_pos';
die Failed because Read_Master_Log_Pos is equal to Exec_Master_Log_Pos;
}
change master to master_user='root'; change master to master_user='root';
let $read_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1); --replace_result $MASTER_MYPORT MASTER_MYPORT
let $exec_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1); --replace_column 1 # 7 # 8 # 9 # 23 # 33 #
if (`SELECT $read_pos <> $exec_pos`) show slave status;
{
source include/show_rpl_debug_info.inc;
echo 'Read_Master_Log_Pos: $read_pos' <> 'Exec_Master_Log_Pos: $exec_pos';
die Failed because Read_Master_Log_Pos is not equal to Exec_Master_Log_Pos;
}
start slave; start slave;
sync_with_master; sync_with_master;
select * from t1; select * from t1;
......
source include/master-slave.inc; source include/master-slave.inc;
--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
show slave status;
# #
# Load table should not succeed on the master as this is not a slave # Load table should not succeed on the master as this is not a slave
# #
......
...@@ -41,7 +41,8 @@ sleep 5; ...@@ -41,7 +41,8 @@ sleep 5;
# #
# Show status of slave # Show status of slave
# #
--let status_items= Relay_Log_File --replace_result $SLAVE_MYPORT SLAVE_PORT
--source include/show_slave_status.inc --replace_column 1 # 8 # 9 # 16 # 23 # 33 #
--source include/check_slave_is_running.inc --vertical_results
SHOW SLAVE STATUS;
STOP SLAVE; STOP SLAVE;
...@@ -20,7 +20,9 @@ save_master_pos; ...@@ -20,7 +20,9 @@ save_master_pos;
connection slave; connection slave;
sync_with_master; sync_with_master;
select count(*) from test.t1; # check that LOAD was replicated select count(*) from test.t1; # check that LOAD was replicated
source include/show_binlog_events.inc; --replace_column 2 # 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
show binlog events from 106; # should be nothing
# Cleanup # Cleanup
connection master; connection master;
......
...@@ -11,41 +11,36 @@ ...@@ -11,41 +11,36 @@
# Passes with rbr no problem, removed statement include [jbm] # Passes with rbr no problem, removed statement include [jbm]
source include/master-slave.inc; source include/master-slave.inc;
let $master_log_pos= query_get_value(SHOW MASTER STATUS, Position, 1); --replace_column 3 <Binlog_Ignore_DB>
show master status;
sync_slave_with_master; sync_slave_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
show slave status;
stop slave; stop slave;
change master to master_log_pos=106;
--replace_result $master_log_pos MASTER_LOG_POS
eval change master to master_log_pos=$master_log_pos;
start slave; start slave;
sleep 5; sleep 5;
stop slave; stop slave;
change master to master_log_pos=106;
--replace_result $master_log_pos MASTER_LOG_POS --replace_result $MASTER_MYPORT MASTER_PORT
eval change master to master_log_pos=$master_log_pos; --replace_column 1 # 8 # 9 # 23 # 33 #
--let $slave_param= Read_Master_Log_Pos show slave status;
--let $slave_param_value= $master_log_pos
--source include/wait_for_slave_param.inc
start slave; start slave;
sleep 5; sleep 5;
--let $slave_param= Read_Master_Log_Pos --replace_result $MASTER_MYPORT MASTER_PORT
--let $slave_param_value= $master_log_pos --replace_column 1 # 8 # 9 # 23 # 33 #
--source include/wait_for_slave_param.inc show slave status;
--source include/check_slave_no_error.inc
stop slave; stop slave;
--echo # impossible position leads to an error
--replace_result 177 MASTER_LOG_POS
change master to master_log_pos=177; change master to master_log_pos=177;
start slave; start slave;
sleep 2; sleep 2;
let $slave_io_errno= 1236; --replace_result $MASTER_MYPORT MASTER_PORT
let $show_slave_io_error= 1; --replace_column 1 # 8 # 9 # 23 # 33 #
source include/wait_for_slave_io_error.inc; show slave status;
connection master; connection master;
--replace_column 3 <Binlog_Ignore_DB>
let $master_log_pos= query_get_value(SHOW MASTER STATUS, Position, 1); show master status;
create table if not exists t1 (n int); create table if not exists t1 (n int);
drop table if exists t1; drop table if exists t1;
create table t1 (n int); create table t1 (n int);
...@@ -53,9 +48,7 @@ insert into t1 values (1),(2),(3); ...@@ -53,9 +48,7 @@ insert into t1 values (1),(2),(3);
save_master_pos; save_master_pos;
connection slave; connection slave;
stop slave; stop slave;
change master to master_log_pos=206;
--replace_result $master_log_pos MASTER_LOG_POS
eval change master to master_log_pos=$master_log_pos;
start slave; start slave;
sync_with_master; sync_with_master;
select * from t1 ORDER BY n; select * from t1 ORDER BY n;
......
...@@ -15,17 +15,25 @@ SELECT @@GLOBAL.BINLOG_FORMAT, @@SESSION.BINLOG_FORMAT; ...@@ -15,17 +15,25 @@ SELECT @@GLOBAL.BINLOG_FORMAT, @@SESSION.BINLOG_FORMAT;
CREATE TABLE t1 (a INT, b LONG); CREATE TABLE t1 (a INT, b LONG);
INSERT INTO t1 VALUES (1,1), (2,2); INSERT INTO t1 VALUES (1,1), (2,2);
INSERT INTO t1 VALUES (3,UUID()), (4,UUID()); INSERT INTO t1 VALUES (3,UUID()), (4,UUID());
let $VERSION=`select version()`;
--replace_result $VERSION VERSION
--replace_column 2 # 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
# Different number of binlog events are generated by different engines # Different number of binlog events are generated by different engines
--disable_result_log --disable_result_log
source include/show_binlog_events.inc; SHOW BINLOG EVENTS;
--enable_result_log --enable_result_log
sync_slave_with_master; sync_slave_with_master;
--echo **** On Slave **** --echo **** On Slave ****
source include/show_binlog_events.inc; --replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
--query_vertical SHOW SLAVE STATUS
--replace_result $VERSION VERSION
--replace_column 2 # 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
# Different number of binlog events are generated by different engines # Different number of binlog events are generated by different engines
--disable_result_log --disable_result_log
source include/show_binlog_events.inc; SHOW BINLOG EVENTS;
--enable_result_log --enable_result_log
--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_master.sql --exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_master.sql
--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_slave.sql --exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_slave.sql
......
...@@ -30,7 +30,10 @@ connection master; ...@@ -30,7 +30,10 @@ connection master;
--echo **** On Master **** --echo **** On Master ****
# Should drop the non-temporary table t1 and the temporary table t2 # Should drop the non-temporary table t1 and the temporary table t2
DROP TABLE t1,t2; DROP TABLE t1,t2;
source include/show_binlog_events.inc; let $VERSION=`select version()`;
--replace_result $VERSION VERSION
--replace_regex /table_id: [0-9]+/table_id: #/
SHOW BINLOG EVENTS;
SHOW TABLES; SHOW TABLES;
sync_slave_with_master; sync_slave_with_master;
--echo **** On Slave **** --echo **** On Slave ****
......
...@@ -22,11 +22,13 @@ connection master; ...@@ -22,11 +22,13 @@ connection master;
insert into t1 values (1); insert into t1 values (1);
connection slave; connection slave;
# slave should have stopped because can't find table t1 # slave should have stopped because can't find table t1
wait_for_slave_to_stop;
# see if we have a good error message: # see if we have a good error message:
--let $slave_sql_errno= 1146 --replace_result $MASTER_MYPORT MASTER_MYPORT
--let $show_slave_sql_error= 1 --replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
--source include/wait_for_slave_sql_error.inc --vertical_results
show slave status;
# cleanup # cleanup
connection master; connection master;
......
...@@ -18,50 +18,44 @@ connection master; ...@@ -18,50 +18,44 @@ connection master;
# create some events on master # create some events on master
create table t1(n int not null auto_increment primary key); create table t1(n int not null auto_increment primary key);
insert into t1 values (1),(2),(3),(4); insert into t1 values (1),(2),(3),(4);
let $master_log_pos_1= query_get_value(SHOW MASTER STATUS, Position, 1);
drop table t1; drop table t1;
create table t2(n int not null auto_increment primary key); create table t2(n int not null auto_increment primary key);
insert into t2 values (1),(2); insert into t2 values (1),(2);
let $master_log_pos_2= query_get_value(SHOW MASTER STATUS, Position, 1);
insert into t2 values (3),(4); insert into t2 values (3),(4);
drop table t2; drop table t2;
# try to replicate all queries until drop of t1 # try to replicate all queries until drop of t1
connection slave; connection slave;
--replace_result $master_log_pos_1 MASTER_LOG_POS start slave until master_log_file='master-bin.000001', master_log_pos=311;
eval start slave until master_log_file='master-bin.000001', master_log_pos=$master_log_pos_1;
sleep 2; sleep 2;
wait_for_slave_to_stop; wait_for_slave_to_stop;
# here table should be still not deleted # here table should be still not deleted
select * from t1; select * from t1;
--let $slave_param= Exec_Master_Log_Pos --vertical_results
--let $slave_param_value= $master_log_pos_1 --replace_result $MASTER_MYPORT MASTER_MYPORT
--source include/check_slave_param.inc --replace_column 1 # 7 # 9 # 11 # 22 # 23 # 33 #
show slave status;
# this should fail right after start # this should fail right after start
--replace_result 291 MASTER_LOG_POS
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291; start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
# again this table should be still not deleted # again this table should be still not deleted
select * from t1; select * from t1;
sleep 2; sleep 2;
wait_for_slave_to_stop; wait_for_slave_to_stop;
--let $slave_param= Exec_Master_Log_Pos --vertical_results
--let $slave_param_value= $master_log_pos_1 --replace_result $MASTER_MYPORT MASTER_MYPORT
--source include/check_slave_param.inc --replace_column 1 # 7 # 9 # 11 # 22 # 23 # 33 #
show slave status;
# try replicate all up to and not including the second insert to t2; # try replicate all up to and not including the second insert to t2;
let $master_log_pos= $master_log_pos_2; start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=728;
let $relay_log_file= slave-relay-bin.000004;
--source include/get_relay_log_pos.inc
--replace_result $relay_log_pos RELAY_LOG_POS
eval start slave until relay_log_file='$relay_log_file', relay_log_pos=$relay_log_pos;
sleep 2; sleep 2;
wait_for_slave_to_stop; wait_for_slave_to_stop;
select * from t2; select * from t2;
--let $slave_param= Exec_Master_Log_Pos --vertical_results
--let $slave_param_value= $master_log_pos --replace_result $MASTER_MYPORT MASTER_MYPORT
--source include/check_slave_param.inc --replace_column 1 # 7 # 9 # 11 # 22 # 23 # 33 #
show slave status;
# clean up # clean up
start slave; start slave;
...@@ -71,32 +65,27 @@ connection slave; ...@@ -71,32 +65,27 @@ connection slave;
sync_with_master; sync_with_master;
stop slave; stop slave;
--let $exec_log_pos_1= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1)
# this should stop immediately as we are already there # this should stop immediately as we are already there
--replace_result $master_log_pos_2 MASTER_LOG_POS start slave until master_log_file='master-bin.000001', master_log_pos=740;
eval start slave until master_log_file='master-bin.000001', master_log_pos=$master_log_pos_2;
sleep 2; sleep 2;
wait_for_slave_to_stop; wait_for_slave_to_stop;
# here the sql slave thread should be stopped # here the sql slave thread should be stopped
--let $slave_param= Exec_Master_Log_Pos --vertical_results
--let $slave_param_value= $exec_log_pos_1 --replace_result $MASTER_MYPORT MASTER_MYPORT bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004
--source include/check_slave_param.inc --replace_column 1 # 7 # 9 # 22 # 23 # 33 #
show slave status;
#testing various error conditions #testing various error conditions
--replace_result 561 MASTER_LOG_POS
--error 1277 --error 1277
start slave until master_log_file='master-bin', master_log_pos=561; start slave until master_log_file='master-bin', master_log_pos=561;
--replace_result 561 MASTER_LOG_POS 12 RELAY_LOG_POS
--error 1277 --error 1277
start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12; start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
--error 1277 --error 1277
start slave until master_log_file='master-bin.000001'; start slave until master_log_file='master-bin.000001';
--error 1277 --error 1277
start slave until relay_log_file='slave-relay-bin.000002'; start slave until relay_log_file='slave-relay-bin.000002';
--replace_result 561 MASTER_LOG_POS
--error 1277 --error 1277
start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561; start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
# Warning should be given for second command # Warning should be given for second command
start slave sql_thread; start slave sql_thread;
--replace_result 740 MASTER_LOG_POS
start slave until master_log_file='master-bin.000001', master_log_pos=740; start slave until master_log_file='master-bin.000001', master_log_pos=740;
...@@ -12,13 +12,10 @@ reset master; ...@@ -12,13 +12,10 @@ reset master;
stop slave; stop slave;
--replace_result $SLAVE_MYPORT SLAVE_PORT --replace_result $SLAVE_MYPORT SLAVE_PORT
eval change master to master_port=$SLAVE_MYPORT; eval change master to master_port=$SLAVE_MYPORT;
source include/check_slave_no_error.inc; --replace_result $SLAVE_MYPORT SLAVE_PORT
--replace_column 16 # 18 #
show slave status;
start slave; start slave;
let $slave_io_errno= 1593;
let $show_slave_io_error= 1;
source include/wait_for_slave_io_error.inc;
insert into t1 values (1); insert into t1 values (1);
# can't MASTER_POS_WAIT(), it does not work in this weird setup # can't MASTER_POS_WAIT(), it does not work in this weird setup
# (when slave is its own master without --replicate-same-server-id) # (when slave is its own master without --replicate-same-server-id)
......
...@@ -9,6 +9,9 @@ reset master; ...@@ -9,6 +9,9 @@ reset master;
stop slave; stop slave;
--replace_result $SLAVE_MYPORT SLAVE_PORT --replace_result $SLAVE_MYPORT SLAVE_PORT
eval change master to master_port=$SLAVE_MYPORT; eval change master to master_port=$SLAVE_MYPORT;
--replace_result $SLAVE_MYPORT SLAVE_PORT
--replace_column 18 #
show slave status;
start slave; start slave;
insert into t1 values (1); insert into t1 values (1);
save_master_pos; save_master_pos;
......
...@@ -22,7 +22,9 @@ drop table if exists t1; ...@@ -22,7 +22,9 @@ drop table if exists t1;
--enable_warnings --enable_warnings
create table t1 (n int); create table t1 (n int);
insert into t1 values (1); insert into t1 values (1);
sync_slave_with_master; save_master_pos;
connection slave;
sync_with_master;
select * from t1; select * from t1;
# 3. Delete new replication user # 3. Delete new replication user
...@@ -38,8 +40,12 @@ stop slave; ...@@ -38,8 +40,12 @@ stop slave;
start slave; start slave;
# 5. Make sure Slave_IO_Running = No # 5. Make sure Slave_IO_Running = No
let $slave_io_errno= 1045; --replace_result $MASTER_MYPORT MASTER_MYPORT
source include/wait_for_slave_io_error.inc; # Column 1 is replaced, since the output can be either
# "Connecting to master" or "Waiting for master update"
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 35 # 36 #
--vertical_results
show slave status;
# Cleanup (Note that slave IO thread is not running) # Cleanup (Note that slave IO thread is not running)
connection slave; connection slave;
......
...@@ -501,7 +501,9 @@ INSERT INTO t12 VALUES(UUID()); ...@@ -501,7 +501,9 @@ INSERT INTO t12 VALUES(UUID());
UNLOCK TABLES; UNLOCK TABLES;
--disable_result_log --disable_result_log
source include/show_binlog_events.inc; --replace_column 2 # 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
show binlog events;
--enable_result_log --enable_result_log
sync_slave_with_master; sync_slave_with_master;
...@@ -518,7 +520,9 @@ diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_ ...@@ -518,7 +520,9 @@ diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_
connection master; connection master;
--disable_result_log --disable_result_log
source include/show_binlog_events.inc; --replace_column 2 # 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
show binlog events;
--enable_result_log --enable_result_log
# Now test that mysqlbinlog works fine on a binlog generated by the # Now test that mysqlbinlog works fine on a binlog generated by the
......
...@@ -226,6 +226,7 @@ SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; ...@@ -226,6 +226,7 @@ SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2;
## Full table scan ## ## Full table scan ##
--sorted_result --sorted_result
SELECT * FROM t2; SELECT * FROM t2;
--sorted_result --sorted_result
SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t2; SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t2;
--sorted_result --sorted_result
...@@ -300,6 +301,7 @@ SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; ...@@ -300,6 +301,7 @@ SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2;
## Full table scan ## ## Full table scan ##
--sorted_result --sorted_result
SELECT * FROM t2; SELECT * FROM t2;
--sorted_result --sorted_result
SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t2; SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t2;
--sorted_result --sorted_result
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment