Bug #51609 !includedir does not read all .cnf files
Submitted: 1 Mar 2010 15:44 Modified: 29 May 2013 17:15
Reporter: Kenny Gryp Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Options Severity:S3 (Non-critical)
Version:5.1.42, all OS:Linux
Assigned to: CPU Architecture:Any
Tags: cnf, configuration, defaults, includedir

[1 Mar 2010 15:44] Kenny Gryp
Description:

When using !includedir, it reads all the .cnf files in the specified directory.
This seem to work great, but filenames already containing a dot wil be ignored.

Looking at the code, the behaviour is that the extension of a file begins after the first 'dot':
mysys/mf_fn_ext.c
<code>
  SYNOPSIS
    fn_ext()
    name                Name of file

  DESCRIPTION
    The extension is defined as everything after the first extension character
    (normally '.') after the directory name.
</code>

The documentation says (http://dev.mysql.com/doc/refman/5.1/en/option-files.html):
<doc>
Currently, any files to be found and included using the !includedir directive on Unix operating systems must have file names ending in .cnf. On Windows, this directive checks for files with the .ini or .cnf extension.
</doc>

While it is true that they need to end with .cnf, nothing mentions that filenames cannot contains another 'dot'.

How to repeat:
Create 3 files with the following content:

# cat /etc/mysql/my.cnf:
!includedir /etc/mysql/manual/

# cat /etc/mysql/manual/test.cnf:
[test]
test

# cat /etc/mysql/manual/test.dots.cnf:
[test]
testdots

# my_print_defaults test
--test

Suggested fix:
Personally I don't see any problem with allowing multiple dots in filenames, so preferably this would be fixed.

Experience with MySQL tells me that this will probably some documentation issue :-)
[1 Mar 2010 20:22] Sveta Smirnova
Thank you for the report.

Verified as described.

This limitation partially described in the user manual at http://dev.mysql.com/doc/refman/5.1/en/option-files.html: "Currently, any files to be found and included using the !includedir directive on Unix operating systems must have file names ending in .cnf"
[29 May 2013 17:15] Paul DuBois
Noted in 5.7.2 changelog.

The !includedir directive in option files did not read .cnf or .ini
files that included a dot in the file name preceding the extension.