1connect  master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
2connect  slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK;
3connection slave;
4CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
5start slave;
6Got one of the listed errors
7start slave;
8ERROR HY000: Could not initialize master info structure for ''; more error messages can be found in the MariaDB error log
9change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
10ERROR HY000: Could not initialize master info structure for ''; more error messages can be found in the MariaDB error log
11reset slave;
12change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
13connection master;
14reset master;
15connection slave;
16start slave;
17include/wait_for_slave_to_start.inc
18connection master;
19create temporary table temp_table (a char(80) not null);
20insert into temp_table values ("testing temporary tables");
21create table t1 (s text);
22insert into t1 values('Could not break slave'),('Tried hard');
23connection slave;
24Master_Log_File = 'master-bin.000001'
25Relay_Master_Log_File = 'master-bin.000001'
26include/check_slave_is_running.inc
27select * from t1;
28s
29Could not break slave
30Tried hard
31connection master;
32flush logs;
33create table t2(m int not null auto_increment primary key);
34insert into t2 values (34),(67),(123);
35flush logs;
36show binary logs;
37Log_name	File_size
38master-bin.000001	#
39master-bin.000002	#
40master-bin.000003	#
41create table t3 select * from temp_table;
42connection slave;
43select * from t3;
44a
45testing temporary tables
46connection master;
47drop table temp_table, t3;
48connection slave;
49insert into t2 values(1234);
50connection master;
51set insert_id=1234;
52insert into t2 values(NULL);
53connection slave;
54call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .1234. for key .PRIMARY.. on query.* error.* 1062");
55include/wait_for_slave_sql_error_and_skip.inc [errno=1062]
56connection master;
57connection slave;
58connection master;
59purge master logs to 'master-bin.000002';
60show master logs;
61Log_name	master-bin.000002
62File_size	#
63Log_name	master-bin.000003
64File_size	#
65purge binary logs to 'master-bin.000002';
66show binary logs;
67Log_name	File_size
68master-bin.000002	#
69master-bin.000003	#
70SELECT @time_for_purge:=DATE_ADD('tmpval', INTERVAL 1 SECOND);
71purge master logs before (@time_for_purge);
72show binary logs;
73Log_name	File_size
74master-bin.000003	#
75insert into t2 values (65);
76connection slave;
77Master_Log_File = 'master-bin.000003'
78Relay_Master_Log_File = 'master-bin.000003'
79include/check_slave_is_running.inc
80select * from t2;
81m
8234
8365
8467
85123
861234
87connection master;
88create temporary table temp_table (a char(80) not null);
89insert into temp_table values ("testing temporary tables part 2");
90create table t3 (n int);
91select count(*) from t3 where n >= 4;
92count(*)
93103
94create table t4 select * from temp_table;
95show binary logs;
96Log_name	File_size
97master-bin.000003	#
98master-bin.000004	#
99master-bin.000005	#
100master-bin.000006	#
101master-bin.000007	#
102master-bin.000008	#
103master-bin.000009	#
104show master status;
105File	Position	Binlog_Do_DB	Binlog_Ignore_DB
106master-bin.000009	#	<Binlog_Do_DB>	<Binlog_Ignore_DB>
107connection slave;
108select * from t4;
109a
110testing temporary tables part 2
111Master_Log_File = 'master-bin.000009'
112Relay_Master_Log_File = 'master-bin.000009'
113include/check_slave_is_running.inc
114lock tables t3 read;
115select count(*) from t3 where n >= 4;
116count(*)
117103
118unlock tables;
119connection master;
120drop table if exists t1,t2,t3,t4;
121drop temporary table temp_table;
122connection slave;
123End of 4.1 tests
124show binlog events in 'non existing_binlog_file';
125ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
126purge master logs before now();
127show binlog events in '';
128ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
129purge master logs before now();
130End of 5.0 tests
131#cleanup
132include/stop_slave.inc
133reset slave all;
134