File: rpl_slave_load_in_myisam.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (79 lines) | stat: -rw-r--r-- 3,081 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
##########################################################################
# This test verifies if a slave is able to process a "LOAD DATA INFILE"
# event while the "--secure-file-priv" option is set.
#
# The test is divided in two steps:
#    1 - Creates tables and populates them through "LOAD DATA INFILE".
#    2 - Compares the master and slave.
#
# === References ===
# Bug#28541204 SECURE-FILE-PRIV BREAKS LOAD DATA INFILE REPLICATION IN
#              STATEMENT MODE ON 5.7.23
##########################################################################

--source include/force_myisam_default.inc
--source include/have_myisam.inc
# This test does not work with var being a softlink.
--source include/not_var_link.inc
--source include/have_binlog_format_statement.inc
--source include/master-slave.inc

# Bug#28541204 SECURE-FILE-PRIV BREAKS LOAD DATA INFILE REPLICATION IN
#              STATEMENT MODE ON 5.7.23

--echo # Restart the slave with a different secure path.
--source include/rpl_connection_slave.inc
--let $old_secure_file_path=`SELECT @@GLOBAL.secure_file_priv`
--let $datadir=`SELECT @@GLOBAL.datadir`
--let $include_silent=1
--let $rpl_server_number=2
--let $rpl_server_parameters=--secure-file-priv=$datadir
--source include/rpl_restart_server.inc
--let $include_silent=0

# Assert that @@GLOBAL.secure_file_priv equals @@GLOBAL.datadir
--let $assert_text= Datadir is the new secure file path
--let $assert_cond= "[SELECT @@GLOBAL.secure_file_priv]" = "[SELECT @@GLOBAL.datadir]"
--source include/assert.inc
--source include/start_slave.inc

##########################################################################
#                            Loading data
##########################################################################
--source include/rpl_connection_master.inc

create table t1(a int not null auto_increment, b int, primary key(a)) engine=myisam;

load data infile '../../std_data/rpl_loaddata.dat' into table t1;

##########################################################################
#                       Checking Consistency
##########################################################################
--source include/sync_slave_sql_with_master.inc

--echo # Restore the old secure path on slave.
--let $include_silent=1
--let $rpl_server_number=2
--let $rpl_server_parameters=--secure-file-priv=$old_secure_file_path
--source include/rpl_restart_server.inc
--let $include_silent=0

# Assert that @@GLOBAL.secure_file_priv is restored.
--let $assert_text= Old secure file path is restored.
--let $assert_cond= "[SELECT @@GLOBAL.secure_file_priv]" = "$old_secure_file_path"
--source include/assert.inc

--source include/start_slave.inc

let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;

##########################################################################
#                             Clean up
##########################################################################
--source include/rpl_connection_master.inc

drop table t1;

--source include/sync_slave_sql_with_master.inc
--source include/rpl_end.inc