# Store mysql_data on local disk so that it is accessible to multiple containers. mkdir -p /tmp/mysql_data # clear any previous data if we're repeating this test rm -rf /tmp/mysql_data/* # Start mysql 8.0.21. Specify the platform to ensure the container works on ARM Mac. docker run \ --platform linux/x86_64 \ --rm \ --name mysql-test \ -v /tmp/mysql_data:/var/lib/mysql \ -e MYSQL_ROOT_PASSWORD=mysql \ mysql:8.0.21 # In separate tab, connect to mysql and execute commands. docker exec -it mysql-test mysql -uroot -pmysql # Run commands from repro CREATE DATABASE test; USE test; SET GLOBAL innodb_default_row_format='Compact'; CREATE TABLE bad ( a VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL, UNIQUE KEY (a) ) ENGINE=INNODB; quit # Stop 8.0.21 container. docker stop mysql-test # In first tab, mysql should have stopped. Start mysql 8.0.33 and point to same data from 8.0.21. docker run \ --platform linux/x86_64 \ --rm \ --name mysql-test \ -v /tmp/mysql_data:/var/lib/mysql \ -e MYSQL_ROOT_PASSWORD=mysql \ mysql:8.0.33 # In second tab, connect to mysql and execute commands. docker exec -it mysql-test mysql -uroot -pmysql # Run commands from repro USE test; ALTER TABLE bad MODIFY a VARCHAR(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL; quit # restart the mysql server docker restart mysql-test # connect to mysql docker exec -it mysql-test mysql -uroot -pmysql # run commands to access the table USE test; SELECT COUNT(*) FROM bad;