[MDEV-8012] Wrong exit code when asking for help Created: 2015-04-17  Updated: 2016-06-12  Resolved: 2016-06-12

Status: Closed
Project: MariaDB Server
Component/s: Scripts & Clients
Affects Version/s: 5.1.67, 5.2.14, 5.3.12, 5.5, 10.0, 10.1
Fix Version/s: 5.5.50

Type: Bug Priority: Major
Reporter: Honza Horak Assignee: Vicențiu Ciorbaru
Resolution: Fixed Votes: 0
Labels: contribution, upstream, verified
Environment:

Linux


Sprint: 5.5.50

 Description   

Description:
There are weird exit codes of some utilities:

`mysql_waitpid --help` returns 255 instead of 0

`mysqladmin --help` returns 1 instead of 0

both of them accept

'--help'

(or '-?') as valid option according to the documentation

How to repeat:

$> mysql_waitpid --help &>/dev/null
$> echo $?
 
$> mysqladmin --help &>/dev/null
$> echo $?

Current resutls:

255
1

Expected results:

0
0



 Comments   
Comment by Honza Horak [ 2015-04-17 ]

Cross reporting:
http://bugs.mysql.com/bug.php?id=76737

Comment by Elena Stepanova [ 2015-04-17 ]

Thanks for the report.

Reasoning from MDEV-4905 does not apply here, because the non-zero code is returned even when mysqladmin --help is run with a perfectly valid set of parameters.

Comment by DELETEME [ 2016-03-08 ]

I just submitted a pull request here: https://github.com/MariaDB/server/pull/161

Comment by Vicențiu Ciorbaru [ 2016-06-12 ]

Pull request merged:
3c77a00d55efe901db9cb52ec000cc93d909a3c9
Also extra related fix with:
416006a3d8164684a1bfffa2e20a1f9894baf372

Generated at Thu Feb 08 07:23:59 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.