Bug #1385 Windows server not removing dbname.sym file.
Submitted: 23 Sep 2003 14:28 Modified: 10 Dec 2003 20:01
Reporter: Matthew Lord Email Updates:
Status: Closed Impact on me:
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.0.15 OS:Microsoft Windows (Windows)
Assigned to: Miguel Solorzano CPU Architecture:Any

[23 Sep 2003 14:28] Matthew Lord
I noticed that when you drop a database that was located outside of your data directory, the location of which is in the database-name.sym file, the .sym file is not removed and thus the database continues to show up in the show databases output.

How to repeat:
Create a symdb.sym file in your datadir on a windows machine.  Then drop the database.  Then do show databases and look in your datadir.

Suggested fix:
We should just be deleting the .sym file when we drop the database.
[23 Sep 2003 18:49] Miguel Solorzano
Thank you for the bug report I was able to repeat.
[10 Dec 2003 20:01] Michael Widenius
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

Additional info:

The given behaviour is 'kind of' intentional.
As you don't create the .sym file from inside the MySQL server it doesn't feel right that MySQL should delete it.
(At some point we should add an option to automaticly create a .sym file on CREATE DATABASE, but this is another issue).

One reason for not deleting is that you can do a DROP DATABASE and CREATE DATABASE and the new database will be created where the .sym link file points.

I have now fixed in 4.0.17 that if the .sym file points to a non existing directory it's not shown in SHOW DATABASES.