Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port fix for mysqlbinlog reading big records from stdin
Summary: Fixed mysqlbinlog error when reading big records from stdin. When mysqlbinlog tries to read a big record (over 128KB) from stdin, the glibc read in my_read will return 128KB instead of the full size. This causes _my_b_read to fail. Ported the folowing change In mysqlbinlog.cc, enable MY_FULL_IO, and in my_read.c, fix the MY_FULL_IO logic. Test Plan: ported the test case which generates an event of size greater than greater than 128kb and runs mysqlbinlog. Reviewers: steaphan Reviewed By: steaphan
- Loading branch information
1 parent
f1c37d1
commit db9f9dd
Showing
5 changed files
with
88 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--force-restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# ==== Purpose ==== | ||
# Test mysqlbinlog with a binlog event larger than 128kb. | ||
# using have_binlog_format_statement to create a statement | ||
# based binlog event greater than 128kb. The idea is to insert | ||
# a big string in a table having a BLOB column. | ||
# | ||
# === Implementaion === | ||
|
||
-- source include/have_binlog_format_statement.inc | ||
|
||
# Reset master to cleanup binlog | ||
reset master; | ||
|
||
# we need this for getting fixed timestamps inside of this test | ||
set timestamp=1000000000; | ||
|
||
--disable_warnings | ||
drop table if exists t2; | ||
--enable_warnings | ||
|
||
let $MYSQLD_DATADIR=`select @@datadir`; | ||
create table t2 (word LONGBLOB); | ||
let $i = 33000; | ||
--disable_query_log | ||
set @string = 'testing '; | ||
while($i > 0) | ||
{ | ||
set @string = concat(@string, 'testing '); | ||
dec $i; | ||
} | ||
|
||
insert into t2 values(@string); | ||
--enable_query_log | ||
let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1); | ||
flush logs; | ||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR | ||
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ | ||
--exec cat $MYSQLD_DATADIR/$binlog_file | $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ - | ||
drop table t2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters