| 1 |
CREATE TABLE bug47621 (salesperson INT) ENGINE=InnoDB; |
| 2 |
ALTER TABLE bug47621 CHANGE salesperson sales_acct_id INT; |
| 3 |
create index orgs on bug47621(sales_acct_id); |
| 4 |
ALTER TABLE bug47621 CHANGE sales_acct_id salesperson INT; |
| 5 |
drop table bug47621; |
| 6 |
CREATE TABLE bug47621_sale ( |
| 7 |
salesperson INT, |
| 8 |
PRIMARY KEY(salesperson)) engine = innodb; |
| 9 |
CREATE TABLE bug47621_shirt( |
| 10 |
id SMALLINT, |
| 11 |
owner INT, |
| 12 |
FOREIGN KEY(owner) |
| 13 |
references bug47621_sale(salesperson) ON DELETE RESTRICT) |
| 14 |
engine = innodb; |
| 15 |
insert into bug47621_sale values(9); |
| 16 |
insert into bug47621_shirt values(1, 9); |
| 17 |
ALTER TABLE bug47621_shirt CHANGE id new_id INT; |
| 18 |
drop table bug47621_shirt; |
| 19 |
ALTER TABLE bug47621_sale CHANGE salesperson sales_acct_id INT; |
| 20 |
ALTER TABLE bug47621_sale ADD INDEX idx (sales_acct_id); |
| 21 |
drop table bug47621_sale; |