Bug #41306 Official Plugins Directory or Handling of Databases -> Directory Mappings
Submitted: 8 Dec 2008 18:35 Modified: 9 Dec 2008 4:26
Reporter: Tim Soderstrom Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Storage Engine API Severity:S4 (Feature request)
Version:5.1+ OS:Any
Assigned to: CPU Architecture:Any
Tags: directories, plugins

[8 Dec 2008 18:35] Tim Soderstrom
Description:
I tried to find an open feature request on this already but didn't find it. My apologies if it already exists. Basically, I think the new Storage Engine API, or more specifically PBXT, has exposed a minor flaw in MySQL. It treats any directory under the datadir as a database. There are two cases, thus far, that I have found this to be a bit annoying:

1. If the datadir is mounted directly to a device running on an ext3 file-system, a 'lost+found' directory is created, which, to MySQL, makes it appear as though it's a database.

2. PBXT has quite a few files and so, appropriately so, it places them inside a 'pbxt' directory under the datadir. This seems like a very good idea, but MySQL also assumed that the 'pbxt' is a database even though it isn't.

The latter is what I am referring to in this feature request (though the former is a mild annoyance).

How to repeat:
N/A

Suggested fix:
MySQL should keep track of databases other than by looking in the datadir for directories. Or, some reserved directories should be created to avoid this issue. Something like:

$datadir/plugins
$datadir/engines

or even:

$datadir/databases

Now, InnoDB solves thie by innodb_data_file_path. PBXT could do the same thing in this case, but I don't think either would always be ideal at least as a default. I find having everything under the datadir and then, if need be, symlinking what needs to be placed elsewhere is the most straightforward approach since everything will always be in the same place.

Either way, having each plugin handle this on it's own doesn't seem helpful. Having a place to store things by default would be fantastic. Otherwise the result could be a cluttered datadir, fake databases, a clutter file-system, or all of the above.
[9 Dec 2008 4:26] Valeriy Kravchuk
Thank you for a reasonable feature request.