summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@mariadb.com>2016-10-28 15:50:13 -0400
committerNirbhay Choubey <nirbhay@mariadb.com>2016-10-28 15:50:13 -0400
commit5db2195a35c0a2ee7703ab603721b2f0987d2585 (patch)
tree1306ce565f0f01f56dd31b2c43b1233bcb08257c /mysys
parentc9ded859a6fad25fc513d3a0c7d17f826e567691 (diff)
parenteca8c324e9a02f530853580991b11b587f54b24a (diff)
downloadmariadb-git-5db2195a35c0a2ee7703ab603721b2f0987d2585.tar.gz
Merge tag 'mariadb-10.0.28' into 10.0-galera
Diffstat (limited to 'mysys')
-rw-r--r--mysys/my_fopen.c6
-rw-r--r--mysys/my_redel.c7
-rw-r--r--mysys/my_static.c1
3 files changed, 8 insertions, 6 deletions
diff --git a/mysys/my_fopen.c b/mysys/my_fopen.c
index 409f1bfc9dd..a24f5161168 100644
--- a/mysys/my_fopen.c
+++ b/mysys/my_fopen.c
@@ -102,6 +102,7 @@ static FILE *my_win_freopen(const char *path, const char *mode, FILE *stream)
HANDLE osfh;
DBUG_ASSERT(path && stream);
+ DBUG_ASSERT(strchr(mode, 'a')); /* We use FILE_APPEND_DATA below */
/* Services don't have stdout/stderr on Windows, so _fileno returns -1. */
if (fd < 0)
@@ -112,15 +113,14 @@ static FILE *my_win_freopen(const char *path, const char *mode, FILE *stream)
fd= _fileno(stream);
}
- if ((osfh= CreateFile(path, GENERIC_READ | GENERIC_WRITE,
+ if ((osfh= CreateFile(path, GENERIC_READ | FILE_APPEND_DATA,
FILE_SHARE_READ | FILE_SHARE_WRITE |
FILE_SHARE_DELETE, NULL,
OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL,
NULL)) == INVALID_HANDLE_VALUE)
return NULL;
- if ((handle_fd= _open_osfhandle((intptr_t)osfh,
- _O_APPEND | _O_TEXT)) == -1)
+ if ((handle_fd= _open_osfhandle((intptr_t)osfh, _O_TEXT)) == -1)
{
CloseHandle(osfh);
return NULL;
diff --git a/mysys/my_redel.c b/mysys/my_redel.c
index 61e61b40791..976fc5a18c3 100644
--- a/mysys/my_redel.c
+++ b/mysys/my_redel.c
@@ -1,5 +1,5 @@
-/*
- Copyright (c) 2000, 2010, Oracle and/or its affiliates
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates
+ Copyright (c) 2009, 2016, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -49,7 +49,8 @@ int my_redel(const char *org_name, const char *tmp_name,
DBUG_PRINT("my",("org_name: '%s' tmp_name: '%s' MyFlags: %lu",
org_name,tmp_name,MyFlags));
- if (my_copystat(org_name,tmp_name,MyFlags) < 0)
+ if (!my_disable_copystat_in_redel &&
+ my_copystat(org_name,tmp_name,MyFlags) < 0)
goto end;
if (MyFlags & MY_REDEL_MAKE_BACKUP)
{
diff --git a/mysys/my_static.c b/mysys/my_static.c
index 4aca78e30a9..9236c1395fb 100644
--- a/mysys/my_static.c
+++ b/mysys/my_static.c
@@ -98,3 +98,4 @@ my_bool my_disable_sync=0;
my_bool my_disable_async_io=0;
my_bool my_disable_flush_key_blocks=0;
my_bool my_disable_symlinks=0;
+my_bool my_disable_copystat_in_redel=0;