~ubuntu-branches/ubuntu/trusty/mysql-5.6/trusty

« back to all changes in this revision

Viewing changes to mysql-test/suite/innodb/t/innodb-wl5980-debug.test

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-02-12 11:54:27 UTC
  • Revision ID: package-import@ubuntu.com-20140212115427-oq6tfsqxl1wuwehi
Tags: upstream-5.6.15
ImportĀ upstreamĀ versionĀ 5.6.15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# This testcase is to check the various debug injection points
 
3
# to make sure error conditions react corectly and acheive
 
4
# better code coverage.
 
5
#
 
6
 
 
7
# Not supported in embedded
 
8
--source include/not_embedded.inc
 
9
 
 
10
# the DBUG_EXECUTE_IF() macro needs a debug server.
 
11
--source include/have_debug.inc
 
12
 
 
13
-- source include/have_innodb.inc
 
14
 
 
15
--disable_query_log
 
16
# These values can change during the test
 
17
LET $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
 
18
 
 
19
# These messages are expected in the log
 
20
call mtr.add_suppression("Cannot find space id [0-9]+ in the tablespace memory cache");
 
21
call mtr.add_suppression("Cannot rename table 'test/t1' to 'test/t2' since the dictionary cache already contains 'test/t2'.");
 
22
 
 
23
# Set up some variables
 
24
LET $MYSQL_DATA_DIR = `select @@datadir`;
 
25
LET $data_directory_clause = DATA DIRECTORY='$MYSQL_TMP_DIR/alt_dir';
 
26
--enable_query_log
 
27
 
 
28
SET GLOBAL innodb_file_per_table=ON;
 
29
 
 
30
--echo #
 
31
--echo # WL5980 Remote tablespace debug error injection tests.
 
32
--echo #
 
33
 
 
34
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
 
35
eval CREATE TABLE t1 (a int KEY, b text) ENGINE=Innodb $data_directory_clause ;
 
36
INSERT INTO t1 VALUES (1, "tablespace");
 
37
SELECT * FROM t1;
 
38
 
 
39
 
 
40
--echo #
 
41
--echo # Test the first injection point in fil_rename_tablespace().
 
42
--echo # Make sure the table is useable after this failure.
 
43
--echo #
 
44
SET SESSION debug="+d,fil_rename_tablespace_failure_1";
 
45
--disable_result_log
 
46
--error ER_ERROR_ON_RENAME
 
47
RENAME TABLE t1 TO t2;
 
48
--enable_result_log
 
49
SET SESSION debug="-d,fil_rename_tablespace_failure_1";
 
50
INSERT INTO t1 VALUES (2, "tablespace");
 
51
SELECT * FROM t1;
 
52
 
 
53
--echo #
 
54
--echo # Test the second injection point in fil_rename_tablespace().
 
55
--echo # Make sure the table is useable after this failure.
 
56
--echo #
 
57
SET SESSION debug="+d,fil_rename_tablespace_failure_2";
 
58
--disable_result_log
 
59
--error ER_ERROR_ON_RENAME
 
60
RENAME TABLE t1 TO t2;
 
61
--enable_result_log
 
62
SET SESSION debug="-d,fil_rename_tablespace_failure_2";
 
63
INSERT INTO t1 VALUES (3, "tablespace");
 
64
SELECT * FROM t1;
 
65
 
 
66
--echo #
 
67
--echo # Test the injection point in dict_table_rename_in_cache().
 
68
--echo # Make sure the table is useable after this failure.
 
69
--echo #
 
70
SET SESSION debug="+d,dict_table_rename_in_cache_failure";
 
71
--disable_result_log
 
72
--error ER_ERROR_ON_RENAME
 
73
RENAME TABLE t1 TO t2;
 
74
--enable_result_log
 
75
SET SESSION debug="-d,dict_table_rename_in_cache_failure";
 
76
INSERT INTO t1 VALUES (4, "tablespace");
 
77
SELECT * FROM t1;
 
78
 
 
79
--echo #
 
80
--echo # Cleanup
 
81
--echo #
 
82
 
 
83
DROP TABLE t1;
 
84
 
 
85
--rmdir $MYSQL_TMP_DIR/alt_dir/test
 
86
--rmdir $MYSQL_TMP_DIR/alt_dir
 
87
 
 
88
-- disable_query_log
 
89
eval set global innodb_file_per_table=$innodb_file_per_table_orig;
 
90
-- enable_query_log
 
91