List:Commits« Previous MessageNext Message »
From:tim Date:September 15 2006 3:06am
Subject:bk commit into 4.1 tree (tsmith:1.2540) BUG#4053
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of tim. When tim does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2006-09-14 21:06:14-06:00, tsmith@stripped +1 -0
  Bug #4053: too many of "error 1236: 'binlog truncated in the middle of event' from master"
  - Detect read failure in my_read_charset_file

  mysys/charset.c@stripped, 2006-09-14 21:05:03-06:00, tsmith@stripped +9 -6
    Use my_read instead of read(), and detect read failure, in my_read_charset_file()

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	tsmith
# Host:	siva.hindu.god
# Root:	/usr/home/tim/m/bk/tmp/41

--- 1.143/mysys/charset.c	2006-09-14 21:06:18 -06:00
+++ 1.144/mysys/charset.c	2006-09-14 21:06:18 -06:00
@@ -312,7 +312,7 @@ static my_bool my_read_charset_file(cons
 {
   char *buf;
   int  fd;
-  uint len;
+  uint len, tmp_len;
   MY_STAT stat_info;
   
   if (!my_stat(filename, &stat_info, MYF(myflags)) ||
@@ -321,12 +321,11 @@ static my_bool my_read_charset_file(cons
     return TRUE;
   
   if ((fd=my_open(filename,O_RDONLY,myflags)) < 0)
-  {
-    my_free(buf,myflags);
-    return TRUE;
-  }
-  len=read(fd,buf,len);
+    goto error;
+  tmp_len=my_read(fd, buf, len, myflags);
   my_close(fd,myflags);
+  if (tmp_len != len)
+    goto error;
   
   if (my_parse_charset_xml(buf,len,add_collation))
   {
@@ -340,6 +339,10 @@ static my_bool my_read_charset_file(cons
   
   my_free(buf, myflags);  
   return FALSE;
+
+error:
+  my_free(buf, myflags);
+  return TRUE;
 }
 
 
Thread
bk commit into 4.1 tree (tsmith:1.2540) BUG#4053tim15 Sep