Debian Codegraph @

mysql-test/suite/rpl/t/rpl_loaddata_map.test

raw
1 # ==== Purpose ====
2 #
3 # check replication of load data with the server parameters subjected to
4 # read_buffer_size > max_allowed_packet
5 #
6 # ==== Implementation ====
7 #
8 # Insert many rows into t1, write t1 to file.
9 # Load the file into t2.
10 # See that t2 came out as expected on slave.
11 #
12 # ==== Related Bugs ====
13 #
14 # BUG#30435 loading large LOAD DATA INFILE breaks slave with
15 # read_buffer_size set on master
16 # BUG#33413 show binlog events fails if binlog has event size of close
17 # to max_allowed_packet
18
19 source include/have_binlog_format_statement.inc;
20 source include/master-slave.inc;
21
22
23 --echo ==== Create a big file ====
24
25 # We turn off binlogging to avoid too much noise in the binlog. t1 is
26 # just an auxiliary construction anyways, it is not needed on the
27 # slave.
28
29 SET @@sql_log_bin= 0;
30
31 create table t1 (id int not null primary key auto_increment);
32
33 --disable_query_log
34 let $rows= 5000;
35 while($rows)
36 {
37 eval insert into t1 values (null);
38 dec $rows;
39 }
40 --enable_query_log
41 evalp select * into outfile '$MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' from t1;
42
43 DROP TABLE t1;
44 SET @@sql_log_bin= 1;
45
46
47 --echo ==== Load our big file into a table ====
48 create table t2 (id int not null primary key auto_increment);
49
50 select @@session.read_buffer_size - @@session.max_allowed_packet > 0 ;
51
52 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
53 eval load data infile '$MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' into table t2;
54 select count(*) from t2 /* 5 000 */;
55
56 # the binlog will show fragmented Append_block events
57 source include/show_binlog_events.inc;
58
59
60 --echo ==== Verify results on slave ====
61
62 sync_slave_with_master;
63 select count(*) from t2 /* 5 000 */;
64
65
66 --echo ==== Clean up ====
67
68 connection master;
69 drop table t2;
70 sync_slave_with_master;
71 remove_file $MYSQLTEST_VARDIR/tmp/bug30435_5k.txt;
72 --source include/rpl_end.inc