diff options
author | MySQL Team <mysql@php.net> | 2001-01-23 16:48:50 +0000 |
---|---|---|
committer | MySQL Team <mysql@php.net> | 2001-01-23 16:48:50 +0000 |
commit | 800f555b707c696798877c80352ded46289e87c4 (patch) | |
tree | c540242b6e6da4e9b99b46797a26b215abef0a64 /ext/mysql/libmysql/my_write.c | |
parent | d36858681a0d48414702524ebd16f31289b06fa8 (diff) | |
download | php-git-800f555b707c696798877c80352ded46289e87c4.tar.gz |
Upgrade ext/mysql/libmysql to version 3.23.32. One notable bug fix is
that the client can now connect to a server which is using a default
charset other than latin1.
Diffstat (limited to 'ext/mysql/libmysql/my_write.c')
-rw-r--r-- | ext/mysql/libmysql/my_write.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/ext/mysql/libmysql/my_write.c b/ext/mysql/libmysql/my_write.c index ac791ebc2f..d66e1da031 100644 --- a/ext/mysql/libmysql/my_write.c +++ b/ext/mysql/libmysql/my_write.c @@ -27,13 +27,15 @@ uint my_write(int Filedes, const byte *Buffer, uint Count, myf MyFlags) Count-=writenbytes; } my_errno=errno; - DBUG_PRINT("error",("Write only %d bytes",writenbytes)); + DBUG_PRINT("error",("Write only %d bytes, error: %d", + writenbytes,my_errno)); #ifndef NO_BACKGROUND #ifdef THREAD if (my_thread_var->abort) MyFlags&= ~ MY_WAIT_IF_FULL; /* End if aborted by user */ #endif - if (my_errno == ENOSPC && (MyFlags & MY_WAIT_IF_FULL)) + if (my_errno == ENOSPC && (MyFlags & MY_WAIT_IF_FULL) && + (uint) writenbytes != (uint) -1) { if (!(errors++ % MY_WAIT_GIVE_USER_A_MESSAGE)) my_error(EE_DISK_FULL,MYF(ME_BELL | ME_NOREFRESH), @@ -41,8 +43,18 @@ uint my_write(int Filedes, const byte *Buffer, uint Count, myf MyFlags) VOID(sleep(MY_WAIT_FOR_USER_TO_FIX_PANIC)); continue; } - if ((writenbytes == 0 && my_errno == EINTR) || - (writenbytes > 0 && (uint) writenbytes != (uint) -1)) + if (!writenbytes) + { + /* We may come here on an interrupt or if the file quote is exeeded */ + if (my_errno == EINTR) + continue; + if (!errors++) /* Retry once */ + { + errno=EFBIG; /* Assume this is the error */ + continue; + } + } + else if ((uint) writenbytes != (uint) -1) continue; /* Retry */ #endif if (MyFlags & (MY_NABP | MY_FNABP)) |