summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorholyfoot/hf@mysql.com/deer.(none) <>2006-09-04 19:47:24 +0500
committerholyfoot/hf@mysql.com/deer.(none) <>2006-09-04 19:47:24 +0500
commitc32f62bebb609f6a0c2c91c303c15a482a5b28d3 (patch)
treeab01e92f008386033f759954a88640fa0fff6727 /mysys
parent5a0d5670b8fe0f17c8c9033d812076132a81904b (diff)
downloadmariadb-git-c32f62bebb609f6a0c2c91c303c15a482a5b28d3.tar.gz
bug #12620 (UTF-8 indexing causes ER_NO_KEYFILE error)
The problem is that on some Mac OS X-es the file writing/reading call with zero bytes to read/write returns error. So here i try to eliminate that kinds of calls.
Diffstat (limited to 'mysys')
-rw-r--r--mysys/my_chsize.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mysys/my_chsize.c b/mysys/my_chsize.c
index cf26428d65f..efc19927183 100644
--- a/mysys/my_chsize.c
+++ b/mysys/my_chsize.c
@@ -44,7 +44,9 @@ int my_chsize(File fd, my_off_t newlength, int filler, myf MyFlags)
DBUG_PRINT("my",("fd: %d length: %lu MyFlags: %d",fd,(ulong) newlength,
MyFlags));
- oldsize = my_seek(fd, 0L, MY_SEEK_END, MYF(MY_WME+MY_FAE));
+ if ((oldsize = my_seek(fd, 0L, MY_SEEK_END, MYF(MY_WME+MY_FAE))) == newlength)
+ DBUG_RETURN(0);
+
DBUG_PRINT("info",("old_size: %ld", (ulong) oldsize));
if (oldsize > newlength)