2008-07-18 13:34:19 +02:00
|
|
|
# ==== Purpose ====
|
2007-12-21 22:34:43 +02:00
|
|
|
#
|
|
|
|
# check replication of load data with the server parameters subjected to
|
|
|
|
# read_buffer_size > max_allowed_packet
|
|
|
|
#
|
2008-07-18 13:34:19 +02:00
|
|
|
# ==== Implementation ====
|
|
|
|
#
|
|
|
|
# Insert many rows into t1, write t1 to file.
|
|
|
|
# Load the file into t2.
|
|
|
|
# See that t2 came out as expected on slave.
|
|
|
|
#
|
|
|
|
# ==== Related Bugs ====
|
|
|
|
#
|
2007-12-21 22:34:43 +02:00
|
|
|
# BUG#30435 loading large LOAD DATA INFILE breaks slave with
|
|
|
|
# read_buffer_size set on master
|
|
|
|
# BUG#33413 show binlog events fails if binlog has event size of close
|
|
|
|
# to max_allowed_packet
|
|
|
|
|
2008-01-31 16:51:55 +08:00
|
|
|
source include/have_binlog_format_mixed_or_statement.inc;
|
2007-12-21 22:34:43 +02:00
|
|
|
source include/master-slave.inc;
|
2008-07-18 13:34:19 +02:00
|
|
|
|
|
|
|
|
|
|
|
--echo ==== Create a big file ====
|
|
|
|
|
|
|
|
# We turn off binlogging to avoid too much noise in the binlog. t1 is
|
|
|
|
# just an auxiliary construction anyways, it is not needed on the
|
|
|
|
# slave.
|
2007-12-21 22:34:43 +02:00
|
|
|
|
|
|
|
--disable_query_log
|
2008-07-18 13:34:19 +02:00
|
|
|
SET @@sql_log_bin= 0;
|
|
|
|
|
2007-12-21 22:34:43 +02:00
|
|
|
let $rows= 5000;
|
|
|
|
create table t1 (id int not null primary key auto_increment);
|
|
|
|
|
|
|
|
while($rows)
|
|
|
|
{
|
|
|
|
eval insert into t1 values (null);
|
|
|
|
dec $rows;
|
|
|
|
}
|
|
|
|
eval select * into outfile '$MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' from t1;
|
2008-07-18 13:34:19 +02:00
|
|
|
|
|
|
|
DROP TABLE t1;
|
|
|
|
SET @@sql_log_bin= 1;
|
2007-12-21 22:34:43 +02:00
|
|
|
--enable_query_log
|
|
|
|
|
2008-07-18 13:34:19 +02:00
|
|
|
|
|
|
|
--echo ==== Load our big file into a table ====
|
2007-12-21 22:34:43 +02:00
|
|
|
create table t2 (id int not null primary key auto_increment);
|
|
|
|
|
2007-12-23 11:18:46 +02:00
|
|
|
select @@session.read_buffer_size - @@session.max_allowed_packet > 0 ;
|
2007-12-21 22:34:43 +02:00
|
|
|
|
2007-12-22 19:59:47 +02:00
|
|
|
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
2007-12-21 22:34:43 +02:00
|
|
|
eval load data infile '$MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' into table t2;
|
|
|
|
select count(*) from t2 /* 5 000 */;
|
|
|
|
|
2008-07-18 13:34:19 +02:00
|
|
|
# the binlog will show fragmented Append_block events
|
|
|
|
source include/show_binlog_events.inc;
|
|
|
|
|
2007-12-21 22:34:43 +02:00
|
|
|
|
2008-07-18 13:34:19 +02:00
|
|
|
--echo ==== Verify results on slave ====
|
2007-12-21 22:34:43 +02:00
|
|
|
|
2008-07-18 13:34:19 +02:00
|
|
|
--echo [on slave]
|
2007-12-21 22:34:43 +02:00
|
|
|
sync_slave_with_master;
|
|
|
|
select count(*) from t2 /* 5 000 */;
|
|
|
|
|
2008-07-18 13:34:19 +02:00
|
|
|
|
|
|
|
--echo ==== Clean up ====
|
|
|
|
|
|
|
|
--echo [on master]
|
2007-12-21 22:34:43 +02:00
|
|
|
connection master;
|
2008-07-18 13:34:19 +02:00
|
|
|
drop table t2;
|
2007-12-21 22:34:43 +02:00
|
|
|
sync_slave_with_master;
|
|
|
|
remove_file $MYSQLTEST_VARDIR/tmp/bug30435_5k.txt;
|