1
source include/have_ssl_communication.inc;
2
source include/master-slave.inc;
4
# create a user for replication that requires ssl encryption
6
grant replication slave on *.* to replssl@localhost require ssl;
7
create table t1 (t int auto_increment, KEY(t));
9
sync_slave_with_master;
11
# Set slave to use SSL for connection to master
13
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
15
master_user='replssl',
18
master_ssl_ca ='$MYSQL_TEST_DIR/std_data/cacert.pem',
19
master_ssl_cert='$MYSQL_TEST_DIR/std_data/client-cert.pem',
20
master_ssl_key='$MYSQL_TEST_DIR/std_data/client-key.pem';
23
# Switch to master and insert one record, then sync it to slave
25
insert into t1 values(1);
26
sync_slave_with_master;
28
# The record should now be on slave
31
# The slave is synced and waiting/reading from master
32
# SHOW SLAVE STATUS will show "Waiting for master to send event"
33
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT
34
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
35
query_vertical show slave status;
37
# Stop the slave, as reported in bug#21871 it would hang
42
# Do the same thing a number of times
45
# 2007-11-27 mats Bug #32756 Starting and stopping the slave in a loop can lose rows
46
# After discussions with Engineering, I'm disabling this part of the test to avoid it causing
54
insert into t1 values (NULL);
55
select * from t1; # Some variance
57
select * from t1; # Some variance
66
# INSERT one more record to make sure
67
# the sync has something to do
68
insert into t1 values (NULL);
69
let $master_count= `select count(*) from t1`;
71
sync_slave_with_master;
72
--source include/wait_for_slave_to_start.inc
73
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT
74
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
75
query_vertical show slave status;
77
let $slave_count= `select count(*) from t1`;
79
if (`select $slave_count != $master_count`)
81
echo master and slave differed in number of rows;
82
echo master: $master_count;
83
echo slave: $slave_count;
93
query_vertical show slave status;
97
drop user replssl@localhost;
99
sync_slave_with_master;
101
--echo End of 5.0 tests