rpl_rotate_logs.result 3.6 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;
3
start slave;
4
ERROR HY000: Could not initialize master info structure, check permisions on master.info
5
start slave;
6
ERROR HY000: Could not initialize master info structure, check permisions on master.info
unknown's avatar
unknown committed
7
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
unknown's avatar
unknown committed
8
Could not initialize master info
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
reset master;
12
start slave;
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;
18 19
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
127.0.0.1	root	MASTER_PORT	60	master-bin.000001	417	slave-relay-bin.000001	461	master-bin.000001	Yes	Yes							0		0	417	461
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
flush logs;
unknown's avatar
unknown committed
25
create table t2(m int not null auto_increment primary key);
unknown's avatar
unknown committed
26 27
insert into t2 values (34),(67),(123);
flush logs;
28
show binary logs;
29
Log_name
30 31 32
master-bin.000001
master-bin.000002
master-bin.000003
33 34 35 36 37
create table t3 select * from temp_table;
select * from t3;
a
testing temporary tables
drop table temp_table, t3;
unknown's avatar
unknown committed
38
insert into t2 values(1234);
unknown's avatar
unknown committed
39 40
set insert_id=1234;
insert into t2 values(NULL);
unknown's avatar
unknown committed
41
set global sql_slave_skip_counter=1;
42
start slave;
unknown's avatar
unknown committed
43
purge master logs to 'master-bin.000002';
44 45 46 47 48
show master logs;
Log_name
master-bin.000002
master-bin.000003
purge binary logs to 'master-bin.000002';
unknown's avatar
unknown committed
49 50 51 52
show binary logs;
Log_name
master-bin.000002
master-bin.000003
53
purge master logs before now();
54
show binary logs;
55
Log_name
56
master-bin.000003
unknown's avatar
unknown committed
57 58
insert into t2 values (65);
show slave status;
59 60
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
127.0.0.1	root	MASTER_PORT	60	master-bin.000003	290	slave-relay-bin.000001	1088	master-bin.000003	Yes	Yes							0		0	290	1088
unknown's avatar
unknown committed
61
select * from t2;
62 63
m
34
64
65
65 66
67
123
67
1234
68 69
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
70
create table t3 (n int);
71
create table t4 select * from temp_table;
72
show binary logs;
73
Log_name
74 75 76 77
master-bin.000003
master-bin.000004
master-bin.000005
master-bin.000006
unknown's avatar
unknown committed
78
show master status;
unknown's avatar
unknown committed
79
File	Position	Binlog_do_db	Binlog_ignore_db
80
master-bin.000006	838		
81 82 83
select * from t4;
a
testing temporary tables part 2
unknown's avatar
unknown committed
84
show slave status;
85 86
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
127.0.0.1	root	MASTER_PORT	60	master-bin.000006	838	slave-relay-bin.000001	8067	master-bin.000006	Yes	Yes							0		0	838	8067
unknown's avatar
unknown committed
87 88
lock tables t3 read;
select count(*) from t3 where n >= 4;
89 90
count(*)
100
unknown's avatar
unknown committed
91
unlock tables;
92
drop table if exists t1,t2,t3,t4;