Bug #13446 Partitions: out-of-range values allowed with foreign keys
Submitted: 23 Sep 2005 17:44 Modified: 20 Jan 2006 10:29
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Partitions Severity:S3 (Non-critical)
Version:5.1.2-alpha-debug OS:Linux (SUSE 9.2)
Assigned to: Mikael Ronström CPU Architecture:Any

[23 Sep 2005 17:44] Peter Gulutzan
Description:
If I try to insert 5 into a table whose only partition says
"values less than (1)", I get an error message. But if I
arrange so that the row is updated to 5, I get no error
message. 

How to repeat:
drop table tc2;
drop table tc,tc2;
create table tc (s1 int, primary key (s1)) engine=innodb;
insert into tc values (1);
create table tc2(s1 int, foreign key (s1) references tc (s1) on update cascade)
 engine=innodb
 partition by range (s1) (partition p1 values less than (2));
insert into tc2 values (1);
update tc set s1 = 5;
select * from tc2;
[2 Nov 2005 17:42] Mikael Ronström
Test of this worked
The supposedly erratic update actually was an update of an InnoDB table and not
a partitioned table
[3 Nov 2005 22:03] Mikael Ronström
It was a bug, but it is fixed since foreign keys isn't supported for
partitioned tables. This is checked in the new big patch in review
[19 Jan 2006 9:01] Mikael Ronström
Patch pushed and will appear in 5.1.6
[20 Jan 2006 10:29] Jon Stephens
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

Documented bugfix in 5.1.6 changelog. Updated Manual to indicate that partitioned tables don't support FKs. Closed.