[MDEV-4905] Getting mysqld --help as root exits with 1 Created: 2013-08-16  Updated: 2015-04-17  Due: 2013-08-22  Resolved: 2013-08-20

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.5.32
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Honza Horak Assignee: Unassigned
Resolution: Not a Bug Votes: 0
Labels: upstream
Environment:

Linux, Fedora


Attachments: File mariadb-nofailonhelp.patch    

 Description   

I'm on Fedora and try to get verbose help as root:

sudo /usr/libexec/mysqld --help --verbose

It kinda works but the exit code is 1, which is not what I'd expect, since I wanted just help message.

How to repeat:

su -
/usr/libexec/mysqld --help --verbose
echo $?

Actual result:
1
Expected result:
0

Reported also on http://bugs.mysql.com/bug.php?id=70058

Proposed patch is attached.



 Comments   
Comment by Sergei Golubchik [ 2013-08-18 ]

I'm not sure it's a good idea. If you run "mysqld --help" you will get the exit code 0. But "mysqld --help --verbose" prints values of all variables and command-line options. To do that it reads config files and load plugins (but doesn't run them). If something will fail during this process, it'll exit with the code 1. It means that if you start the server exactly the same way — it'll fail, it won't start. And if you start the server differently — your help output was misleading, it contained different values or even a different set of options as compared to what your running server would have. This is what the exit code means — you should not trust this help output, it is not what your server will have.

Comment by Honza Horak [ 2013-08-20 ]

Ok, thanks for the explanation.

Comment by Elena Stepanova [ 2015-04-17 ]

Upstream bug was fixed in 5.5.38, 5.6.17, 5.7.4.

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