Bug #51975 Mysqldump options printing to stdout instead of stderr
Submitted: 12 Mar 2010 3:57 Modified: 12 Mar 2010 4:14
Reporter: Michael Blake Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: mysqldump Command-line Client Severity:S3 (Non-critical)
Version:Ver 10.13 Distrib 5.1.37 OS:Linux (Ubuntu 9.10)
Assigned to: CPU Architecture:Any

[12 Mar 2010 3:57] Michael Blake
Description:
Might be an downstream bug (ubuntu/debian) but running mysqldump with invalid options outputs to stdout instead of stderr.

It should not output to stdout as the initial call has failed and should provide some feedback. 

As there's no feedback I could have (potentially) done a dump of a database and, since there were no errors, deleted the database thinking I had a backup. 

How to repeat:
# mysqldump --user=asdasd
Usage: mysqldump [OPTIONS] database [tables]
OR     mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]
OR     mysqldump [OPTIONS] --all-databases [OPTIONS]
For more options, use mysqldump --help

# mysqldump --user=asdasd > aasd
# cat aasd
Usage: mysqldump [OPTIONS] database [tables]
OR     mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]
OR     mysqldump [OPTIONS] --all-databases [OPTIONS]
For more options, use mysqldump --help

Suggested fix:
Ensure usage or error messages are output to stderr.
[12 Mar 2010 4:14] MySQL Verification Team
Thank you for the bug report. Duplicate of bug: http://bugs.mysql.com/bug.php?id=44848