File: dd_upgrade_partition.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 (142 lines) | stat: -rw-r--r-- 6,435 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
--echo #
--echo # Bug#25153261 : SEG FAULT IN UPGRADING PARTITIONED TABLE
--echo #

# This test contains zipped 5.7 data directory with innodb partitioned tables.
# Innodb does not recognizes partition table created in linux from windows
# due to difference in path format.
--source include/not_windows.inc
--source include/not_valgrind.inc

--disable_query_log
call mtr.add_suppression("Resizing redo log from");
call mtr.add_suppression("Redo log has been requested to resize");
call mtr.add_suppression("Upgrading redo log");
call mtr.add_suppression("Starting to delete and rewrite redo log files");
call mtr.add_suppression("New redo log files created");
call mtr.add_suppression("Unknown system variable 'show_compatibility_56'");
call mtr.add_suppression("You need to use --log-bin to make --binlog-format work");
call mtr.add_suppression("Creating routine without parsing routine body");
call mtr.add_suppression("Resolving dependency for the view");
call mtr.add_suppression("references invalid");
call mtr.add_suppression("doesn't exist");
call mtr.add_suppression("information_schema");
call mtr.add_suppression("Storage engine '.*' does not support system tables. \\[mysql.*\\]");
call mtr.add_suppression("Table 'mysql.component' doesn't exist");
call mtr.add_suppression("is expected to be transactional");
call mtr.add_suppression("table is missing or has an incorrect definition");
call mtr.add_suppression("ACL DDLs will not work unless mysql_upgrade is executed");
call mtr.add_suppression(".* Native table .* has the wrong structure");
call mtr.add_suppression("Column count of mysql.* is wrong");
call mtr.add_suppression("Column count of performance_schema.events_statements_summary_by_digest is wrong.*");
call mtr.add_suppression("The privilege system failed to initialize correctly.*");
call mtr.add_suppression(".*The system table mysql.global_grants is missing.*");
# InnoDB reports "Lock wait timeout" warnings when it tries to drop persistent
# statistics while persistent statistics table is altered during upgrade.
# This issue doesn't seem to cause any further trouble (as there is no persistent
# stats for persistent stats table anyway), so we ignore these warnings here.
call mtr.add_suppression("Unable to delete statistics for table mysql.");
# new fields were added to these tables
call mtr.add_suppression("Column count of performance_schema.replication_group_members is wrong. Expected 7, found 5.*");
call mtr.add_suppression("Column count of performance_schema.replication_group_member_stats is wrong. Expected 13, found 9.*");
call mtr.add_suppression("Column count of performance_schema.threads is wrong. Expected 18, found 17.*");
call mtr.add_suppression("ACL table mysql.[a-zA-Z_]* missing. Some operations may fail.");
call mtr.add_suppression("Info table is not ready to be used. Table 'mysql.slave_master_info' cannot be opened");
call mtr.add_suppression("Error in checking mysql.slave_master_info repository info type of TABLE");
call mtr.add_suppression("Error creating connection metadata: Error checking repositories.");
call mtr.add_suppression("Replica: Failed to initialize the connection metadata structure for channel");
call mtr.add_suppression("Failed to create or recover replication info repositories.");
--enable_query_log

#########################
#  how to record this test JSON result content mismatch
#  If required fix regex patterns in mysql-test/include/ibd2sdi.pl
#  and mysql-test/suite/innodb/include/ibd2sdi_replace_pattern.inc,
#  then run the test with --record option.
#########################

--echo # Set different paths for --datadir
let $MYSQLD_DATADIR1 = $MYSQL_TMP_DIR/data57_partition;

--echo # Copy the remote tablespace & DB zip files from suite location to working location.
--copy_file $MYSQLTEST_VARDIR/std_data/data57_partition.zip $MYSQL_TMP_DIR/data57_partition.zip

--echo # Check that the file exists in the working folder.
--file_exists $MYSQL_TMP_DIR/data57_partition.zip

--echo # Unzip the zip file.
--exec unzip -qo $MYSQL_TMP_DIR/data57_partition.zip -d $MYSQL_TMP_DIR

--let $MYSQLD_DATADIR=`SELECT @@datadir`

--echo # Stop DB server which was created by MTR default
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server
--source include/wait_until_disconnected.inc

--echo # Create a bootstrap file in temp location
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
--exec echo $MYSQL_TMP_DIR/bootstrap.log

--echo # Start the server. Without fix, there is a segmentation fault in this step.
--exec echo "restart: --loose-skip-log-bin --skip-log-replica-updates --datadir=$MYSQLD_DATADIR1" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect
--let $wait_counter= 6000
--source include/wait_until_connected_again.inc

SHOW CREATE TABLE partitions.t1;

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

--echo # Check if .ibds have SDI after upgrade

--let $SRC_DIR=$MYSQL_TEST_DIR/std_data/dd/sdi/upgrade_partition

# Create a directory to store json generated
--let $DEST_DIR=$MYSQL_TMP_DIR/sdi_dest/
--error 0,1
--force-rmdir $DEST_DIR
--mkdir $DEST_DIR

--echo # Check SDI from sys_config.ibd
--let JSON_FILE_PATH = $DEST_DIR/sys_config.json
--exec $IBD2SDI $MYSQLD_DATADIR1/sys/sys_config.ibd -d $JSON_FILE_PATH 2>&1
--source suite/innodb/include/ibd2sdi_replace.inc
if ($MTR_RECORD == 0) {
--diff_files $SRC_DIR/sys_config.json $JSON_FILE_PATH
}

--echo # Check SDI from t1#P#p1.ibd
--let JSON_FILE_PATH = $DEST_DIR/t1#p#p1.json
--exec $IBD2SDI $MYSQLD_DATADIR1/partitions/t1#p#p1.ibd -d $JSON_FILE_PATH 2>&1
--source suite/innodb/include/ibd2sdi_replace.inc
if ($MTR_RECORD == 0) {
--diff_files $SRC_DIR/t1#p#p1.json $JSON_FILE_PATH
}

--echo # Check SDI from t1#P#p0.ibd
--let JSON_FILE_PATH = $DEST_DIR/t1#p#p0.json
--exec $IBD2SDI $MYSQLD_DATADIR1/partitions/t1#p#p0.ibd -d $JSON_FILE_PATH 2>&1
--source suite/innodb/include/ibd2sdi_replace.inc
if ($MTR_RECORD == 0) {
--diff_files $SRC_DIR/t1#p#p0.json $JSON_FILE_PATH
}

# If --record is used, save the json files created in the $DEST_DIR
# back to the $SRC_DIR.
if ($MTR_RECORD == 1) {
--copy_files_wildcard $DEST_DIR $SRC_DIR *.json
}

--echo # Remove json files
--force-rmdir $DEST_DIR

--echo # Remove copied files
--remove_file $MYSQL_TMP_DIR/data57_partition.zip

--force-rmdir $MYSQL_TMP_DIR/data57_partition

--echo # Restart the server with default options.
--let $restart_parameters=
--source include/start_mysqld.inc