diff options
Diffstat (limited to 'sql/log.cc')
-rw-r--r-- | sql/log.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/log.cc b/sql/log.cc index ac30f69c860..091a294ced8 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -2482,6 +2482,7 @@ bool MYSQL_LOG::open( const char *new_name, enum cache_type io_cache_type_arg) { char buff[FN_REFLEN]; + MY_STAT f_stat; File file= -1; int open_flags= O_CREAT | O_BINARY; DBUG_ENTER("MYSQL_LOG::open"); @@ -2499,6 +2500,10 @@ bool MYSQL_LOG::open( log_type_arg, io_cache_type_arg)) goto err; + /* File is regular writable file */ + if (my_stat(log_file_name, &f_stat, MYF(0)) && !MY_S_ISREG(f_stat.st_mode)) + goto err; + if (io_cache_type == SEQ_READ_APPEND) open_flags |= O_RDWR | O_APPEND; else |