List:Commits« Previous MessageNext Message »
From:Øystein Grøvlen Date:June 25 2008 4:47pm
Subject:Re: bzr commit into mysql-6.0-backup branch (svoj:2638) Bug#37012
View as plain text  
Sergey,

I think a test for this functionality needs to be included.

I also wonder whether it would be better to put the new code in the 
constructor.  I think putting the m_flags logic in one place instead of 
spreading it, would make the code easier to understand.

--
Øystein

Sergey Vojtovich wrote:
> #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();
>  
> 
> 

Thread
bzr commit into mysql-6.0-backup branch (svoj:2638) Bug#37012Sergey Vojtovich19 Jun
  • Re: bzr commit into mysql-6.0-backup branch (svoj:2638) Bug#37012Rafal Somla23 Jun
  • Re: bzr commit into mysql-6.0-backup branch (svoj:2638) Bug#37012Øystein Grøvlen25 Jun
    • Re: bzr commit into mysql-6.0-backup branch (svoj:2638) Bug#37012Rafal Somla26 Jun
      • Re: bzr commit into mysql-6.0-backup branch (svoj:2638) Bug#37012Øystein Grøvlen27 Jun
        • Re: bzr commit into mysql-6.0-backup branch (svoj:2638) Bug#37012Rafal Somla27 Jun
Re: bzr commit into mysql-6.0-backup branch (svoj:2638) Bug#37012Øystein Grøvlen26 Jun