summaryrefslogtreecommitdiff
path: root/mysql-test/t/rpl_max_binlog_size_func.test
blob: c00db582deb9af22274db2082e726a3274504050 (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
source include/have_log_bin.inc;

###############################################################################
# Begin the functionality testing of max_binlog_size                          #
###############################################################################
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings


#==============================================================
--echo '--- check if log file is rotated after 4096 bytes ----' 
#==============================================================

SET @saved_max_binlog_size= @@global.max_binlog_size;
SET @@global.max_binlog_size = 4096;
CREATE TABLE t1(a CHAR(5));

# around 50 records are required to rotate bin log
let $a = 50;
--disable_query_log
while ($a){
INSERT INTO t1 VALUES ('mysql');
dec $a;
}
--enable_query_log

--sleep 2

# if log file is not created then this will fail
let $MYSQLD_DATADIR=`select @@datadir`;
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
--file_exists $MYSQLD_DATADIR/mylog.000002

--echo 'mylog.000002 exists'

SET @@global.max_binlog_size= @saved_max_binlog_size;

DROP TABLE t1;

###############################################################################
# End of functionality testing for max_binlog_size                            #
###############################################################################