Bug #55095 innodb_file_format_check: no warning for illegal value
Submitted: 8 Jul 2010 18:17 Modified: 30 Sep 2010 20:09
Reporter: Paul DuBois Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:5.5 OS:Any
Assigned to: Jimmy Yang CPU Architecture:Any

[8 Jul 2010 18:17] Paul DuBois
Description:
I noticed this while performing some tests to document Bug#53654, which turns innodb_file_format_check into a boolean variable settable only at server startup. I wanted to know whether 0 and 1 are the only allowable values, or whether off and on also worked.

It turned out that off and on had no effect that I could tell. Setting the value to off appeared to work because the variable ended up with a value of OFF as shown by SHOW VARIABLES:

[mysqld]
innodb_file_format_check=off

But setting the value to on also resulted in a value of OFF in SHOW VARIABLES. So I tried this:

[mysqld]
innodb_file_format_check=garbage

I looked in the error log to see whether there was any warning that the value was illegal. There was no warning.

How to repeat:
See above.

Suggested fix:
The server should issue a warning for illegal startup values of innodb_file_format_check. Perhaps it should also refuse to start, so that the user will investigate the reason and realize the variable setting is incorrect.

In any case, it should not accept illegal values silently. The user has no way to know whether the setting had any effect.
[8 Jul 2010 19:14] Sveta Smirnova
Thank you for the report.

Verified as described.
[12 Jul 2010 3:35] Jimmy Yang
This is related to the system variable option settings, if we set the variable as  PLUGIN_VAR_OPCMDARG, it will not do the actual option value check. 

The other variable has the same behavior is innodb_rollback_on_timeout.

We probably should set the variable here PLUGIN_VAR_NOCMDARG for this bool type variable, similar to other bool type system variables defined. And in mysys/my_getopt.c handle_options(), it checks the bool type value has correct values (1/0, true/false). Please on/off is not valid option here:

    336         if (optp->arg_type == NO_ARG)
    337         {
    346           if ((optp->var_type & GET_TYPE_MASK) == GET_BOOL)
    347           {
    348             /*
    349               Set bool to 1 if no argument or if the user has used
    350               --enable-'option-name'.
    351               *optend was set to '0' if one used --disable-option
    352               */
    353             (*argc)--;
    354             if (!optend || *optend == '1' ||
    355                 !my_strcasecmp(&my_charset_latin1, optend, "true"))
    356               *((my_bool*) value)= (my_bool) 1;
    357             else if (*optend == '0' ||
    358                      !my_strcasecmp(&my_charset_latin1, optend, "false"))
    359               *((my_bool*) value)= (my_bool) 0;
    360             else
    361             {
    362               my_getopt_error_reporter(WARNING_LEVEL,
    363                                        "%s: ignoring option '--%s' "
    364                                        "due to invalid value '%s'",
    365                                        my_progname, optp->name, optend);
    366               continue;
    367             }
    368             if (get_one_option && get_one_option(optp->id, optp,
    369                                *((my_bool*) value) ?
    370                                enabled_my_option : disabled_my_option))
    371               return EXIT_ARGUMENT_INVALID;
    372             continue;
    373           }

With this change, it will print following error message if the error is not of the right type

100711 20:10:37 [Warning] /home/jy/work/mysql5.5_7/mysql-trunk-innodb/bld/sql/mysqld: ignoring option '--innodb-file-format-check' due to invalid value 'garbage'
[12 Jul 2010 4:37] Jimmy Yang
we will issue a warning as stated above. However, we will not refuse the the server to start due to following reason:

1) It remains to have the same behavior as in 5.1. server would allow to be boot up even if there is invalid value.

2) We observe the same behavior with all other bool type read-only variables, there is no such priority that warrant this variable to be special treated.

thanks
[12 Jul 2010 16:55] Paul DuBois
A warning should be fine, that gives the user feedback about what's going on. Thanks!
[13 Jul 2010 10:00] 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/commits/113437

3134 Jimmy Yang	2010-07-13
      Fix Bug #55095 innodb_file_format_check: no warning for illegal value
      
      rb://397 approved by Sunny Bains
