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/not_group_replication_plugin.inc
20 source include/have_binlog_format_statement.inc;
21 source include/master-slave.inc;
22
23
24 --echo ==== Create a big file ====
25
26 # We turn off binlogging to avoid too much noise in the binlog. t1 is
27 # just an auxiliary construction anyways, it is not needed on the
28 # slave.
29
30 --disable_query_log
31 SET @@sql_log_bin= 0;
32
33 let $rows= 5000;
34 create table t1 (id int not null primary key auto_increment);
35
36 while($rows)
37 {
38 eval insert into t1 values (null);
39 dec $rows;
40 }
41 eval select * into outfile '$MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' from t1;
42
43 DROP TABLE t1;
44 SET @@sql_log_bin= 1;
45 --enable_query_log
46
47
48 --echo ==== Load our big file into a table ====
49 create table t2 (id int not null primary key auto_increment);
50
51 select @@session.read_buffer_size - @@session.max_allowed_packet > 0 ;
52
53 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
54 eval load data infile '$MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' into table t2;
55 select count(*) from t2 /* 5 000 */;
56
57 # the binlog will show fragmented Append_block events
58 --let $mask_binlog_commit_events= 1
59 source include/show_binlog_events.inc;
60 --let $mask_binlog_commit_events= 0
61
62
63 --echo ==== Verify results on slave ====
64
65 --echo [on slave]
66 --source include/sync_slave_sql_with_master.inc
67 select count(*) from t2 /* 5 000 */;
68
69
70 --echo ==== Clean up ====
71
72 --echo [on master]
73 connection master;
74 drop table t2;
75 --source include/sync_slave_sql_with_master.inc
76 remove_file $MYSQLTEST_VARDIR/tmp/bug30435_5k.txt;
77 --source include/rpl_end.inc