summaryrefslogtreecommitdiff
path: root/sql/log.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-10-06 19:53:55 +0200
committerSergei Golubchik <sergii@pisem.net>2014-10-06 19:53:55 +0200
commit1ddfce4840994b6b79a3f426fcedf8f0469334ac (patch)
tree4a5700c90dacb63f00a8d130e94ba0398b2ee371 /sql/log.cc
parentc0977073e18d070810c20026defc63794154e288 (diff)
parent3139aa87b4f215418740939cc8d156150c355823 (diff)
downloadmariadb-git-1ddfce4840994b6b79a3f426fcedf8f0469334ac.tar.gz
mysql-5.5.40
Diffstat (limited to 'sql/log.cc')
-rw-r--r--sql/log.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/log.cc b/sql/log.cc
index e860d030be3..b639ff8115e 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -2357,6 +2357,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");
@@ -2374,6 +2375,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