# Run sequence similar to pt-online-schema-change.
# Inspired by bug1053073 but did not trigger it.

---
- Statement: CREATE TABLE "customers" (cid INT NOT NULL PRIMARY KEY);
---
- Statement: CREATE TABLE "addresses" (aid INT NOT NULL PRIMARY KEY, cid INT NOT NULL, GROUPING FOREIGN KEY(cid) REFERENCES customers(cid));

---
- Statement: INSERT INTO "customers" VALUES (1), (5);
---
- Statement: INSERT INTO "addresses" VALUES (10,1), (50,5);

---
- Statement: CREATE TABLE "_customers_new" (cid INT NOT NULL PRIMARY KEY);
---
- Statement: ALTER TABLE "_customers_new" ADD COLUMN x INT;
---
- Statement: INSERT INTO "_customers_new" (cid) SELECT cid FROM customers;
---
- Statement: RENAME TABLE "customers" TO "_customers_old";
---
- Statement: RENAME TABLE "_customers_new" TO "customers";

---
- Statement: ALTER TABLE "addresses" DROP GROUPING FOREIGN KEY;
---
- Statement: ALTER TABLE "addresses" ADD GROUPING FOREIGN KEY(cid) REFERENCES "customers"(cid);

---
- Statement: CREATE TABLE "_addresses_new" (aid INT NOT NULL PRIMARY KEY, cid INT NOT NULL);
---
- Statement: ALTER TABLE "_addresses_new" ADD COLUMN y INT;
---
- Statement: INSERT INTO "_addresses_new" (aid, cid) SELECT aid, cid FROM "addresses";
---
- Statement: RENAME TABLE "addresses" TO "_addresses_old";
---
- Statement: RENAME TABLE "_addresses_new" TO "addresses";

---
- Statement: SELECT cid FROM "customers" ORDER BY cid;
- output: [[1], [5]]
---
- Statement: SELECT aid,cid FROM "addresses" ORDER BY aid;
- output: [[10, 1], [50, 5]]

---
- Statement: DROP TABLE "_customers_old";
---
- Statement: DROP TABLE "_addresses_old";


Test similar to osc sequence
Test similar to osc sequence