summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
Diffstat (limited to 'mysys')
-rw-r--r--mysys/mf_iocache.c4
-rw-r--r--mysys/my_rename.c15
2 files changed, 7 insertions, 12 deletions
diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c
index 2008a6f8860..a3cbaff68b0 100644
--- a/mysys/mf_iocache.c
+++ b/mysys/mf_iocache.c
@@ -1281,10 +1281,6 @@ read_append_buffer:
size_t transfer_len;
DBUG_ASSERT(info->append_read_pos <= info->write_pos);
- /*
- TODO: figure out if the assert below is needed or correct.
- */
- DBUG_ASSERT(pos_in_file == info->end_of_file);
copy_len=MY_MIN(Count, len_in_buff);
memcpy(Buffer, info->append_read_pos, copy_len);
info->append_read_pos += copy_len;
diff --git a/mysys/my_rename.c b/mysys/my_rename.c
index 8a9e6eb3dfd..09e7eafa980 100644
--- a/mysys/my_rename.c
+++ b/mysys/my_rename.c
@@ -27,19 +27,18 @@ int my_rename(const char *from, const char *to, myf MyFlags)
DBUG_ENTER("my_rename");
DBUG_PRINT("my",("from %s to %s MyFlags %lu", from, to, MyFlags));
-#if defined(HAVE_RENAME)
#if defined(__WIN__)
- /*
- On windows we can't rename over an existing file:
- Remove any conflicting files:
- */
- (void) my_delete(to, MYF(0));
-#endif
+ if (!MoveFileEx(from, to, MOVEFILE_COPY_ALLOWED |
+ MOVEFILE_REPLACE_EXISTING))
+ {
+ my_osmaperr(GetLastError());
+#elif defined(HAVE_RENAME)
if (rename(from,to))
+ {
#else
if (link(from, to) || unlink(from))
-#endif
{
+#endif
my_errno=errno;
error = -1;
if (MyFlags & (MY_FAE+MY_WME))