Bug #6593 Inconsistency in handling option prefixes (--skip, --disable, etc.)
Submitted: 12 Nov 2004 13:57 Modified: 18 Apr 2005 21:19
Reporter: Paul DuBois Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.0,4.1,5.0 OS:
Assigned to: Jani Tolonen CPU Architecture:Any

[12 Nov 2004 13:57] Paul DuBois
Description:
Since 4.0.2, the option handling code allows options
or variables to be specified using either dashes or
underscores.  For example, all of these are legal:

--log-bin=filename
--log_bin=filename

--max_allowed_packet=value
--max-allowed-packet=value

However, a problem has been exposed by this bug
report: http://bugs.mysql.com/?id=6590

Namely, the option prefixes (--skip, --disable, --enable,
--loose, etc.) are recognized _only_ if they are followed
by a dash, and not an underscore.  (What the bug report
showed was that --skip-innodb is recognized, but
--skip_innodb is not.) This introduces an inconsistency
in how options are handled. (And an exception that
users must know about, which is really why this is a
problem.)

Note: I've selected MySQL Server as the bug report
category, but the problem really is in the option handling
code and affects any program that uses the code.

How to repeat:
It's easiest to see this with a client program:

% mysql --auto-rehash
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 25 to server version: 4.1.6-gamma-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> quit
Bye

% mysql --skip-auto-rehash
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 26 to server version: 4.1.6-gamma-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> quit
Bye

% mysql --skip_auto-rehash
mysql: unknown option '--skip_auto-rehash'

Suggested fix:
Check for either '-' or '_' after an option prefix.
[18 Apr 2005 21:19] 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/internals/24121
[18 Apr 2005 21:19] Jani Tolonen
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html