#At file:///home/jonas/src/telco-6.4/
3117 Jonas Oreland 2008-11-19 [merge]
merge 64-win to 64
modified:
mysys/my_rename.c
=== modified file 'mysys/my_rename.c'
--- a/mysys/my_rename.c 2007-10-11 15:07:40 +0000
+++ b/mysys/my_rename.c 2008-11-19 20:31:54 +0000
@@ -47,8 +47,19 @@ int my_rename(const char *from, const ch
#if defined(__WIN__) || defined(__NETWARE__)
/*
On windows we can't rename over an existing file:
- Remove any conflicting files:
+ Remove any conflicting files: but first check that "from" exists
*/
+ {
+ int save_errno;
+ MY_STAT my_stat_result;
+ save_errno=my_errno;
+ if (my_stat(from ,&my_stat_result,MYF(0)) == 0)
+ {
+ my_errno=ENOENT;
+ DBUG_RETURN(-1);
+ }
+ my_errno=save_errno;
+ }
(void) my_delete(to, MYF(0));
#endif
if (rename(from,to))
| Thread |
|---|
| • bzr commit into mysql-5.1 branch (jonas:3117) | Jonas Oreland | 19 Nov |