2
# testing of purging of binary log files bug#18199/Bug#18453
4
source include/have_log_bin.inc;
5
source include/not_embedded.inc;
8
# testing purge binary logs TO
15
source include/show_binary_logs.inc;
16
let $MYSQLD_DATADIR= `select @@datadir`;
17
remove_file $MYSQLD_DATADIR/master-bin.000001;
19
# there must be a warning with file names
20
replace_regex /\.[\\\/]master/master/;
21
purge binary logs TO 'master-bin.000004';
23
--echo *** must show a list starting from the 'TO' argument of PURGE ***
24
source include/show_binary_logs.inc;
27
# testing purge binary logs BEFORE
35
remove_file $MYSQLD_DATADIR/master-bin.000001;
37
--echo *** must be a warning master-bin.000001 was not found ***
38
let $date=`select NOW() + INTERVAL 1 MINUTE`;
40
replace_regex /\.[\\\/]master/master/;
41
eval purge binary logs BEFORE '$date';
44
--echo *** must show one record, of the active binlog, left in the index file after PURGE ***
45
source include/show_binary_logs.inc;
48
# testing a fatal error
49
# Turning a binlog file into a directory must be a portable setup
58
remove_file $MYSQLD_DATADIR/master-bin.000001;
59
mkdir $MYSQLD_DATADIR/master-bin.000001;
61
--error ER_BINLOG_PURGE_FATAL_ERR
62
purge binary logs TO 'master-bin.000002';
63
replace_regex /\.[\\\/]master/master/;
65
rmdir $MYSQLD_DATADIR/master-bin.000001;