From: Date: June 19 2008 4:15pm Subject: bzr commit into mysql-6.0-backup branch (svoj:2638) Bug#37012 List-Archive: http://lists.mysql.com/commits/48179 X-Bug: 37012 Message-Id: <200806191415.m5JEFBXE021430@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit #At file:///home/svoj/devel/mysql/BUG37012/mysql-6.0-backup/ 2638 Sergey Vojtovich 2008-06-19 BUG#37012 - Online backup: Can't backup to a pipe. It was impossible to backup to a pipe. Backup code refuse to overwrite existing files no matter if they're regular files or named pipes. This fix allows to write backup image to existing named pipe. modified: sql/backup/stream.cc per-file messages: sql/backup/stream.cc Allow to write to existing named pipe. === modified file 'sql/backup/stream.cc' --- a/sql/backup/stream.cc 2008-03-04 16:06:28 +0000 +++ b/sql/backup/stream.cc 2008-06-19 14:15:01 +0000 @@ -1,4 +1,5 @@ #include "../mysql_priv.h" +#include "my_dir.h" #include "backup_stream.h" #include "stream.h" @@ -214,7 +215,12 @@ bool Output_stream::init() */ bool Output_stream::open() { + MY_STAT stat_info; close(); + /* Allow to write to existing named pipe */ + if (my_stat(m_path.c_ptr(), &stat_info, MYF(0)) && + MY_S_ISFIFO(stat_info.st_mode)) + m_flags&= ~(O_CREAT|O_EXCL|O_TRUNC); bool ret= Stream::open();