Bug #71296 DROP DATABASE doesn't remove .CSN files
Submitted: 5 Jan 2014 12:18
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: CSV Severity:S3 (Non-critical)
Version:5.7.4 OS:Any
Assigned to: CPU Architecture:Any

[5 Jan 2014 12:18] Shane Bester
Description:
mysql> drop database a;
ERROR 1010 (HY000): Error dropping database (can't rmdir '.\a\', errno: 17)

 Directory of D:\build\mysql-trunk-clean\sql\data\a

2014/01/05  02:10 PM    <DIR>          .
2014/01/05  02:10 PM    <DIR>          ..
2014/01/05  02:10 PM             1 010 t0010.CSN
2014/01/05  02:10 PM             1 098 t0012.CSN
2014/01/05  02:10 PM             1 701 t0073.CSN
               3 File(s)          3 809 bytes

/* The file extension */
#define CSV_EXT ".CSV"               // The data file
#define CSN_EXT ".CSN"               // Files used during repair and update
#define CSM_EXT ".CSM"               // Meta file

How to repeat:
doesn't matter.  all my tests with csv leave behind stray .csn files and the database cannot be dropped.

Suggested fix:
1.  never leave stray csn files behind after some (failed?) csv operation.
2.  allow drop database to remove such stray files.