| 1 |
# ==== Purpose ==== |
| 2 |
# Test mysqlbinlog with a binlog event larger than 128kb. |
| 3 |
# using have_binlog_format_statement to create a statement |
| 4 |
# based binlog event greater than 128kb. The idea is to insert |
| 5 |
# a big string in a table having a BLOB column. |
| 6 |
# |
| 7 |
# === Implementaion === |
| 8 |
-- source include/have_binlog_format_statement.inc |
| 9 |
|
| 10 |
# Reset master to cleanup binlog |
| 11 |
RESET MASTER; |
| 12 |
|
| 13 |
# we need this for getting fixed timestamps inside of this test |
| 14 |
SET timestamp=1000000000; |
| 15 |
|
| 16 |
--disable_warnings |
| 17 |
DROP TABLE IF EXISTS t2; |
| 18 |
--enable_warnings |
| 19 |
|
| 20 |
let $MYSQLD_DATADIR=`select @@datadir`; |
| 21 |
CREATE TABLE t2 (word LONGBLOB); |
| 22 |
let $i = 53000; |
| 23 |
--disable_query_log |
| 24 |
SET @string = 'testing '; |
| 25 |
while($i > 0) |
| 26 |
{ |
| 27 |
SET @string = CONCAT(@string, 'testing '); |
| 28 |
dec $i; |
| 29 |
} |
| 30 |
|
| 31 |
INSERT INTO t2 VALUES(@string); |
| 32 |
--enable_query_log |
| 33 |
let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1); |
| 34 |
FLUSH LOGS; |
| 35 |
|
| 36 |
--replace_regex /SQL_LOAD_MB-[a-f0-9]-[a-f0-9]/SQL_LOAD_MB-#-#/ |
| 37 |
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR |
| 38 |
|
| 39 |
--let _BINLOG_FILE= $MYSQLD_DATADIR/$binlog_file |
| 40 |
--let _MYSQLBINLOG= $MYSQL_BINLOG |
| 41 |
# use this to find out which command to use 'cat' or 'type' |
| 42 |
--let _IS_WINDOWS = 0 |
| 43 |
if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) IN ('Win32', 'Win64', 'Windows')`) |
| 44 |
{ |
| 45 |
--let _IS_WINDOWS= 1 |
| 46 |
} |
| 47 |
--perl |
| 48 |
use strict; |
| 49 |
use warnings; |
| 50 |
my $binlog_file_perl = $ENV{'_BINLOG_FILE'}; |
| 51 |
my $mysqlbinlog = $ENV{'_MYSQLBINLOG'}; |
| 52 |
my $is_windows = $ENV{'_IS_WINDOWS'}; |
| 53 |
|
| 54 |
if ($is_windows) |
| 55 |
{ |
| 56 |
$binlog_file_perl =~ tr{/}{\\}; |
| 57 |
my $result = `type $binlog_file_perl | $mysqlbinlog --short-form -`; |
| 58 |
} |
| 59 |
else |
| 60 |
{ |
| 61 |
my $result = `cat $binlog_file_perl | $mysqlbinlog --short-form - `; |
| 62 |
} |
| 63 |
EOF |
| 64 |
|
| 65 |
DROP TABLE t2; |