Bug #59976 Temporary files remain after check and adding partition
Submitted: 7 Feb 2011 1:51 Modified: 2 Jan 2012 21:01
Reporter: Mikiya Okuno Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: Partitions Severity:S3 (Non-critical)
Version:5.1 OS:Any
Assigned to:
Triage: Needs Triage: D3 (Medium) / R6 (Needs Assessment) / E6 (Needs Assessment)

[7 Feb 2011 1:51] Mikiya Okuno
Description:
After successful and erroneous CHECK PARTITION, temporary files will remain after ADD PARTITION.

How to repeat:
create table t (
  a int unsigned not null,
  b date,
  primary key (a, b)
) engine myisam
partition by range(to_days(b)) (
  partition p1 values less than (to_days('2011-02-07'))
);

alter table t check partition p1;
alter table t check partition p2; -- this fails because p2 doesn't exist
alter table t add partition (partition p2 values less than (to_days('2011-02-12')));

Then, temporary files remain at /path/to/datadir/db

shell> ls
t.frm  t.par  t#P#p1.MYD  t#P#p1.MYI  t#P#p1#TMP#.MYD  t#P#p1#TMP#.MYI  t#P#p2.MYD  t#P#p2.MYI

Two CHECK PARTITION's, one is successful and one is erroneous, before performing ADD PARTITION are necessary to repeat this bug. This bug also happens when using InnoDB as well.

Suggested fix:
N/A
[7 Feb 2011 1:57] Mikiya Okuno
This does not happen on MySQL 5.5.
[2 Jan 2012 21:01] Jon Stephens
Won't fix in 5.1, can't repeat in 5.5. Closed.