| 1 |
# |
| 2 |
#Bug #33398681 Innodb ibd tablespace file is moved back from innodb_directories to datadir after ALTER TABLE |
| 3 |
# |
| 4 |
# Upgrade scenario |
| 5 |
# Part 1: Steps already executed in older version of mysqld i.e., 8.0.36 which does not contain the fix for Bug #33398681 |
| 6 |
# 1a. Build 8.0.36 and create data_dir folder in it. Initialize mysqld in this data_dir folder. This will be the default datadir for 8.0.36 |
| 7 |
# 1b. Start mysql client and create database test_upgsc and create tables t7a, t7b t7c in it |
| 8 |
# 1c. Shutdown the server and move t7a.ibd, t7b.ibd, t7c.ibd to new external directory d1 and delete database folder test_upgsc in default directory data_dir |
| 9 |
# 1d. Start and shutdown the server again to make ibd files get recognized as moved in 8.0.36 |
| 10 |
# 1e. Zip this data_dir and new external dir d1 as new_innodbdir into MYSQL_TEST_DIR/std_data/data80036_with_externally_stored_tablespaces.zip |
| 11 |
# Part 2: Steps to be executed in the current version i.e., in this test |
| 12 |
# 2a. Copy the data80036_with_externally_stored_tablespaces.zip from MYSQL_TEST_DIR/std_data/ to MYSQL_TMP_DIR/test_Bug33398681/ as data8036.zip |
| 13 |
# 2b. Check that the zip file data8036.zip exists in working MYSQL_TMP_DIR/test_Bug33398681/ folder and unzip it in the same directory |
| 14 |
# 2c. Check that data_dir and new_innodbdir are existing in MYSQL_TMP_DIR/test_Bug33398681/ and list all the files |
| 15 |
# 2d. Set MYSQLD_NEW_DATADIR as MYSQL_TMP_DIR/test_Bug33398681/data_dir and EXTERNAL_DIR3 AS MYSQL_TMP_DIR/test_Bug33398681/new_innodbdir |
| 16 |
# 2e. Start the server with datadir=MYSQLD_NEW_DATADIR and innodb-directories=EXTERNAL_DIR3 options |
| 17 |
# 2f. Trigger Alter table force for t7a, t7b, t7c |
| 18 |
# 2g. Verify that the ibd files for t7a, t7b, t7c exist in EXTERNAL_DIR3 |
| 19 |
# Shutdown server |
| 20 |
# Copy the zip directory of 8.0.36 from MYSQL_TEST_DIR/std_data/ to MYSQL_TMP_DIR/test_Bug33398681 working location. |
| 21 |
# Check that the file exists in the working folder. |
| 22 |
#ib_16384_0.dblwr |
| 23 |
#ib_16384_1.dblwr |
| 24 |
#innodb_redo |
| 25 |
#innodb_temp |
| 26 |
auto.cnf |
| 27 |
binlog.000001 |
| 28 |
binlog.000002 |
| 29 |
binlog.index |
| 30 |
ca-key.pem |
| 31 |
ca.pem |
| 32 |
client-cert.pem |
| 33 |
client-key.pem |
| 34 |
debug.log |
| 35 |
error.log |
| 36 |
ib_buffer_pool |
| 37 |
ibdata1 |
| 38 |
mysql |
| 39 |
mysql.ibd |
| 40 |
performance_schema |
| 41 |
private_key.pem |
| 42 |
public_key.pem |
| 43 |
server-cert.pem |
| 44 |
server-key.pem |
| 45 |
sys |
| 46 |
test |
| 47 |
undo_001 |
| 48 |
undo_002 |
| 49 |
test_upgsc |
| 50 |
t7a.ibd |
| 51 |
t7b.ibd |
| 52 |
t7c.ibd |
| 53 |
# Set different path for --datadir which points to old version 8.0.36 |
| 54 |
# Set EXTERNAL_DIR3 |
| 55 |
# Start server with new data and external directories |
| 56 |
# restart: --datadir=MYSQL_TMP_DIR/test_Bug33398681/data_dir --innodb-directories=MYSQL_TMP_DIR/test_Bug33398681/new_innodbdir --lower_case_table_names=1 |
| 57 |
# Perform ALTER TABLE operations |
| 58 |
ALTER TABLE test_upgsc.t7a FORCE; |
| 59 |
ALTER TABLE test_upgsc.t7b FORCE, ALGORITHM=INPLACE; |
| 60 |
ALTER TABLE test_upgsc.t7c FORCE, ALGORITHM=COPY; |
| 61 |
# Check that the ibd files still exist in EXTERNAL_DIR3 |
| 62 |
t7a.ibd |
| 63 |
t7b.ibd |
| 64 |
t7c.ibd |
| 65 |
# Clean Up |
| 66 |
# restart: |
| 67 |
# End Test |