mirror of
https://github.com/MariaDB/server.git
synced 2025-01-28 09:44:17 +01:00
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().
This commit is contained in:
parent
3fa3561066
commit
c4b35f9279
1 changed files with 3 additions and 7 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue