Bug #68214 Inconsistency of case sensitivity
Submitted: 29 Jan 2013 6:20 Modified: 29 Jan 2013 16:02
Reporter: Tianyin Xu Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:mysql-5.5.29 OS:Linux (UNIX)
Assigned to: CPU Architecture:Any

[29 Jan 2013 6:20] Tianyin Xu
Description:
Hi, 

In MySQL's configuration, for boolean and enum options, the enumerative values are case insensitive. This can be verified by all the boolean options, enumerative options, units, which are all case insensitive (check setval() in mysys/my_getopt.c).

However, the enumerative values of "innodb_file_format_check" is inconsistent with this rule, which is case sensitive. 

With the case sensitivity, the options are really confusing because the enumerative set mixtures both uppercase and lowercase values, shown as below:

"fsync"
"O_DSYNC"
"O_DIRECT"
"littlesync"
"nosync"
"normal"
"unbuffered"
"async_unbuffered"

How to repeat:
To repeat, simply startup server using one of the option value:

$ ./bin/mysqld --innodb_flush_method=FSYNC
130128 22:11:01 InnoDB: Unrecognized value FSYNC for innodb_flush_method
130128 22:11:01 [ERROR] Plugin 'InnoDB' init function returned error.
130128 22:11:01 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
130128 22:11:01 [ERROR] Unknown/unsupported storage engine: InnoDB
130128 22:11:01 [ERROR] Aborting

But, you can start the server with "--innodb_flush_method=fsync".

Suggested fix:
The corresponding code is in "storage/innobase/srv/srv0start.c"

    if (srv_file_flush_method_str == NULL) {
        /* These are the default options */
        srv_unix_file_flush_method = SRV_UNIX_FSYNC;
        srv_win_file_flush_method = SRV_WIN_IO_UNBUFFERED;
#ifndef __WIN__
    } else if (0 == ut_strcmp(srv_file_flush_method_str, "fsync")) {
        srv_unix_file_flush_method = SRV_UNIX_FSYNC;
 
    } else if (0 == ut_strcmp(srv_file_flush_method_str, "O_DSYNC")) {
        srv_unix_file_flush_method = SRV_UNIX_O_DSYNC;
 
    } else if (0 == ut_strcmp(srv_file_flush_method_str, "O_DIRECT")) {
        srv_unix_file_flush_method = SRV_UNIX_O_DIRECT;
 
    } else if (0 == ut_strcmp(srv_file_flush_method_str, "littlesync")) {
        srv_unix_file_flush_method = SRV_UNIX_LITTLESYNC;

    } else if (0 == ut_strcmp(srv_file_flush_method_str, "nosync")) {
        srv_unix_file_flush_method = SRV_UNIX_NOSYNC;
#else
    } else if (0 == ut_strcmp(srv_file_flush_method_str, "normal")) {
        srv_win_file_flush_method = SRV_WIN_IO_NORMAL;
        srv_use_native_aio = FALSE;

    } else if (0 == ut_strcmp(srv_file_flush_method_str, "unbuffered")) {
        srv_win_file_flush_method = SRV_WIN_IO_UNBUFFERED;
        srv_use_native_aio = FALSE;

    } else if (0 == ut_strcmp(srv_file_flush_method_str, 
                                  "async_unbuffered")) {
        srv_win_file_flush_method = SRV_WIN_IO_UNBUFFERED;
#endif
    } else {
        ut_print_timestamp(stderr);
        .....

I suggest to make them case insensitive using functions such as strcasecmp() or my_strcasecmp().
[29 Jan 2013 16:02] MySQL Verification Team
Verified as described.