Bug #31486 --defaults-extra-file is read out of order
Submitted: 9 Oct 2007 16:34 Modified: 17 Jan 2008 14:43
Reporter: Sarah Sproehnle Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: General Severity:S3 (Non-critical)
Version:5.1.22rc OS:Windows
Assigned to: Assigned Account CPU Architecture:Any

[9 Oct 2007 16:34] Sarah Sproehnle
Description:
When using --defaults-extra-file option, the extra file is read before the global file (C:\Program Files\MySQL\MySQL Server 5.1\my.ini).  The documentation states that the extra file should be read last:
"Read this option file after the global option file"

How to repeat:
Create 2 configuration files:
C:\Program Files\MySQL\MySQL Server 5.1\my.ini
[mysqld]
port=3306

C:\my-extra.ini
[mysqld]
port=3307

shell> mysqld --defaults-extra-file=c:\my-extra.ini

The server will use port 3306, but it should be using 3307.

Suggested fix:
Read the extra default file after reading the global option files.
[16 Nov 2007 14:35] MySQL Verification Team
Thank you for the bug report. C:\Program Files\.. isn't a default path where
the server looks for, so if you place the global configuration file on path
where is default like c:\ c:\windir and so on, you get the expected behavior:

c:\dev>cat c:\my.ini
[mysqld]
port=3309
c:\dev>cat c:\my-extra.ini
[mysqld]
port=3312
c:\dev>5.1\bin\mysqld --defaults-extra-file=c:\my-extra.ini --standalone --console
071116 12:30:49  InnoDB: Started; log sequence number 0 108025
071116 12:30:50 [Note] Event Scheduler: Loaded 0 events
071116 12:30:50 [Note] 5.1\bin\mysqld: ready for connections.
Version: '5.1.23-beta-nt'  socket: ''  port: 3312  Source distribution
[16 Nov 2007 14:39] MySQL Verification Team
Sorry for my last post, I didn't noticed the port 3312.  Changing to verified.
[17 Jan 2008 14:43] Sergey Vojtovich
Miguel,

what is the bug here? In my-extra.ini you have port set to 3312 and according to log you've posted, the server uses port 3312 as expected.

Anyway I wasn't able to repeat this problem. It is very likely that this bug was fixed in 5.1.23 by patch for BUG#20748. Quote from chengeset for BUG#20748 states:
<quot>
On windows:

    BEFORE:  C:\, GetWindowsDirectory(), GetSystemWindowsDirectory(),
             $MYSQL_HOME, defaults-extra-file, INSTALLDIR
    
    AFTER:  GetSystemWindowsDirectory(), GetWindowsDirectory(), C:\,
            INSTALLDIR, $MYSQL_HOME, defaults-extra-file
</quot>

Closing as a duplicate of BUG#20748.