On 09/20/2010 08:04 PM, Alfranio Correia wrote:
> Hi Mats,
>
> Patch approved pending changes.
>
> SUGGESTIONS
> -----------
>
> 1 - Change the message "File that holds the names for last binary log
> files."
> See comments in-line.
OK.
>
> 2 - Please, add a test case to extract the name and location of the
> log-bin-index
> as you sent in the internal email "System variables relay_log_index
> (and log_bin_index)
> values and usage".
This was a suggestion for an extension that we should do and not
something that I was suggesting as part of this worklog.
Hmm... looking at the worklog it seems I actually had that in the design. :D
So, shall we use this worklog to implement the full proposal in the mail
you reference?
/Matz
>
>
> Cheers.
>
>
> On 09/15/2010 10:21 AM, Mats Kindahl wrote:
>> #At file:///home/bzr/mkindahl/w5465-trunk/ based on
>> revid:dlenev@stripped
>>
>> 3197 Mats Kindahl 2010-09-15
>> WL#5465: System variable: binlog index path
>>
>> Currently, the value of relay-log-index is available as the
>> variable relay_log_index,
>> but not the value of log-bin-index.
>>
>> This patch make the value of the log-bin-index option
>> available as a system variable.
>>
>> modified:
>> mysql-test/suite/rpl/r/rpl_variables.result
>> mysql-test/suite/rpl/t/rpl_variables.test
>> sql/mysqld.cc
>> sql/rpl_slave.h
>> sql/sys_vars.cc
>> === modified file 'mysql-test/suite/rpl/r/rpl_variables.result'
>> --- a/mysql-test/suite/rpl/r/rpl_variables.result 2008-08-14
>> 09:38:22 +0000
>> +++ b/mysql-test/suite/rpl/r/rpl_variables.result 2010-09-15
>> 09:21:49 +0000
>> @@ -47,6 +47,10 @@ include/start_slave.inc
>> [on slave]
>> SET @@global.init_slave = 'SELECT 1';
>> [on master]
>> +SELECT @@relay_log_index, @@log_bin_index, @@pid_file;
>> +@@relay_log_index mysqld-slave.index
>> +@@log_bin_index mysqld-master.index
>> +@@pid_file
>> /home/bzr/mkindahl/w5465-trunk/mysql-test/var/run/mysqld.1.pid
>> CREATE TABLE tstmt (id INT AUTO_INCREMENT PRIMARY KEY,
>> truth BOOLEAN,
>> num INT,
>>
>> === modified file 'mysql-test/suite/rpl/t/rpl_variables.test'
>> --- a/mysql-test/suite/rpl/t/rpl_variables.test 2008-07-17
>> 16:26:59 +0000
>> +++ b/mysql-test/suite/rpl/t/rpl_variables.test 2010-09-15
>> 09:21:49 +0000
>> @@ -122,6 +122,9 @@ SET @@global.init_slave = 'SELECT 1';
>>
>> --echo [on master]
>> connection master;
>> +# checking values of read-only variables
>> +query_vertical SELECT @@relay_log_index, @@log_bin_index, @@pid_file;
>> +
>>
>> # Tables where everything happens.
>> CREATE TABLE tstmt (id INT AUTO_INCREMENT PRIMARY KEY,
>>
>> === modified file 'sql/mysqld.cc'
>> --- a/sql/mysqld.cc 2010-09-01 13:05:01 +0000
>> +++ b/sql/mysqld.cc 2010-09-15 09:21:49 +0000
>> @@ -656,7 +656,8 @@ static my_bool opt_do_pstack;
>> static my_bool opt_bootstrap, opt_myisam_log;
>> static int cleanup_done;
>> static ulong opt_specialflag;
>> -static char *opt_update_logname, *opt_binlog_index_name;
>> +static char *opt_update_logname;
>> +char *opt_binlog_index_name;
>> char *mysql_home_ptr, *pidfile_name_ptr;
>> /** Initial command line arguments (count), after load_defaults().*/
>> static int defaults_argc;
>> @@ -5938,10 +5939,6 @@ struct my_option my_long_options[]=
>> "should be the chosen location for the binary log files.",
>> &opt_bin_logname,&opt_bin_logname, 0, GET_STR_ALLOC,
>> OPT_ARG, 0, 0, 0, 0, 0, 0},
>> - {"log-bin-index", 0,
>> - "File that holds the names for last binary log files.",
>> -&opt_binlog_index_name,&opt_binlog_index_name, 0, GET_STR,
>> - REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
>> {"log-isam", OPT_ISAM_LOG, "Log all MyISAM changes to file.",
>> &myisam_log_filename,&myisam_log_filename, 0, GET_STR,
>> OPT_ARG, 0, 0, 0, 0, 0, 0},
>>
>> === modified file 'sql/rpl_slave.h'
>> --- a/sql/rpl_slave.h 2010-07-19 16:09:51 +0000
>> +++ b/sql/rpl_slave.h 2010-09-15 09:21:49 +0000
>> @@ -125,6 +125,7 @@ extern bool use_slave_mask;
>> extern char *slave_load_tmpdir;
>> extern char *master_info_file, *relay_log_info_file;
>> extern char *opt_relay_logname, *opt_relaylog_index_name;
>> +extern char *opt_binlog_index_name;
>> extern my_bool opt_skip_slave_start, opt_reckless_slave;
>> extern my_bool opt_log_slave_updates;
>> extern char *opt_slave_skip_errors;
>>
>> === modified file 'sql/sys_vars.cc'
>> --- a/sql/sys_vars.cc 2010-09-01 13:05:01 +0000
>> +++ b/sql/sys_vars.cc 2010-09-15 09:21:49 +0000
>> @@ -2887,6 +2887,11 @@ static Sys_var_charptr Sys_relay_log_ind
>> READ_ONLY GLOBAL_VAR(opt_relaylog_index_name),
>> CMD_LINE(REQUIRED_ARG),
>> IN_FS_CHARSET, DEFAULT(0));
>>
>> +static Sys_var_charptr Sys_binlog_index(
>> + "log_bin_index", "File that holds the names for last binary
>> log files.",
>> + READ_ONLY GLOBAL_VAR(opt_binlog_index_name),
>> CMD_LINE(REQUIRED_ARG),
>> + IN_FS_CHARSET, DEFAULT(0));
>> +
>
> Please, use message similar to the relaylog_index_name:
>
> static Sys_var_charptr Sys_relay_log_index(
> "relay_log_index", "The location and name to use for the file "
> "that keeps a list of the last relay logs",
> READ_ONLY GLOBAL_VAR(opt_relaylog_index_name),
> CMD_LINE(REQUIRED_ARG),
> IN_FS_CHARSET, DEFAULT(0));
>
>
>
>
>> static Sys_var_charptr Sys_relay_log_info_file(
>> "relay_log_info_file", "The location and name of the file
>> that "
>> "remembers where the SQL replication thread is in the relay
>> logs",
>>
>>
>>
>>
>>
>