summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2012-08-09 17:22:00 +0200
committerSergei Golubchik <sergii@pisem.net>2012-08-09 17:22:00 +0200
commitd11829654c4ef5c3d0f997ca61a50d4bd196db8a (patch)
treee48a5775e961b17600bf9c1c189243deb5515ba7 /mysys
parente022b6ef07529d83e8c1cbd5e3d374fc5cc75721 (diff)
parent704898bf3200af4da42c1bf9251a7da5533db73f (diff)
downloadmariadb-git-d11829654c4ef5c3d0f997ca61a50d4bd196db8a.tar.gz
merge with MySQL 5.5.27
manually checked every change, reverted incorrect or stupid changes.
Diffstat (limited to 'mysys')
-rw-r--r--mysys/mf_iocache2.c6
-rw-r--r--mysys/my_write.c5
2 files changed, 10 insertions, 1 deletions
diff --git a/mysys/mf_iocache2.c b/mysys/mf_iocache2.c
index 3c23d0737e7..6c7cd9a7e84 100644
--- a/mysys/mf_iocache2.c
+++ b/mysys/mf_iocache2.c
@@ -433,7 +433,11 @@ process_flags:
memset(buffz, '0', minimum_width - length2);
else
memset(buffz, ' ', minimum_width - length2);
- my_b_write(info, buffz, minimum_width - length2);
+ if (my_b_write(info, buffz, minimum_width - length2))
+ {
+ my_afree(buffz);
+ goto err;
+ }
my_afree(buffz);
}
diff --git a/mysys/my_write.c b/mysys/my_write.c
index dc04b60f613..c4cba7a927d 100644
--- a/mysys/my_write.c
+++ b/mysys/my_write.c
@@ -47,6 +47,11 @@ size_t my_write(File Filedes, const uchar *Buffer, size_t Count, myf MyFlags)
#else
writtenbytes= write(Filedes, Buffer, Count);
#endif
+ DBUG_EXECUTE_IF("simulate_file_write_error",
+ {
+ errno= ENOSPC;
+ writtenbytes= (size_t) -1;
+ });
if (writtenbytes == Count)
break;
if (writtenbytes != (size_t) -1)