# #Bug #33398681 Innodb ibd tablespace file is moved back from innodb_directories to datadir after ALTER TABLE # # Upgrade scenario # Part 1: Steps already executed in older version of mysqld i.e., 8.0.36 which does not contain the fix for Bug #33398681 # 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 # 1b. Start mysql client and create database test_upgsc and create tables t7a, t7b t7c in it # 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 # 1d. Start and shutdown the server again to make ibd files get recognized as moved in 8.0.36 # 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 # Part 2: Steps to be executed in the current version i.e., in this test # 2a. Copy the data80036_with_externally_stored_tablespaces.zip from MYSQL_TEST_DIR/std_data/ to MYSQL_TMP_DIR/test_Bug33398681/ as data8036.zip # 2b. Check that the zip file data8036.zip exists in working MYSQL_TMP_DIR/test_Bug33398681/ folder and unzip it in the same directory # 2c. Check that data_dir and new_innodbdir are existing in MYSQL_TMP_DIR/test_Bug33398681/ and list all the files # 2d. Set MYSQLD_NEW_DATADIR as MYSQL_TMP_DIR/test_Bug33398681/data_dir and EXTERNAL_DIR3 AS MYSQL_TMP_DIR/test_Bug33398681/new_innodbdir # 2e. Start the server with datadir=MYSQLD_NEW_DATADIR and innodb-directories=EXTERNAL_DIR3 options # 2f. Trigger Alter table force for t7a, t7b, t7c # 2g. Verify that the ibd files for t7a, t7b, t7c exist in EXTERNAL_DIR3 # Shutdown server # Copy the zip directory of 8.0.36 from MYSQL_TEST_DIR/std_data/ to MYSQL_TMP_DIR/test_Bug33398681 working location. # Check that the file exists in the working folder. #ib_16384_0.dblwr #ib_16384_1.dblwr #innodb_redo #innodb_temp auto.cnf binlog.000001 binlog.000002 binlog.index ca-key.pem ca.pem client-cert.pem client-key.pem debug.log error.log ib_buffer_pool ibdata1 mysql mysql.ibd performance_schema private_key.pem public_key.pem server-cert.pem server-key.pem sys test undo_001 undo_002 test_upgsc t7a.ibd t7b.ibd t7c.ibd # Set different path for --datadir which points to old version 8.0.36 # Set EXTERNAL_DIR3 # Start server with new data and external directories # restart: --datadir=MYSQL_TMP_DIR/test_Bug33398681/data_dir --innodb-directories=MYSQL_TMP_DIR/test_Bug33398681/new_innodbdir --lower_case_table_names=1 # Perform ALTER TABLE operations ALTER TABLE test_upgsc.t7a FORCE; ALTER TABLE test_upgsc.t7b FORCE, ALGORITHM=INPLACE; ALTER TABLE test_upgsc.t7c FORCE, ALGORITHM=COPY; # Check that the ibd files still exist in EXTERNAL_DIR3 t7a.ibd t7b.ibd t7c.ibd # Clean Up # restart: # End Test