Bug #57972 mysqld --help --verbose does not always list all optimizer_switch flags
Submitted: 4 Nov 2010 11:21 Modified: 4 Nov 2010 12:21
Reporter: Olav Sandstå Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Options Severity:S3 (Non-critical)
Version:5.5.8,5.6.1-m4,5.6.99-m5 OS:Any
Assigned to: CPU Architecture:Any

[4 Nov 2010 11:21] Olav Sandstå
Description:
Running the command "mysqld --help --verbose" gives a list of all
configuration variables with default values. One of these
configuration variables is "optimizer_switch". In some cases the list
of valied flags this can take gets "truncated". It seems like if the
following conditions is ful-filled then the optimzier_switch flag is
not written:

  1. The value of the optimizer_switch flag is off
  2. It is either the last on the list of optimzer_switch flags or all
     flags listed after it is off

To illustrate this:

1. Run mysqld --help --verbose without changing any default values:

   ./sql/mysqld --no-defaults --help --verbose

   This lists in the help output for "optimizer-switch":

   index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on

   This is correct (good)

2. Disable two of these switches (one "in the middle" and the last one):

   ./sql/mysqld --no-defaults --optimizer-switch="index_merge_sort_union=off,engine_condition_pushdown=off" --help --verbose

   This lists in the output for "optimizer-switch":

   index_merge=on,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on

   This does not look correct:

    -the index_merge_sort_union flag is listed as off (good)
    -the engine_condtion_pushdown flag is not lasted (bad)

   This is inconsistent treatment of the flags with value off (bad).

3. Disable multiple switches on the end of the list:

   ./sql/mysqld --no-defaults --optimizer-switch="index_merge_sort_union=off,index_merge_intersection=off,engine_condition_pushdown=off" --help --verbose

   This lists in the output for "optimizer-switch":

   index_merge=on,index_merge_union=on

   This does not look correct:

   -none of the flags with value off gets listed (bad)

How to repeat:
See above.

Suggested fix:
All optimizer_switch flags should get written when running mysqld --help --verbose.
[4 Nov 2010 12:21] MySQL Verification Team
Thank you for the bug report.