List:Commits« Previous MessageNext Message »
From:Chuck Bell Date:November 4 2008 9:45pm
Subject:bzr commit into mysql-6.0-backup branch (cbell:2727) Bug#40219
View as plain text  
#At file:///C:/source/bzr/mysql-6.0-bug-40219/

 2727 Chuck Bell	2008-11-04
      BUG#40219 : backup_{history,progress}_log_file not settable at server startup
      
      The backup_history_log_file and backup_progress_log_file options are not exposed
      for server startup. This patch exposes those options for setting values on
      the command line at server startup.
modified:
  mysql-test/suite/backup/r/backup_logs_output.result
  mysql-test/suite/backup/t/backup_logs_output.test
  sql/mysqld.cc
  sql/set_var.cc

per-file messages:
  mysql-test/suite/backup/r/backup_logs_output.result
    Corrected result file.
  mysql-test/suite/backup/t/backup_logs_output.test
    Added test to ensure the command line startup options for
    backup_*_log_file work as expected.
  sql/mysqld.cc
    Added startup options for backup_*_log_file variables.
  sql/set_var.cc
    Corrected error in setting default value for backup_*_log_file variables.
=== modified file 'mysql-test/suite/backup/r/backup_logs_output.result'
--- a/mysql-test/suite/backup/r/backup_logs_output.result	2008-10-07 17:15:44 +0000
+++ b/mysql-test/suite/backup/r/backup_logs_output.result	2008-11-04 21:45:12 +0000
@@ -1,5 +1,29 @@
 con1
-Display backup variables
+Display backup variable values from startup options file.
+SHOW VARIABLES LIKE 'backup_history%';
+Variable_name	Value
+backup_history_log	ON
+backup_history_log_file	MYSQLTEST_VARDIR/master-data/history.txt
+SHOW VARIABLES LIKE 'backup_progress%';
+Variable_name	Value
+backup_progress_log	ON
+backup_progress_log_file	MYSQLTEST_VARDIR/master-data/progress.txt
+SHOW VARIABLES LIKE 'log_backup_output';
+Variable_name	Value
+log_backup_output	FILE
+Set the backup log file names to default values.
+SET @@global.backup_history_log_file = DEFAULT;
+SET @@global.backup_progress_log_file = DEFAULT;
+SET @@global.log_backup_output = 'TABLE';
+See that the log names have been reset.
+SHOW VARIABLES LIKE 'backup_history%';
+Variable_name	Value
+backup_history_log	ON
+backup_history_log_file	MYSQLTEST_VARDIR/master-data/backup_history.log
+SHOW VARIABLES LIKE 'backup_progress%';
+Variable_name	Value
+backup_progress_log	ON
+backup_progress_log_file	MYSQLTEST_VARDIR/master-data/backup_progress.log
 SHOW VARIABLES LIKE 'backup_history_log';
 Variable_name	Value
 backup_history_log	ON

=== modified file 'mysql-test/suite/backup/t/backup_logs_output.test'
--- a/mysql-test/suite/backup/t/backup_logs_output.test	2008-10-07 17:15:44 +0000
+++ b/mysql-test/suite/backup/t/backup_logs_output.test	2008-11-04 21:45:12 +0000
@@ -11,7 +11,27 @@ connect (con1,localhost,root,,,,);
 --echo con1
 connection con1;
 
---echo Display backup variables
+#
+# BUG#40219 No startup options for backup_*_logname.
+#
+--echo Display backup variable values from startup options file.
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+SHOW VARIABLES LIKE 'backup_history%';
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+SHOW VARIABLES LIKE 'backup_progress%';
+SHOW VARIABLES LIKE 'log_backup_output';
+
+--echo Set the backup log file names to default values.
+SET @@global.backup_history_log_file = DEFAULT;
+SET @@global.backup_progress_log_file = DEFAULT;
+SET @@global.log_backup_output = 'TABLE';
+
+--echo See that the log names have been reset.
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+SHOW VARIABLES LIKE 'backup_history%';
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+SHOW VARIABLES LIKE 'backup_progress%';
+
 SHOW VARIABLES LIKE 'backup_history_log';
 SHOW VARIABLES LIKE 'backup_progress_log';
 SHOW VARIABLES LIKE 'log_backup_output';

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2008-10-28 18:14:14 +0000
+++ b/sql/mysqld.cc	2008-11-04 21:45:12 +0000
@@ -5861,7 +5861,9 @@ enum options_mysqld
   OPT_DEADLOCK_SEARCH_DEPTH_SHORT,
   OPT_DEADLOCK_SEARCH_DEPTH_LONG,
   OPT_DEADLOCK_TIMEOUT_SHORT,
-  OPT_DEADLOCK_TIMEOUT_LONG
+  OPT_DEADLOCK_TIMEOUT_LONG,
+  OPT_BACKUP_HISTORY_LOG_FILE,
+  OPT_BACKUP_PROGRESS_LOG_FILE
 };
 
 
@@ -6129,6 +6131,16 @@ Disable with --skip-large-pages.",
   {"general_log_file", OPT_GENERAL_LOG_FILE,
    "Log connections and queries to given file.", (uchar**) &opt_logname,
    (uchar**) &opt_logname, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"backup_history_log_file", OPT_BACKUP_HISTORY_LOG_FILE,
+   "Log backup history to a given file.", 
+   (uchar**) &opt_backup_history_logname,
+   (uchar**) &opt_backup_history_logname, 0, GET_STR, 
+   REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"backup_progress_log_file", OPT_BACKUP_PROGRESS_LOG_FILE,
+   "Log backup progress to a given file.", 
+   (uchar**) &opt_backup_progress_logname,
+   (uchar**) &opt_backup_progress_logname, 0, GET_STR, 
+   REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"log-bin", OPT_BIN_LOG,
    "Log update queries in binary format. Optional (but strongly recommended "
    "to avoid replication problems if server's hostname changes) argument "

=== modified file 'sql/set_var.cc'
--- a/sql/set_var.cc	2008-10-28 18:14:14 +0000
+++ b/sql/set_var.cc	2008-11-04 21:45:12 +0000
@@ -2652,7 +2652,8 @@ bool update_sys_var_str_path(THD *thd, s
   var_str->value= res;
   var_str->value_length= str_length;
   my_free(old_value, MYF(MY_ALLOW_ZERO_PTR));
-  if (file_log && log_state)
+  if ((file_log && log_state) ||
+      (backup_log && log_state))
   {
     /*
       Added support for backup log types.

Thread
bzr commit into mysql-6.0-backup branch (cbell:2727) Bug#40219Chuck Bell4 Nov
  • Re: bzr commit into mysql-6.0-backup branch (cbell:2727) Bug#40219Øystein Grøvlen6 Nov