Bug #755 my_print_defaults should return a non-zero exit status
Submitted: 30 Jun 2003 4:14 Modified: 27 Aug 2003 12:33
Reporter: Lenz Grimmer Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version: OS:
Assigned to: Jani Tolonen CPU Architecture:Any

[30 Jun 2003 4:14] Lenz Grimmer
Description:
Taken from a mail to bugs@lists.mysql.com - please add this to
my_print_defaults so that I can check for return value in mysqld_safe:

safe_mysqld (tested in 4.0.12, I believe present in all other versions) will
insist on using its hard-coded datadir when --defaults-file option is given.
This results in a very counter-intuitive behaviour. One would expect
safe_mysqld to honor everything specified in the defaults file pointed to,
while in fact, the default hard-coded datadir ends up taking precedence.

Suggested fix:

If the argument defaults-file is present, and datadir is specified in the
defaults file, do not pass --datadir argument to mysqld inside safe_mysqld .

From a second message:

A clarification - I have reported the problem incorrectly. safe_mysqld
--defaults-file works just fine as long as the file exists. The problem is
that when the file does not exist, no error is given, and defaults are being
assumed.

Suggested fix:

my_print_defaults should give a non-zero exit status if the defaults file
passed on the command line does not exist, and safe_mysqld should check for
it, and at least issue a warning.

How to repeat:
Run

  my_print_defaults --defaults-file=<noexistent file>

And check the exit status - it's always 0.
[27 Aug 2003 12:33] Jani Tolonen
Fixed.

Added a warning to my_print_defaults, now used by mysqld_safe.

Regards,
Jani