Bug #42708 Drop database statement should remove .OLD suffix from database directory
Submitted: 9 Feb 2009 17:00 Modified: 27 Jan 2012 4:35
Reporter: Hema Sridharan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: DDL Severity:S4 (Feature request)
Version:mysql-6.0 OS:Linux
Assigned to: CPU Architecture:Any

[9 Feb 2009 17:00] Hema Sridharan
Description:
Create database, tables and load data.
Execute myisampack to compress the tables, also use -b option to have backup of datafile.
Try dropping the database, will fail because of .OLD file that is created in 
database directory.

How to repeat:
CREATE DATABASE db2;
CREATE TABLE db2.t21(id INT NOT NULL, FN CHAR(20), INDEX(id));
INSERT INTO db2.t21 VALUES
(1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'f'),(7,'d');
INSERT INTO db2.t21 SELECT * FROM db2.t21;
INSERT INTO db2.t21 SELECT * FROM db2.t21;
INSERT INTO db2.t21 SELECT * FROM db2.t21;
INSERT INTO db2.t21 SELECT * FROM db2.t21;
INSERT INTO db2.t21 SELECT * FROM db2.t21;

Note: Go to the path where these utility programs are locate and perform the following,
./myisampack -b /export/home/tmp/wl-4230p/mysql-test/var/master-data/db2/t21
./myisamchk -rq /export/home/tmp/wl-4230p/mysql-test/var/master-data/db2/t21

mysql> drop database db2;
ERROR 1010 (HY000): Error dropping database (can't rmdir './db2/', errno: 17)

Suggested fix:
Drop database removes some of the files with extensions from database directory.
.OLD should be included in the suffixes that DROP DATABASE looks for.
[23 Mar 2009 15:49] Susanne Ebrecht
Verified as described
[27 Jan 2012 4:35] 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 bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html
[27 Jan 2012 4:38] Jon Stephens
Fixed in 5.6. Documented as follows in the 5.6.5 changelog:

        Previously, .OLD files were not included among the files deleted
        by DROP DATABASE. Files with this extension are now also deleted
        by the statement.

Closed.