MySQL Forums
Forum List  »  Partitioning

alter table partition error
Posted by: jason zhang
Date: June 30, 2009 04:13AM

I created two tables to reproduce this problem:

id int(11) primary key
region_id int(11)

id int(11) mul index
name char(32)

then create a constraint:
alter table test add constraint foreign key (region_id) references region (id);

Up to now, both two tables are empty, I executed below sql to create partition:

alter table test partition by hash(region_id) partitions 2;

I got below error info:

ERROR 1217 (23000): Cannot delete or update a parent row: a foreign key constraint fails

I can not understand why this operation raise an constraint error. There is no record been deleted or updated at all.

The real case is I already has a table include millions record and I want to partion on it now.

Options: ReplyQuote

Written By
alter table partition error
June 30, 2009 04:13AM
June 30, 2009 09:08PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.