#At file:///ext/mysql/bzr/backup/bug40262/
2733 Rafal Somla 2008-11-14
BUG#40262 (Binary log information incorrect in backup of no data with binlog
turned on)
This is a preliminary patch which fixes a problem in si_log.h which leads to a
carash reported in the bug. According to specifications, methods
Backup_log::binlog_file() and Backup_log::master_binlog_file() should do nothing
if NULL string is passed as the argument. But they crashed instead (due to a
call to strlen() on NULL string). This patch fixes this.
modified:
sql/si_logs.h
=== modified file 'sql/si_logs.h'
--- a/sql/si_logs.h 2008-10-30 17:53:24 +0000
+++ b/sql/si_logs.h 2008-11-14 14:49:09 +0000
@@ -201,7 +201,7 @@ void Backup_log::stop(time_t when)
inline
void Backup_log::binlog_file(char *file)
{
- if (strlen(file) > 0)
+ if (file && strlen(file) > 0)
m_op_hist.binlog_file= file;
}
@@ -217,7 +217,7 @@ void Backup_log::binlog_file(char *file)
inline
void Backup_log::master_binlog_file(char *file)
{
- if (strlen(file) > 0)
+ if (file && strlen(file) > 0)
m_op_hist.master_binlog_file= file;
}