List:Commits« Previous MessageNext Message »
From:Stewart Smith Date:June 7 2006 6:33pm
Subject:bk commit into 5.0 tree (stewart:1.2169)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of stewart. When stewart 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
  1.2169 06/06/08 02:33:25 stewart@stripped +1 -0
  Merge mysql.com:/home/stewart/Documents/MySQL/5.0/bug20016
  into  mysql.com:/home/stewart/Documents/MySQL/5.0/merge-queue

  ndb/src/mgmapi/mgmapi.cpp
    1.62 06/06/08 02:33:20 stewart@stripped +0 -0
    Auto merged

# 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:	stewart
# Host:	willster.(none)
# Root:	/home/stewart/Documents/MySQL/5.0/merge-queue/RESYNC

--- 1.61/ndb/src/mgmapi/mgmapi.cpp	2006-05-23 14:45:51 +10:00
+++ 1.62/ndb/src/mgmapi/mgmapi.cpp	2006-06-08 02:33:20 +10:00
@@ -679,7 +679,11 @@
   out.println("");
 
   char buf[1024];
-  in.gets(buf, sizeof(buf));
+  if(!in.gets(buf, sizeof(buf)))
+  {
+    SET_ERROR(handle, NDB_MGM_ILLEGAL_SERVER_REPLY, "Probably disconnected");
+    return NULL;
+  }
   if(buf[strlen(buf)-1] == '\n')
     buf[strlen(buf)-1] = '\0';
 
@@ -688,7 +692,11 @@
     return NULL;
   }
 
-  in.gets(buf, sizeof(buf));
+  if(!in.gets(buf, sizeof(buf)))
+  {
+    SET_ERROR(handle, NDB_MGM_ILLEGAL_SERVER_REPLY, "Probably disconnected");
+    return NULL;
+  }
   if(buf[strlen(buf)-1] == '\n')
     buf[strlen(buf)-1] = '\0';
   
@@ -711,6 +719,13 @@
     malloc(sizeof(ndb_mgm_cluster_state)+
 	   noOfNodes*(sizeof(ndb_mgm_node_state)+sizeof("000.000.000.000#")));
 
+  if(!state)
+  {
+    SET_ERROR(handle, NDB_MGM_OUT_OF_MEMORY,
+              "Allocating ndb_mgm_cluster_state");
+    return NULL;
+  }
+
   state->no_of_nodes= noOfNodes;
   ndb_mgm_node_state * ptr = &state->node_states[0];
   int nodeId = 0;
@@ -720,7 +735,13 @@
   }
   i = -1; ptr--;
   for(; i<noOfNodes; ){
-    in.gets(buf, sizeof(buf));
+    if(!in.gets(buf, sizeof(buf)))
+    {
+      free(state);
+      SET_ERROR(handle, NDB_MGM_ILLEGAL_SERVER_REPLY,
+                "Probably disconnected");
+      return NULL;
+    }
     tmp.assign(buf);
 
     if(tmp.trim() == ""){
Thread
bk commit into 5.0 tree (stewart:1.2169)Stewart Smith7 Jun