Debian Codegraph @

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

raw
1 ##########################################################################
2 # This test verifies if a slave is able to process a "LOAD DATA INFILE"
3 # event while the "--secure-file-priv" option is set.
4 #
5 # The test is divided in two steps:
6 # 1 - Creates tables and populates them through "LOAD DATA INFILE".
7 # 2 - Compares the master and slave.
8 #
9 # === References ===
10 # Bug#28541204 SECURE-FILE-PRIV BREAKS LOAD DATA INFILE REPLICATION IN
11 # STATEMENT MODE ON 5.7.23
12 ##########################################################################
13
14 --source include/force_myisam_default.inc
15 --source include/have_myisam.inc
16 # This test does not work with var being a softlink.
17 --source include/not_var_link.inc
18 --source include/have_binlog_format_statement.inc
19 --source include/master-slave.inc
20
21 # Bug#28541204 SECURE-FILE-PRIV BREAKS LOAD DATA INFILE REPLICATION IN
22 # STATEMENT MODE ON 5.7.23
23
24 --echo # Restart the slave with a different secure path.
25 --source include/rpl_connection_slave.inc
26 --let $old_secure_file_path=`SELECT @@GLOBAL.secure_file_priv`
27 --let $datadir=`SELECT @@GLOBAL.datadir`
28 --let $include_silent=1
29 --let $rpl_server_number=2
30 --let $rpl_server_parameters=--secure-file-priv=$datadir
31 --source include/rpl_restart_server.inc
32 --let $include_silent=0
33
34 # Assert that @@GLOBAL.secure_file_priv equals @@GLOBAL.datadir
35 --let $assert_text= Datadir is the new secure file path
36 --let $assert_cond= "[SELECT @@GLOBAL.secure_file_priv]" = "[SELECT @@GLOBAL.datadir]"
37 --source include/assert.inc
38 --source include/start_slave.inc
39
40 ##########################################################################
41 # Loading data
42 ##########################################################################
43 --source include/rpl_connection_master.inc
44
45 create table t1(a int not null auto_increment, b int, primary key(a)) engine=myisam;
46
47 load data infile '../../std_data/rpl_loaddata.dat' into table t1;
48
49 ##########################################################################
50 # Checking Consistency
51 ##########################################################################
52 --source include/sync_slave_sql_with_master.inc
53
54 --echo # Restore the old secure path on slave.
55 --let $include_silent=1
56 --let $rpl_server_number=2
57 --let $rpl_server_parameters=--secure-file-priv=$old_secure_file_path
58 --source include/rpl_restart_server.inc
59 --let $include_silent=0
60
61 # Assert that @@GLOBAL.secure_file_priv is restored.
62 --let $assert_text= Old secure file path is restored.
63 --let $assert_cond= "[SELECT @@GLOBAL.secure_file_priv]" = "$old_secure_file_path"
64 --source include/assert.inc
65
66 --source include/start_slave.inc
67
68 let $diff_tables= master:t1, slave:t1;
69 source include/diff_tables.inc;
70
71 ##########################################################################
72 # Clean up
73 ##########################################################################
74 --source include/rpl_connection_master.inc
75
76 drop table t1;
77
78 --source include/sync_slave_sql_with_master.inc
79 --source include/rpl_end.inc