File: rpl_slave_load_remove_tmpfile.test

package info (click to toggle)
mariadb-10.0 10.0.32-0%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 476,064 kB
  • sloc: cpp: 1,400,131; ansic: 832,140; perl: 54,391; sh: 41,304; pascal: 32,365; yacc: 14,921; xml: 5,257; sql: 4,667; cs: 4,647; makefile: 4,555; ruby: 4,465; python: 2,292; lex: 1,427; java: 941; asm: 295; awk: 54; php: 22; sed: 16
file content (80 lines) | stat: -rw-r--r-- 2,634 bytes parent folder | download | duplicates (4)
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
80
# ==== Purpose ====
#
# This test verifies if the slave fails gracefully when the temporary 
# file used to load data is removed while it is about to be used. 
# Similar errors are caught if the temporary directory is removed.
#
# ==== Implementation ====
#
# Steps:
#    0 - Set debug variable remove_slave_load_file_before_write. This
#        causes the slave to remove the file.
#    1 - Creates a table and populates it through "LOAD DATA INFILE".
#    2 - Catches error.
#
# ==== References ====
#
# BUG#42861: Assigning invalid directories to --slave-load-tmpdir crashes the slave
# BUG#11872422: rpl_slave_load_remove_tmpfile fails sporadically in pb2

--source include/have_binlog_format_statement.inc
--source include/have_innodb.inc
--source include/have_debug.inc
--source include/master-slave.inc
--source include/not_embedded.inc
--source include/not_var_link.inc

##########################################################################
#                            Loading data
##########################################################################

connection slave;
--let $old_debug= `SELECT @@global.debug_dbug`
SET @@global.debug_dbug= '+d,remove_slave_load_file_before_write';

connection master;

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

start transaction;
  insert into t1(b) values (1);
  insert into t1(b) values (2);
  load data infile '../../std_data/rpl_loaddata.dat' into table t1;
commit;

##########################################################################
#                            Catch Error
##########################################################################
connection slave;

# windows and linux different error numbers here:
# Windows:
#  - Last_Errno     29 (File not found)
# Unix like OS: 
#  - Last_Errno      13 (Can't stat file)
--let $slave_sql_errno= 29, 13
--source include/wait_for_slave_sql_error.inc

##########################################################################
#                             Clean up
##########################################################################
connection master;

drop table t1;

--source include/sync_slave_io_with_master.inc
--source include/stop_slave_io.inc
RESET SLAVE;

drop table t1;

call mtr.add_suppression("Slave: Can't get stat of .*");
call mtr.add_suppression("Slave SQL: Error .Can.t get stat of.* error.* 13");
call mtr.add_suppression("Slave: File.* not found.*");
call mtr.add_suppression("Slave SQL: Error .File.* not found.* error.* 29");
--let $rpl_only_running_threads= 1

eval SET @@global.debug_dbug= '$old_debug';

--source include/rpl_end.inc