-
Notifications
You must be signed in to change notification settings - Fork 4k
/
Copy pathbug12368203.test
165 lines (128 loc) · 5.74 KB
/
bug12368203.test
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
#
# [ Based on ./suite/rpl/t/rpl_flush_logs.test ]
# This test verifies if the 'flush individual logs' command
# works fine with mysqladmin.
#
--source include/rpl/init_source_replica.inc
--source include/have_binlog_format_row.inc
connection master;
#
# Test 'flush-logs error' command.
#
--echo # Test if mysqladmin supports 'flush-logs error' command.
--exec $MYSQLADMIN --no-defaults -u root -S $MASTER_MYSOCK -P $MASTER_MYPORT flush-logs error
file_exists $MYSQLTEST_VARDIR/tmp/master_log.err;
--echo # Make sure binary logs were not flushed
--echo # after execute 'flush error logs' statement.
--error 1
file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000002;
--source include/rpl/sync_to_replica.inc
--echo # Make sure relay logs were not flushed
--echo # after execute 'flush error logs' statement.
--error 1
file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000003;
connection master;
#
# Test 'flush-logs relay' command.
#
--echo # Test if mysqladmin supports 'flush-logs relay' command.
--exec $MYSQLADMIN --no-defaults -u root -S $MASTER_MYSOCK -P $MASTER_MYPORT flush-logs relay
--source include/rpl/sync_to_replica.inc
--echo # Check if 'slave-relay-bin.000003' file is created
--echo # after executing 'flush-logs relay' command.
file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000003;
connection master;
--echo # Make sure binary logs were not flushed
--echo # after executeing 'flush-logs relay' command.
--error 1
file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000002;
#
# Test 'flush-logs slow' command.
#
--echo # Test if mysqladmin supports 'flush-logs slow' command.
--exec $MYSQLADMIN --no-defaults -u root -S $MASTER_MYSOCK -P $MASTER_MYPORT flush-logs slow
--echo # Make sure binary logs were not be flushed
--echo # after executing 'flush-logs slow' command.
--error 1
file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000002;
#
# Test 'flush-logs general' command.
#
--echo # Test if mysqladmin supports 'flush-logs general' command.
--exec $MYSQLADMIN --no-defaults -u root -S $MASTER_MYSOCK -P $MASTER_MYPORT flush-logs general
--echo # Make sure binary logs were not flushed
--echo # after execute 'flush-logs general' command.
--error 1
file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000002;
#
# Test 'flush-logs engine' command.
#
--echo # Test if mysqladmin supports 'flush-logs engine' command.
--exec $MYSQLADMIN --no-defaults -u root -S $MASTER_MYSOCK -P $MASTER_MYPORT flush-logs engine
--echo # Make sure binary logs were not flushed
--echo # after execute 'flush-logs engine' statement.
--error 1
file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000002;
#
# Test 'flush-logs binary' command.
#
--echo # Make sure the 'master-bin.000002' file does not
--echo # exist before execution of 'flush-logs binary' command.
--error 1
file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000002;
--echo # Test if mysqladmin supports 'flush-logs binary' command.
--exec $MYSQLADMIN --no-defaults -u root -S $MASTER_MYSOCK -P $MASTER_MYPORT flush-logs binary
--echo # Check if 'master-bin.000002' file is created
--echo # after execution of 'flush-logs binary' statement.
file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000002;
file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000001;
# Test 'flush error logs, relay logs' statement
--source include/rpl/sync_to_replica.inc
--echo # Make sure the 'slave-relay-bin.000006' file does not exist
--echo # exist before execute 'flush error logs, relay logs' statement.
--error 1
file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000006;
connection master;
--echo # Test if mysqladmin support combining multiple kinds of logs into one statement.
--exec $MYSQLADMIN --no-defaults -u root -S $MASTER_MYSOCK -P $MASTER_MYPORT flush-logs error relay
file_exists $MYSQLTEST_VARDIR/tmp/master_log.err;
--echo # Make sure binary logs were not flushed
--echo # after execute 'flush error logs, relay logs' statement.
--error 1
file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000003;
--source include/rpl/sync_to_replica.inc
--echo # Check the 'slave-relay-bin.000006' file is created after
--echo # execute 'flush error logs, relay logs' statement.
file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000006;
#
# Test 'flush-logs' command
#
--echo # Make sure the 'slave-relay-bin.000007' and 'slave-relay-bin.000008'
--echo # files do not exist before execute 'flush error logs, relay logs'
--echo # statement.
--error 1
file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000007;
--error 1
file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000008;
--source include/rpl/stop_applier.inc
connection master;
--echo # Test if 'flush-logs' command works fine and flush all the logs.
--exec $MYSQLADMIN --no-defaults -u root -S $MASTER_MYSOCK -P $MASTER_MYPORT flush-logs
file_exists $MYSQLTEST_VARDIR/tmp/master_log.err;
--echo # Check 'master-bin.000003' is created
--echo # after executing 'flush-logs' command.
file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000003;
--source include/rpl/sync_to_replica_received.inc
--echo # Check the 'slave-relay-bin.000007' and 'slave-relay-bin.000008'
--echo # files are created after execute 'flush logs' statement.
file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000007;
file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000008;
--source include/rpl/start_applier.inc
--source include/rpl/deinit.inc
--echo # Test multiple options to flush-logs
--echo # Must work
--exec $MYSQLADMIN --no-defaults -u root -S $MASTER_MYSOCK -P $MASTER_MYPORT flush-logs binary error ping
--echo # Must work
--exec $MYSQLADMIN --no-defaults -u root -S $MASTER_MYSOCK -P $MASTER_MYPORT flush-logs ping
--error 1
--exec $MYSQLADMIN --no-defaults -u root -S $MASTER_MYSOCK -P $MASTER_MYPORT flush-logs pong 2>&1