diff options
author | Vladislav Vaintroub <wlad@montyprogram.com> | 2012-12-06 00:37:06 +0100 |
---|---|---|
committer | Vladislav Vaintroub <wlad@montyprogram.com> | 2012-12-06 00:37:06 +0100 |
commit | c4b35f92798f8612edc2d197ecf8a283a9269436 (patch) | |
tree | 6be3c5cae3700b9a4f096192b5697b5598b843f9 /mysys/my_redel.c | |
parent | 3fa356106694857a2e89e3aa135679799cbe7543 (diff) | |
download | mariadb-git-c4b35f92798f8612edc2d197ecf8a283a9269436.tar.gz |
MDEV-3918: myisamchk bogus error for files larger than 4GB.
The failure is caused by failing stat() call . C Runtime function stat() uses old struct with 32bit st_size member,
and since Visual Studio 2010 , it returns an error on st_size overflow (i.e on files larger than 4GB)
Fix replaces stat() by my_stat(), the later is backed by 64bit-able stat64().
Diffstat (limited to 'mysys/my_redel.c')
-rw-r--r-- | mysys/my_redel.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/mysys/my_redel.c b/mysys/my_redel.c index e06511542a3..b048c24d942 100644 --- a/mysys/my_redel.c +++ b/mysys/my_redel.c @@ -89,15 +89,11 @@ end: int my_copystat(const char *from, const char *to, int MyFlags) { - struct stat statbuf; + MY_STAT statbuf; - if (stat(from, &statbuf)) - { - my_errno=errno; - if (MyFlags & (MY_FAE+MY_WME)) - my_error(EE_STAT, MYF(ME_BELL+ME_WAITTANG),from,errno); + if (my_stat(from, &statbuf, MyFlags) == NULL) return -1; /* Can't get stat on input file */ - } + if ((statbuf.st_mode & S_IFMT) != S_IFREG) return 1; |