Debian Codegraph @

mysql-test/suite/innodb/t/skip_tablespace_path_validation.test

raw
1 # WL14008 InnoDB: Make tablespace filename validation optional via --skip-innodb-validate-tablespace-paths
2
3 let $MYSQLD_DATADIR = `SELECT @@datadir`;
4
5 --disable_query_log
6 CALL mtr.add_suppression("Tablespace .*, name 'test/t1', file '.*test.*t1.ibd' is missing!");
7 --enable_query_log
8
9 # Intentionally using a long and unlikely name to avoid collisions with a previous test case.
10 # We want to be able to check that the log does not contain an error message that the .ibd
11 # file is missing, this is simpler if other test cases do not cause the same error message.
12 CREATE TABLE t1 (id INT, PRIMARY KEY (id));
13
14 INSERT INTO t1(id) values(1);
15
16 --echo # Shut down mysqld and then move the t1.ibd file to a different directory.
17 --source include/shutdown_mysqld.inc
18 --move_file $MYSQLD_DATADIR/test/t1.ibd $MYSQL_TMP_DIR/t1.ibd
19
20
21 # When we skip validation mysqld will not detect any problems during startup even though
22 # the t1.ibd file is missing.
23 --echo # Restart without validation using --skip-innodb-validate-tablespace-paths
24
25 let SEARCH_FILE=$MYSQLTEST_VARDIR/log/skip_tablespace_path_validation.err;
26 --replace_result $SEARCH_FILE SEARCH_FILE
27
28 let $restart_parameters = restart:--skip-innodb-validate-tablespace-paths --log-error=$SEARCH_FILE;
29 --source include/start_mysqld.inc
30
31 let SEARCH_PATTERN=\[Note\] \[.*\] Skipping InnoDB tablespace path validation. Manually moved tablespace files will not be detected!;
32
33 --echo # Check for the skip validation warning in the log
34 --source include/search_pattern.inc
35
36 let SEARCH_PATTERN=\[Warning\] \[.*\] Tablespace .*, name 'test/t1', file '.*test.*t1.ibd' is missing!;
37 --echo # Ensure we didn't receive a warning about the missing t1.ibd file
38 --source include/search_pattern.inc
39
40
41 # Skip validation using the alternative syntax
42 --echo # Restart without validation using --innodb-validate-tablespace-paths=0
43 --replace_result $SEARCH_FILE SEARCH_FILE
44
45 let $restart_parameters = restart:--innodb-validate-tablespace-paths=0 --log-error=$SEARCH_FILE;
46 --source include/restart_mysqld.inc
47
48 let SEARCH_PATTERN=\[Note\] \[.*\] Skipping InnoDB tablespace path validation. Manually moved tablespace files will not be detected!;
49
50 --echo # Check for the skip validation warning in the log
51 --source include/search_pattern.inc
52
53 let SEARCH_PATTERN=\[Warning\] \[.*\] Tablespace .*, name 'test/t1', file '.*test.*t1.ibd' is missing!;
54 --echo # Ensure we didn't receive a warning about the missing t1.ibd file
55 --source include/search_pattern.inc
56
57 # Now when we restart the server with validation we will get an error that the t1.ibd file is missing.
58 --echo # Restart with validation
59 --replace_result $SEARCH_FILE SEARCH_FILE
60
61 let $restart_parameters = restart:--innodb-validate-tablespace-paths=1 --log-error=$SEARCH_FILE;
62 --source include/restart_mysqld.inc
63
64 --echo # Ensure the warning is visible now
65 --source include/search_pattern.inc
66
67 # Cleanup, move the ibd file back and drop table
68 --move_file $MYSQL_TMP_DIR/t1.ibd $MYSQLD_DATADIR/test/t1.ibd
69 drop table t1;
70 --remove_file $SEARCH_FILE
71 let $restart_parameters = restart:;
72 --source include/restart_mysqld.inc