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