Bug #57972 mysqld --help --verbose does not always list all optimizer_switch flags
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.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.039 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.
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.