summaryrefslogtreecommitdiff
path: root/mysql-test/t/binlog_index.test
blob: 1e44a9b02e206b220fdd2b2dd6a3d16b0884f8d1 (plain)
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
#
# testing of purging of binary log files bug#18199/Bug#18453
#
source include/have_log_bin.inc;
source include/not_embedded.inc;

#
# testing purge binary logs TO
#

flush logs;
flush logs;
flush logs;

source include/show_binary_logs.inc;

remove_file $MYSQLTEST_VARDIR/log/master-bin.000001;

# there must be a warning with file names
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
purge binary logs TO 'master-bin.000004';

--echo *** must show a list starting from the 'TO' argument of PURGE ***
source include/show_binary_logs.inc;

#
# testing purge binary logs BEFORE
#

reset master;

flush logs;
flush logs;
flush logs;
remove_file $MYSQLTEST_VARDIR/log/master-bin.000001;

--echo *** must be a warning master-bin.000001 was not found ***
let $date=`select NOW()  +  INTERVAL 1 MINUTE`;
--disable_query_log
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval purge binary logs BEFORE '$date';
--enable_query_log

--echo *** must show one record, of the active binlog, left in the index file after PURGE ***
source include/show_binary_logs.inc;

#
# testing a fatal error
# Turning a binlog file into a directory must be a portable setup
# 

reset master;

flush logs;
flush logs;
flush logs;

remove_file $MYSQLTEST_VARDIR/log/master-bin.000001;
mkdir $MYSQLTEST_VARDIR/log/master-bin.000001;

--error ER_BINLOG_PURGE_FATAL_ERR
purge binary logs TO 'master-bin.000002';
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
show warnings;
rmdir $MYSQLTEST_VARDIR/log/master-bin.000001;
--disable_warnings
reset master;
--enable_warnings
--echo End of tests