Skip to content

Commit d0c02d4

Browse files
amitabdahlerlend
authored andcommitted
Bug#29791350: NON-INSTALL IN-PLACE UPGRADE FAILING FROM 5.7.25 TO 8.0.16
With the patch for Bug#29365552, upgrade removes the innodb_*_stats_backup57.ibd files. However, this patch does not make sure to close the file before removing them. The post push fix for Bug#29365552 makes sure to close these files before removing them. This patch adds a regression test for this issue. Change-Id: Id7280a3c36b7b1f318daf899f0edb8ed7d867602
1 parent ec55400 commit d0c02d4

File tree

3 files changed

+37
-7
lines changed

3 files changed

+37
-7
lines changed

mysql-test/r/mysql_57_inplace_upgrade.result

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
# Set different paths for --datadir
12
###########################################################################
23
# Stop the default mtr server
34
###########################################################################
45
# Stop DB server which was created by MTR default
56
###########################################################################
67
# Setup the 5.7 data directory
78
###########################################################################
8-
# Set different paths for --datadir
99
# Copy the remote tablespace & DB zip files from suite location to working location.
1010
# Check that the file exists in the working folder.
1111
# Unzip the zip file.
@@ -94,4 +94,10 @@ slow_log_XXX.sdi
9494
###########################################################################
9595
# Cleanup
9696
###########################################################################
97+
###########################################################################
98+
# Bug#29791350: NON-INSTALL IN-PLACE UPGRADE FAILING FROM 5.7.25 TO 8.0.16
99+
###########################################################################
100+
###########################################################################
101+
# Cleanup
102+
###########################################################################
97103
# restart:
2.44 MB
Binary file not shown.

mysql-test/t/mysql_57_inplace_upgrade.test

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
--source include/have_innodb_16k.inc
44

55
--let $MYSQLD_DATADIR= `select @@datadir`
6+
--echo # Set different paths for --datadir
7+
--let $MYSQLD_DATADIR1 = $MYSQL_TMP_DIR/data57
68

79
--echo ###########################################################################
810
--echo # Stop the default mtr server
@@ -16,9 +18,6 @@
1618
--echo # Setup the 5.7 data directory
1719
--echo ###########################################################################
1820

19-
--echo # Set different paths for --datadir
20-
--let $MYSQLD_DATADIR1 = $MYSQL_TMP_DIR/data57
21-
2221
--echo # Copy the remote tablespace & DB zip files from suite location to working location.
2322
--copy_file $MYSQLTEST_VARDIR/std_data/data57.zip $MYSQL_TMP_DIR/data57.zip
2423

@@ -245,18 +244,43 @@ SELECT COUNT(*) != 0 FROM mysql.help_topic;
245244
--echo ###########################################################################
246245

247246
# These files must not exist
248-
# $MYSQLD_DATADIR/mysql/innodb_index_stats_backup57.ibd
249-
# $MYSQLD_DATADIR/mysql/innodb_table_stats_backup57.ibd
247+
# $MYSQLD_DATADIR1/mysql/innodb_index_stats_backup57.ibd
248+
# $MYSQLD_DATADIR1/mysql/innodb_table_stats_backup57.ibd
250249
--replace_regex /_[0-9]+\.sdi/_XXX.sdi/
251-
--list_files $MYSQLD_DATADIR/mysql
250+
--list_files $MYSQLD_DATADIR1/mysql
251+
252+
--echo ###########################################################################
253+
--echo # Cleanup
254+
--echo ###########################################################################
252255

253256
--let $shutdown_server_timeout = 300
254257
--source include/shutdown_mysqld.inc
255258

259+
--force-rmdir $MYSQLD_DATADIR1
260+
--remove_file $MYSQL_TMP_DIR/data57.zip
261+
262+
--echo ###########################################################################
263+
--echo # Bug#29791350: NON-INSTALL IN-PLACE UPGRADE FAILING FROM 5.7.25 TO 8.0.16
264+
--echo ###########################################################################
265+
266+
--copy_file $MYSQLTEST_VARDIR/std_data/upgrade/bug29791350_upgrade_57022.zip $MYSQL_TMP_DIR/data57.zip
267+
--file_exists $MYSQL_TMP_DIR/data57.zip
268+
--exec unzip -qo $MYSQL_TMP_DIR/data57.zip -d $MYSQL_TMP_DIR
269+
270+
--let $MYSQLD_LOG= $MYSQLTEST_VARDIR/log/mysql57_upgrade_bug29791350.log
271+
--replace_result $MYSQLD MYSQLD $MYSQLD_DATADIR1 MYSQLD_DATADIR1 $MYSQLD_LOG MYSQLD_LOG
272+
--exec echo "restart: --table-open-cache=256 --datadir=$MYSQLD_DATADIR1 --log-error=$MYSQLD_LOG" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
273+
--let $wait_counter= 10000
274+
--enable_reconnect
275+
--source include/wait_until_connected_again.inc
276+
256277
--echo ###########################################################################
257278
--echo # Cleanup
258279
--echo ###########################################################################
259280

281+
--let $shutdown_server_timeout = 300
282+
--source include/shutdown_mysqld.inc
283+
260284
--force-rmdir $MYSQLD_DATADIR1
261285
--remove_file $MYSQL_TMP_DIR/data57.zip
262286

0 commit comments

Comments
 (0)