File: upgrade_unknown_directory.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (72 lines) | stat: -rw-r--r-- 2,714 bytes parent folder | download
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
# ********************************************************************
# wl#13065 : Restrict All InnoDB Tablespaces To Known Directories
# ********************************************************************

--echo # This test upgrades tables from 5.7 to 8.0.x where
--echo # datafiles are not known directories.
--echo # a warning message will be put into the error log

--source include/have_debug.inc
--source include/not_valgrind.inc
--source include/have_case_sensitive_file_system.inc

--disable_query_log
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");
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");
--enable_query_log

--echo # Stop the running the server
--source include/shutdown_mysqld.inc

--echo ######################################################################
--echo # Unzip a 5.7 datadir with tables where datafiles are at
--echo # unknown directories
--echo # start the server using this directory
--echo ######################################################################

--echo ######################################################################
--echo # Copy and unzip the datadir.
--echo ######################################################################
--copy_file $MYSQLTEST_VARDIR/std_data/data57_unknown_dir.zip $MYSQL_TMP_DIR/data57_unknown_dir.zip
--file_exists $MYSQL_TMP_DIR/data57_unknown_dir.zip
--exec unzip -qo $MYSQL_TMP_DIR/data57_unknown_dir.zip -d $MYSQL_TMP_DIR
let $DATADIR = $MYSQL_TMP_DIR/datadir;

--echo # Restart the server against the unzipped datadir
--replace_result $DATADIR DATADIR
--let $restart_parameters = restart: --datadir=$DATADIR --innodb-page-size=16k
--let $wait_counter=3000
--source include/start_mysqld.inc

--echo # Verify tables after upgrade
USE test;
SHOW CREATE TABLE t1;
SHOW CREATE TABLE t2;
SHOW CREATE TABLE t3;
SELECT * FROM t1;
SELECT * FROM t2;
SELECT * FROM t3;

--echo # Run some DML statements
INSERT INTO t1 VALUES (207, "Tom", "Kim");
DELETE FROM t2 WHERE c1=337;
UPDATE t3 SET purchased='2001-01-31' WHERE id=6;

--echo # Verify results
SELECT * FROM t1;
SELECT * FROM t2;
SELECT * FROM t3;

--echo # Cleanup
--echo # Shutdown server
--source include/shutdown_mysqld.inc

--echo # Remove copied files
--file_exists $MYSQL_TMP_DIR/data57_unknown_dir.zip
--force-rmdir $MYSQL_TMP_DIR/datadir
--force-rmdir $MYSQL_TMP_DIR/unknown
--remove_file $MYSQL_TMP_DIR/data57_unknown_dir.zip

--echo # Resart the server
let $restart_parameters =;
--source include/start_mysqld.inc