[4 Aug 2010 7:52] Bugs System
Pushed into mysql-trunk 5.5.6-m3 (revid:alik@sun.com-20100731131027-1n61gseejyxsqk5d) (version source revid:alik@sun.com-20100731074942-o840woifuqioxxe4) (merge vers: 5.5.6-m3) (pib:18)
[4 Aug 2010 7:55] Bugs System
Pushed into mysql-trunk 5.5.6-m3 (revid:alik@sun.com-20100731131027-1n61gseejyxsqk5d) (version source revid:alik@sun.com-20100731074942-o840woifuqioxxe4) (merge vers: 5.5.6-m3) (pib:18)
[4 Aug 2010 7:56] Bugs System
Pushed into mysql-trunk 5.5.6-m3 (revid:alik@sun.com-20100731131027-1n61gseejyxsqk5d) (version source revid:alik@sun.com-20100731074942-o840woifuqioxxe4) (merge vers: 5.5.6-m3) (pib:18)
[4 Aug 2010 7:57] Bugs System
Pushed into mysql-trunk 5.5.6-m3 (revid:alik@sun.com-20100731131027-1n61gseejyxsqk5d) (version source revid:alik@sun.com-20100731074942-o840woifuqioxxe4) (merge vers: 5.5.6-m3) (pib:18)
[4 Aug 2010 7:58] Bugs System
Pushed into mysql-trunk 5.5.6-m3 (revid:alik@sun.com-20100731131027-1n61gseejyxsqk5d) (version source revid:alik@sun.com-20100731074942-o840woifuqioxxe4) (merge vers: 5.5.6-m3) (pib:18)
[4 Aug 2010 7:59] Bugs System
Pushed into mysql-trunk 5.5.6-m3 (revid:alik@sun.com-20100731131027-1n61gseejyxsqk5d) (version source revid:alik@sun.com-20100731074942-o840woifuqioxxe4) (merge vers: 5.5.6-m3) (pib:18)
[4 Aug 2010 8:00] Bugs System
Pushed into mysql-trunk 5.5.6-m3 (revid:alik@sun.com-20100731131027-1n61gseejyxsqk5d) (version source revid:alik@sun.com-20100731074942-o840woifuqioxxe4) (merge vers: 5.5.6-m3) (pib:18)
[4 Aug 2010 8:06] Bugs System
Pushed into mysql-trunk 5.6.1-m4 (revid:alik@ibmvm-20100804080001-bny5271e65xo34ig) (version source revid:alik@sun.com-20100731075120-qz9z8c25zum2wgmm) (merge vers: 5.6.99-m4) (pib:18)
[4 Aug 2010 8:13] Bugs System
Pushed into mysql-trunk 5.6.1-m4 (revid:alik@ibmvm-20100804080001-bny5271e65xo34ig) (version source revid:alik@sun.com-20100731075120-qz9z8c25zum2wgmm) (merge vers: 5.6.99-m4) (pib:18)
[4 Aug 2010 8:14] Bugs System
Pushed into mysql-trunk 5.6.1-m4 (revid:alik@ibmvm-20100804080001-bny5271e65xo34ig) (version source revid:alik@sun.com-20100731075120-qz9z8c25zum2wgmm) (merge vers: 5.6.99-m4) (pib:18)
[4 Aug 2010 8:15] Bugs System
Pushed into mysql-trunk 5.6.1-m4 (revid:alik@ibmvm-20100804080001-bny5271e65xo34ig) (version source revid:alik@sun.com-20100731075120-qz9z8c25zum2wgmm) (merge vers: 5.6.99-m4) (pib:18)
[4 Aug 2010 8:16] Bugs System
Pushed into mysql-trunk 5.6.1-m4 (revid:alik@ibmvm-20100804080001-bny5271e65xo34ig) (version source revid:alik@sun.com-20100731075120-qz9z8c25zum2wgmm) (merge vers: 5.6.99-m4) (pib:18)
[4 Aug 2010 8:17] Bugs System
Pushed into mysql-trunk 5.6.1-m4 (revid:alik@ibmvm-20100804080001-bny5271e65xo34ig) (version source revid:alik@sun.com-20100731075120-qz9z8c25zum2wgmm) (merge vers: 5.6.99-m4) (pib:18)
[4 Aug 2010 8:22] Bugs System
Pushed into mysql-trunk 5.6.1-m4 (revid:alik@ibmvm-20100804081533-c1d3rbipo9e8rt1s) (version source revid:alik@sun.com-20100731075120-qz9z8c25zum2wgmm) (merge vers: 5.6.99-m4) (pib:18)
[4 Aug 2010 9:00] Bugs System
Pushed into mysql-trunk 5.6.1-m4 (revid:alik@ibmvm-20100804081533-c1d3rbipo9e8rt1s) (version source revid:alik@sun.com-20100731075120-qz9z8c25zum2wgmm) (merge vers: 5.6.99-m4) (pib:20)
[4 Aug 2010 9:02] Bugs System
Pushed into mysql-next-mr (revid:alik@ibmvm-20100804081630-ntapn8bf9pko9vj3) (version source revid:alik@sun.com-20100731075120-qz9z8c25zum2wgmm) (pib:20)
[30 Sep 2010 20:09] Paul DuBois
Noted in 5.5.6, 5.6.1 changelogs.

InnoDB produced no warning at startup about illegal
innodb_file_format_check values.