Bug #20455 mysqldumpslow gives strong error message when file parameter is missing
Submitted: 14 Jun 2006 9:37 Modified: 22 May 2008 2:56
Reporter: Oli Sennhauser Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: mysqldump Command-line Client Severity:S3 (Non-critical)
Version:any OS:Any (any)
Assigned to: Chad MILLER CPU Architecture:Any
Tags: mysqldumpslow
Triage: D4 (Minor) / R2 (Low) / E1 (None/Negligible)

[14 Jun 2006 9:37] Oli Sennhauser
Description:
mysqldumpslow gives strong error message when file parameter is missing:

mysqldumpslow
Can't determine basedir from 'my_print_defaults mysqld' output:  at /u00/app/mysql/product/mysql-5.0.22/bin/mysqldumpslow line 38.

* mysqldumpslow -g abc
Can't determine basedir from 'my_print_defaults mysqld' output:  at /u00/app/mysql/product/mysql-5.0.22/bin/mysqldumpslow line 38.
Strange error message. 

How to repeat:
mysqldumpslow
Can't determine basedir from 'my_print_defaults mysqld' output:  at /u00/app/mysql/product/mysql-5.0.22/bin/mysqldumpslow line 38.

* mysqldumpslow -g abc
Can't determine basedir from 'my_print_defaults mysqld' output:  at /u00/app/mysql/product/mysql-5.0.22/bin/mysqldumpslow line 38.
Strange error message. 

Suggested fix:
Proper parameter checking and print message of real problem.
[14 Jun 2006 10:41] Valeriy Kravchuk
Thank you for a problem report. Verified just as described with 5.0.23-BK on Linux:

openxs@suse:~/dbs/5.0> bin/mysqldumpslow
Can't determine basedir from 'my_print_defaults mysqld' output:  at bin/mysqldumpslow line 38.

But as I see no description of mysqldumpslow and my_print_defaults in the manual, I am not sure how they should really work.
[14 Jun 2006 10:43] Valeriy Kravchuk
openxs@suse:~/dbs/5.0> bin/my_print_defaults mysqld

really prints nothing in my case, so this error message can be formally correct!
[24 Aug 2006 11:03] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/10821

ChangeSet@1.2251, 2006-08-24 04:02:46-07:00, igreenhoe@anubis.greendragongames.com +4 -0
  Fix for bug #20455 "mysqldumpslow gives strong error message when
  file parameter is missing"
  
  Problem:  mysqldumpslow was returning a confusing error message when
  no configuration file was found.  This was due to a lack of an error
  result from mysql_print_defaults on that error.  mysql_print_defaults
  in turn needed this error from load_defaults(), which needed the
  error from my_search_option_files().
  
  Solution: Add extra error return to my_print_defaults,
  load_defaults(), and my_search_option_files().  Add better error
  message to mysqldumpslow on this error.
[17 Oct 2007 15:49] Nils Goroll
change status to fixed?
[6 Mar 2008 21:21] Chad MILLER
Verified that this bug is gone.
[22 May 2008 2:56] Paul Dubois
Noted in 5.0.56, 5.1.24, 6.0.5 changelogs.

mysqldumpslow returned a confusing error message when no
configuration file was found.