Debian Codegraph @

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

raw
1 # ********************************************************************
2 # wl#13065 : Restrict All InnoDB Tablespaces To Known Directories
3 # ********************************************************************
4
5 --echo # This test upgrades tables from 5.7 to 8.0.x where
6 --echo # datafiles are not known directories.
7 --echo # a warning message will be put into the error log
8
9 --source include/have_debug.inc
10 --source include/not_valgrind.inc
11 --source include/have_case_sensitive_file_system.inc
12
13 --disable_query_log
14 call mtr.add_suppression("The datafile .* for tablespace .* is in an unprotected location. This file cannot be recovered after a crash until this location is added to innodb_directories");
15 call mtr.add_suppression("Unable to open partition file with new name .*. Please check if innodb_directories is set to include all external file paths");
16 --enable_query_log
17
18 --echo # Stop the running the server
19 --source include/shutdown_mysqld.inc
20
21 --echo ######################################################################
22 --echo # Unzip a 5.7 datadir with tables where datafiles are at
23 --echo # unknown directories
24 --echo # start the server using this directory
25 --echo ######################################################################
26
27 --echo ######################################################################
28 --echo # Copy and unzip the datadir.
29 --echo ######################################################################
30 --copy_file $MYSQLTEST_VARDIR/std_data/data57_unknown_dir.zip $MYSQL_TMP_DIR/data57_unknown_dir.zip
31 --file_exists $MYSQL_TMP_DIR/data57_unknown_dir.zip
32 --exec unzip -qo $MYSQL_TMP_DIR/data57_unknown_dir.zip -d $MYSQL_TMP_DIR
33 let $DATADIR = $MYSQL_TMP_DIR/datadir;
34
35 --echo # Restart the server against the unzipped datadir
36 --replace_result $DATADIR DATADIR
37 --let $restart_parameters = restart: --datadir=$DATADIR --innodb-page-size=16k
38 --let $wait_counter=3000
39 --source include/start_mysqld.inc
40
41 --echo # Verify tables after upgrade
42 USE test;
43 SHOW CREATE TABLE t1;
44 SHOW CREATE TABLE t2;
45 SHOW CREATE TABLE t3;
46 SELECT * FROM t1;
47 SELECT * FROM t2;
48 SELECT * FROM t3;
49
50 --echo # Run some DML statements
51 INSERT INTO t1 VALUES (207, "Tom", "Kim");
52 DELETE FROM t2 WHERE c1=337;
53 UPDATE t3 SET purchased='2001-01-31' WHERE id=6;
54
55 --echo # Verify results
56 SELECT * FROM t1;
57 SELECT * FROM t2;
58 SELECT * FROM t3;
59
60 --echo # Cleanup
61 --echo # Shutdown server
62 --source include/shutdown_mysqld.inc
63
64 --echo # Remove copied files
65 --file_exists $MYSQL_TMP_DIR/data57_unknown_dir.zip
66 --force-rmdir $MYSQL_TMP_DIR/datadir
67 --force-rmdir $MYSQL_TMP_DIR/unknown
68 --remove_file $MYSQL_TMP_DIR/data57_unknown_dir.zip
69
70 --echo # Resart the server
71 let $restart_parameters =;
72 --source include/start_mysqld.inc