Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exchange partition cannot be used after creating/dropping a foreign key #51807

Closed
YangKeao opened this issue Mar 15, 2024 · 2 comments · Fixed by #51808
Closed

Exchange partition cannot be used after creating/dropping a foreign key #51807

YangKeao opened this issue Mar 15, 2024 · 2 comments · Fixed by #51808
Labels
affects-5.4 This bug affects 5.4.x versions. affects-6.1 affects-6.5 affects-7.1 affects-7.5 found/customer Customers have encountered this bug. severity/major sig/sql-infra SIG: SQL Infra type/bug This issue is a bug.

Comments

@YangKeao
Copy link
Member

Bug Report

1. Minimal reproduce step (Required)

create table parent (id int unique);
create table child (id int, parent_id int, foreign key (parent_id) references parent(id));
create table child_with_partition(id int, parent_id int) partition by range(id) (partition p1 values less than (100));
alter table child drop foreign key fk_1;
alter table child drop key fk_1;
alter table child_with_partition exchange partition p1 with table child;

2. What did you expect to see? (Required)

Partition exchanged successfully.

3. What did you see instead (Required)

mysql> alter table child_with_partition exchange partition p1 with table child;
ERROR 1740 (HY000): Table to exchange with partition has foreign key references: 'child'

4. What is your TiDB version? (Required)

@YangKeao YangKeao added the type/bug This issue is a bug. label Mar 15, 2024
@ti-chi-bot ti-chi-bot bot added may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 labels Mar 15, 2024
@YangKeao YangKeao added affects-5.4 This bug affects 5.4.x versions. affects-6.1 and removed may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 labels Mar 15, 2024
@YangKeao
Copy link
Member Author

Duplicated with #51762. Close

@jebter jebter added the sig/sql-infra SIG: SQL Infra label Mar 25, 2024
@seiya-annie
Copy link

/found customer

@ti-chi-bot ti-chi-bot bot added the found/customer Customers have encountered this bug. label Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-5.4 This bug affects 5.4.x versions. affects-6.1 affects-6.5 affects-7.1 affects-7.5 found/customer Customers have encountered this bug. severity/major sig/sql-infra SIG: SQL Infra type/bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants