~ubuntu-branches/ubuntu/natty/mysql-5.1/natty-proposed

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
start slave;
Got one of the listed errors
start slave;
ERROR HY000: Could not initialize master info structure; more error messages can be found in the MySQL error log
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
ERROR HY000: Could not initialize master info structure; more error messages can be found in the MySQL error log
reset slave;
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
reset master;
start slave;
create temporary table temp_table (a char(80) not null);
insert into temp_table values ("testing temporary tables");
create table t1 (s text);
insert into t1 values('Could not break slave'),('Tried hard');
Master_Log_File = 'master-bin.000001'
Relay_Master_Log_File = 'master-bin.000001'
include/check_slave_is_running.inc
select * from t1;
s
Could not break slave
Tried hard
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;
Log_name	File_size
master-bin.000001	#
master-bin.000002	#
master-bin.000003	#
create table t3 select * from temp_table;
select * from t3;
a
testing temporary tables
drop table temp_table, t3;
insert into t2 values(1234);
set insert_id=1234;
insert into t2 values(NULL);
call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .1234. for key .PRIMARY.. on query.* Error_code: 1062");
include/wait_for_slave_sql_error_and_skip.inc [errno=1062]
purge master logs to 'master-bin.000002';
show master logs;
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	#
master-bin.000003	#
SELECT @time_for_purge:=DATE_ADD('tmpval', INTERVAL 1 SECOND);
purge master logs before (@time_for_purge);
show binary logs;
Log_name	File_size
master-bin.000003	#
insert into t2 values (65);
Master_Log_File = 'master-bin.000003'
Relay_Master_Log_File = 'master-bin.000003'
include/check_slave_is_running.inc
select * from t2;
m
34
65
67
123
1234
create temporary table temp_table (a char(80) not null);
insert into temp_table values ("testing temporary tables part 2");
create table t3 (n int);
select count(*) from t3 where n >= 4;
count(*)
100
create table t4 select * from temp_table;
show binary logs;
Log_name	File_size
master-bin.000003	#
master-bin.000004	#
master-bin.000005	#
show master status;
File	Position	Binlog_Do_DB	Binlog_Ignore_DB
master-bin.000005	#	<Binlog_Do_DB>	<Binlog_Ignore_DB>
select * from t4;
a
testing temporary tables part 2
Master_Log_File = 'master-bin.000005'
Relay_Master_Log_File = 'master-bin.000005'
include/check_slave_is_running.inc
lock tables t3 read;
select count(*) from t3 where n >= 4;
count(*)
100
unlock tables;
drop table if exists t1,t2,t3,t4;
End of 4.1 tests
show binlog events in 'non existing_binlog_file';
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
purge master logs before now();
show binlog events in '';
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
purge master logs before now();
End of 5.0 tests
include/stop_slave.inc
CHANGE MASTER TO MASTER_HOST = '';