#At file:///D:/source/bzr/mysql-6.0-bug-46415/ based on revid:rafal.somla@stripped
2853 Chuck Bell 2009-08-04
BUG#46415 : Invalid backup log file error suppressed
A problem occurred on systems where a filename of 256 characters was
too long for some operating environments (i.e. Windows with Cygwin.
This error was being suppressed because it originated in the
set_var.cc @ line#2795, 2798 on the open_backup_*_log() call.
This patch allows that method's return code to be returned to the
caller thus if the open() fails, the error will be reported. This
error does not occur on all platforms hence the error capture in
the test file.
@ mysql-test/suite/backup/r/backup_logs.result
Corrected result file.
@ mysql-test/suite/backup/t/backup_logs.test
Added test for 127 characters (ok for all platforms).
Added error capture for failure on Windows when running under Cygwin.
modified:
mysql-test/suite/backup/r/backup_logs.result
mysql-test/suite/backup/t/backup_logs.test
sql/set_var.cc
=== modified file 'mysql-test/suite/backup/r/backup_logs.result'
--- a/mysql-test/suite/backup/r/backup_logs.result 2009-07-28 06:25:23 +0000
+++ b/mysql-test/suite/backup/r/backup_logs.result 2009-08-04 20:12:18 +0000
@@ -371,6 +371,10 @@ Attempt to set the backup log paths to a
SET global max_allowed_packet=1024*100;
+Now attempt to set the backup_progress_log_file to 127 characters.
+
+SET @@global.backup_progress_log_file = repeat('a',127);
+
Now attempt to set the backup_progress_log_file to 255 characters.
SET @@global.backup_progress_log_file = repeat('a',255);
@@ -386,7 +390,11 @@ SET @@global.backup_progress_log_file =
ERROR HY000: The path specified for backup_progress_log_file is too long.
SET @@global.backup_progress_log_file = DEFAULT;
-Now attempt to set the backup_history_log_file to 255 characters.
+Now attempt to set the backup_history_log_file to 127 characters.
+
+SET @@global.backup_history_log_file = repeat('a',127);
+
+Now attempt to set the backup_progress_log_file to 255 characters.
SET @@global.backup_history_log_file = repeat('a',255);
=== modified file 'mysql-test/suite/backup/t/backup_logs.test'
--- a/mysql-test/suite/backup/t/backup_logs.test 2009-07-28 06:25:23 +0000
+++ b/mysql-test/suite/backup/t/backup_logs.test 2009-08-04 20:12:18 +0000
@@ -511,8 +511,18 @@ BACKUP DATABASE backup_logs to 'backup_l
SET global max_allowed_packet=1024*100;
--echo
+--echo Now attempt to set the backup_progress_log_file to 127 characters.
+--echo
+SET @@global.backup_progress_log_file = repeat('a',127);
+
+--echo
--echo Now attempt to set the backup_progress_log_file to 255 characters.
--echo
+#
+# Errors can occur on platforms with shorter filename (like Cygwin
+# on Windows).
+#
+--error 0,29
SET @@global.backup_progress_log_file = repeat('a',255);
--echo
@@ -529,8 +539,18 @@ SET @@global.backup_progress_log_file =
SET @@global.backup_progress_log_file = DEFAULT;
--echo
---echo Now attempt to set the backup_history_log_file to 255 characters.
+--echo Now attempt to set the backup_history_log_file to 127 characters.
--echo
+SET @@global.backup_history_log_file = repeat('a',127);
+
+--echo
+--echo Now attempt to set the backup_progress_log_file to 255 characters.
+--echo
+#
+# Errors can occur on platforms with shorter filename (like Cygwin
+# on Windows).
+#
+--error 0,29
SET @@global.backup_history_log_file = repeat('a',255);
--echo
=== modified file 'sql/set_var.cc'
--- a/sql/set_var.cc 2009-07-10 12:31:32 +0000
+++ b/sql/set_var.cc 2009-08-04 20:12:18 +0000
@@ -2795,10 +2795,10 @@ bool update_sys_var_str_path(THD *thd, s
Open the backup logs if specified.
*/
case BACKUP_HISTORY_LOG:
- backup_log->open_backup_history_log(res);
+ result= backup_log->open_backup_history_log(res);
break;
case BACKUP_PROGRESS_LOG:
- backup_log->open_backup_progress_log(res);
+ result= backup_log->open_backup_progress_log(res);
break;
default:
DBUG_ASSERT(0);
Attachment: [text/bzr-bundle] bzr/charles.bell@sun.com-20090804201218-nzctzb3e07xrayf7.bundle