1source include/have_log_bin.inc; 2 3############################################################################### 4# Begin the functionality testing of max_binlog_size # 5############################################################################### 6--disable_warnings 7DROP TABLE IF EXISTS t1; 8--enable_warnings 9 10#============================================================== 11--echo '--- check if log file is rotated after 4096 bytes ----' 12#============================================================== 13 14SET @saved_max_binlog_size= @@global.max_binlog_size; 15SET @@global.max_binlog_size = 4096; 16CREATE TABLE t1(a CHAR(5)); 17 18# around 50 records are required to rotate bin log 19let $a = 50; 20--disable_query_log 21while ($a){ 22INSERT INTO t1 VALUES ('mysql'); 23dec $a; 24} 25--enable_query_log 26SELECT COUNT(*) FROM t1; 27 28# if log file is not created then this will fail 29let $MYSQLD_DATADIR=`select @@datadir`; 30--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR 31--file_exists $MYSQLD_DATADIR/mylog.000002 32 33--echo 'mylog.000002 exists' 34 35SET @@global.max_binlog_size= @saved_max_binlog_size; 36 37DROP TABLE t1; 38 39############################################################################### 40# End of functionality testing for max_binlog_size # 41############################################################################### 42 43