Files
percona-toolkit/t/pt-online-schema-change/samples/pt-2119.sql
Sveta Smirnova c87a5da5ba PT-2119 - pt-osc aborts in 8.0.15 even if no FK exists
- Moved check after we identified child tables
- Added test case
2024-04-01 23:36:54 +03:00

27 lines
721 B
SQL

DROP DATABASE IF EXISTS pt_osc;
CREATE DATABASE pt_osc;
USE pt_osc;
CREATE TABLE t(
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
f1 INT
) ENGINE=InnoDB;
CREATE TABLE `person` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(20) NOT NULL,
`testId` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB;
CREATE TABLE `test_table` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`refId` bigint(20) DEFAULT NULL,
`person` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `fk_person` (`person`),
KEY `fk_refId` (`refId`),
CONSTRAINT `fk_person` FOREIGN KEY (`person`) REFERENCES `person`(`id`),
CONSTRAINT `fk_refId` FOREIGN KEY (`refId`) REFERENCES `test_table`(`id`)
) ENGINE=InnoDB;