rpl_rotate_logs.result 3.17 KB
Newer Older
unknown's avatar
unknown committed
1 2
drop table if exists t1, t2, t3, t4;
drop table if exists t1, t2, t3, t4;
unknown's avatar
unknown committed
3
slave start;
4
Could not initialize master info structure, more error messages can be found in the MySQL error log
unknown's avatar
unknown committed
5
slave start;
6
Could not initialize master info structure, more error messages can be found in the MySQL error log
unknown's avatar
unknown committed
7
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
8
Could not initialize master info structure, more error messages can be found in the MySQL error log
unknown's avatar
unknown committed
9
reset slave;
unknown's avatar
unknown committed
10
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
unknown's avatar
unknown committed
11 12
reset master;
slave start;
13 14
create temporary table temp_table (a char(80) not null);
insert into temp_table values ("testing temporary tables");
unknown's avatar
unknown committed
15 16 17
create table t1 (s text);
insert into t1 values('Could not break slave'),('Tried hard');
show slave status;
unknown's avatar
unknown committed
18
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	Last_errno	Last_error	Skip_counter	Exec_master_log_pos	Relay_log_space
19
127.0.0.1	root	MASTER_PORT	60	master-bin.001	417	slave-relay-bin.001	458	master-bin.001	Yes	Yes			0		0	417	458
unknown's avatar
unknown committed
20
select * from t1;
21 22 23
s
Could not break slave
Tried hard
unknown's avatar
unknown committed
24 25
flush logs;
drop table if exists t2;
unknown's avatar
unknown committed
26
create table t2(m int not null auto_increment primary key);
unknown's avatar
unknown committed
27 28 29
insert into t2 values (34),(67),(123);
flush logs;
show master logs;
30 31 32 33
Log_name
master-bin.001
master-bin.002
master-bin.003
34 35 36 37 38
create table t3 select * from temp_table;
select * from t3;
a
testing temporary tables
drop table temp_table, t3;
unknown's avatar
unknown committed
39
insert into t2 values(1234);
unknown's avatar
unknown committed
40 41
set insert_id=1234;
insert into t2 values(NULL);
unknown's avatar
unknown committed
42
set global sql_slave_skip_counter=1;
unknown's avatar
unknown committed
43 44 45
slave start;
purge master logs to 'master-bin.003';
show master logs;
46 47
Log_name
master-bin.003
unknown's avatar
unknown committed
48 49
insert into t2 values (65);
show slave status;
unknown's avatar
unknown committed
50
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	Last_errno	Last_error	Skip_counter	Exec_master_log_pos	Relay_log_space
51
127.0.0.1	root	MASTER_PORT	60	master-bin.003	290	slave-relay-bin.001	1073	master-bin.003	Yes	Yes			0		0	290	1073
unknown's avatar
unknown committed
52
select * from t2;
53 54
m
34
55
65
56 57
67
123
58
1234
59 60
create temporary table temp_table (a char(80) not null);
insert into temp_table values ("testing temporary tables part 2");
unknown's avatar
unknown committed
61 62
drop table if exists t3;
create table t3 (n int);
63
create table t4 select * from temp_table;
unknown's avatar
unknown committed
64
show master logs;
65 66 67
Log_name
master-bin.003
master-bin.004
unknown's avatar
unknown committed
68
show master status;
unknown's avatar
unknown committed
69
File	Position	Binlog_do_db	Binlog_ignore_db
70
master-bin.004	2886		
71 72 73
select * from t4;
a
testing temporary tables part 2
unknown's avatar
unknown committed
74
show slave status;
unknown's avatar
unknown committed
75
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	Last_errno	Last_error	Skip_counter	Exec_master_log_pos	Relay_log_space
76
127.0.0.1	root	MASTER_PORT	60	master-bin.004	2886	slave-relay-bin.001	7870	master-bin.004	Yes	Yes			0		0	2886	7870
unknown's avatar
unknown committed
77 78
lock tables t3 read;
select count(*) from t3 where n >= 4;
79 80
count(*)
100
unknown's avatar
unknown committed
81
unlock tables;
82
drop table if exists t1,t2,t3,t4;