Bug #28780 report_host is not available through SELECT @@report_host

There was no way to see if report-{host,port,user,password} were set up.

Fixed with introducing new global variables.
The variables are made read-only because of a possible need to change them
most probably require the slave server restart.

Todo: transform the startup options to be CHANGE master parameters - i.e
to deprecate `report-' options, and to change the new vars 
to be updatable at time of CHANGE master executes with new
values.


sql/set_var.cc:
  Adding associations of the server init arguments with the new global read-only
  variables.
mysql-test/suite/rpl/r/rpl_report.result:
  new results file
mysql-test/suite/rpl/t/rpl_report-slave.opt:
  options initialize the new global variables.
mysql-test/suite/rpl/t/rpl_report.test:
  The new test to check SHOW-ability and SELECT-ablity for the report
  global vars.
This commit is contained in:
unknown 2008-03-05 12:25:55 +02:00
commit 657ef27076
4 changed files with 60 additions and 0 deletions

View file

@ -648,6 +648,19 @@ sys_var_thd_time_zone sys_time_zone(&vars, "time_zone");
/* Global read-only variable containing hostname */
static sys_var_const_str sys_hostname(&vars, "hostname", glob_hostname);
static sys_var_const_str_ptr sys_repl_report_host(&vars, "report_host", &report_host);
static sys_var_const_str_ptr sys_repl_report_user(&vars, "report_user", &report_user);
static sys_var_const_str_ptr sys_repl_report_password(&vars, "report_password", &report_password);
static uchar *slave_get_report_port(THD *thd)
{
thd->sys_var_tmp.long_value= report_port;
return (uchar*) &thd->sys_var_tmp.long_value;
}
static sys_var_readonly sys_repl_report_port(&vars, "report_port", OPT_GLOBAL, SHOW_INT, slave_get_report_port);
sys_var_thd_bool sys_keep_files_on_create(&vars, "keep_files_on_create",
&SV::keep_files_on_create);