MySQLConfig

MySQLConfig parses and encapsulates system variables and values from SHOW VARIABLES, option files, mysqld --help --verbose or my_print_defaults.  A MySQLConfig object represents how MySQL is or would be configured given one of those inputs.  If the input is SHOW VARIABLES, then the config is acive, i.e. MySQL’s running config.  All other inputs are inactive, i.e. how MySQL should or would be running if started with the config.

Inactive configs are made to mimic SHOW VARIABLES so that MySQLConfig objects can be reliably compared with MySQLConfigComparer.  This is necessary because the inputs are different in how they list values, how they treat variables with optional values, etc.

Only variables present in the input are saved in the MySQLConfig object.  So if has() returns false, then the variable did not appear in the input.

Variables

%can_be_duplicate

my %can_be_duplicate

Functions

new

sub new

Parameters

%argsArguments

Arguments

fileFilename of an option file, or containing output of mysqld --help --verbose, my_print_defaults or SHOW VARIABLES
outputText output of one of ^ if you want to slurp the file manually
result_setArrayref of SHOW VARIABLES
dbhdbh to get SHOW VARIABLES from
TextResultSetParserTextResultSetParser object if file or output arg is given

Returns

MySQLConfig object

_parse_config

sub _parse_config

_parse_config_output

sub _parse_config_output

detect_config_output_format

sub detect_config_output_format

parse_show_variables

sub parse_show_variables

parse_mysqld

sub parse_mysqld

parse_my_print_defaults

sub parse_my_print_defaults

parse_option_file

sub parse_option_file

_parse_varvals

sub _parse_varvals

_mimic_show_variables

sub _mimic_show_variables

Make the variables’ values mimic SHOW VARIABLES.  Different output formats list values differently.  To make comparisons easier, outputs are made to mimic SHOW VARIABLES.

Parameters

%argsArguments

Required Arguments

varsHashref of variables-values
formatConfig output format (mysqld, option_file, etc.)

_slurp_file

sub _slurp_file

_get_version

sub _get_version

has

sub has

value_of

sub value_of

variables

sub variables

duplicate_variables

sub duplicate_variables

option_files

sub option_files

mysql_version

sub mysql_version

format

sub format

is_active

sub is_active

_d

sub _d
my %can_be_duplicate
sub new
sub _parse_config
sub _parse_config_output
sub detect_config_output_format
sub parse_show_variables
sub parse_mysqld
sub parse_my_print_defaults
sub parse_option_file
sub _parse_varvals
sub _mimic_show_variables
Make the variables’ values mimic SHOW VARIABLES.
sub _slurp_file
sub _get_version
sub has
sub value_of
sub variables
sub duplicate_variables
sub option_files
sub mysql_version
sub format
sub is_active
sub _d
TextResultSetParser converts a text result set to a data struct like DBI::selectall_arrayref().
Close