Bug #5704 --pidfile option doesn't work on Windows
Submitted: 22 Sep 2004 15:37 Modified: 20 Oct 2004 16:26
Reporter: Mark Matthews Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:Any OS:Windows (Windows)
Assigned to: Reggie Burnett CPU Architecture:Any

[22 Sep 2004 15:37] Mark Matthews
Description:
The MySQL server has no way to report the pid it is running as (yes, PIDs _do_ exist on Windows) when it is launched on Windows. This makes it hard for programs that wrap MySQL (such as Connector/MXJ and the C port of the testsuite) to shut down a running MySQL instance in a consistent way compared to unix.

It appears in the sources that the --pidfile code (but not the option handling itself, adding --pid-file to the mysqld command line silently fails :( ) is #ifdef'd out, even though Windows has a function _very_ similar to Unix's getPid() (in fact it has the same name):

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/_crt__getpi...

How to repeat:
Start the server on windows with the --pid-file option. Notice that it doesn't write a pidfile, but neither does it complain :(
[20 Oct 2004 16:26] Reggie Burnett
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
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

Reviewed by Brian.