List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:October 24 2011 1:06pm
Subject:bzr push into mysql-5.1-telco-7.1 branch (jonas.oreland:4315 to 4316)
View as plain text  
 4316 Jonas Oreland	2011-10-24 [merge]
      ndb - merge 71 to 72

    modified:
      storage/ndb/include/util/OutputStream.hpp
      storage/ndb/src/common/util/OutputStream.cpp
      storage/ndb/src/mgmapi/mgmapi.cpp
      storage/ndb/src/mgmsrv/Services.cpp
      storage/ndb/test/include/NdbMgmd.hpp
      storage/ndb/test/ndbapi/testMgm.cpp
 4315 jonas oreland	2011-10-23 [merge]
      ndb - merge 70 to 71

    modified:
      storage/ndb/include/kernel/signaldata/DiGetNodes.hpp
      storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
      storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp
      storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
=== modified file 'storage/ndb/include/util/OutputStream.hpp'
--- a/storage/ndb/include/util/OutputStream.hpp	2011-06-30 15:59:25 +0000
+++ b/storage/ndb/include/util/OutputStream.hpp	2011-10-24 07:44:52 +0000
@@ -33,6 +33,7 @@ public:
     ATTRIBUTE_FORMAT(printf, 2, 3) = 0;
   virtual int println(const char * fmt, ...)
     ATTRIBUTE_FORMAT(printf, 2, 3) = 0;
+  virtual int write(const void * buf, size_t len) = 0;
   virtual void flush() {};
   virtual void reset_timeout() {};
 };
@@ -48,6 +49,7 @@ public:
     ATTRIBUTE_FORMAT(printf, 2, 3);
   int println(const char * fmt, ...)
     ATTRIBUTE_FORMAT(printf, 2, 3);
+  int write(const void * buf, size_t len);
   void flush() { fflush(f); }
 };
 
@@ -67,6 +69,7 @@ public:
     ATTRIBUTE_FORMAT(printf, 2, 3);
   int println(const char * fmt, ...)
     ATTRIBUTE_FORMAT(printf, 2, 3);
+  int write(const void * buf, size_t len);
 };
 
 
@@ -82,6 +85,7 @@ public:
   int println(const char * fmt, ...)
     ATTRIBUTE_FORMAT(printf, 2, 3);
 
+  int write(const void * buf, size_t len);
   void flush();
 };
 
@@ -92,6 +96,7 @@ public:
   virtual ~NullOutputStream() {}
   int print(const char * /* unused */, ...) { return 1;}
   int println(const char * /* unused */, ...) { return 1;}
+  int write(const void * buf, size_t len) { return 1;}
 };
 
 #endif

=== modified file 'storage/ndb/src/common/util/OutputStream.cpp'
--- a/storage/ndb/src/common/util/OutputStream.cpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/common/util/OutputStream.cpp	2011-10-24 07:44:52 +0000
@@ -43,6 +43,12 @@ FileOutputStream::println(const char * f
   return ret + fprintf(f, "\n");
 }
 
+int
+FileOutputStream::write(const void * buf, size_t len)
+{
+  return (int)fwrite(buf, len, 1, f);
+}
+
 SocketOutputStream::SocketOutputStream(NDB_SOCKET_TYPE socket,
 				       unsigned write_timeout_ms) :
   m_socket(socket),
@@ -97,6 +103,28 @@ SocketOutputStream::println(const char *
   return ret;
 }
 
+int
+SocketOutputStream::write(const void * buf, size_t len)
+{
+  if (timedout())
+    return -1;
+
+  int time = 0;
+  int ret = write_socket(m_socket, m_timeout_ms, &time,
+                         (const char*)buf, (int)len);
+  if (ret >= 0)
+  {
+    m_timeout_remain -= time;
+  }
+
+  if ((ret < 0 && errno == SOCKET_ETIMEDOUT) || m_timeout_remain <= 0)
+  {
+    m_timedout = true;
+    ret= -1;
+  }
+  return ret;
+}
+
 #include <UtilBuffer.hpp>
 #include <BaseString.hpp>
 
@@ -172,6 +200,12 @@ BufferedSockOutputStream::println(const
   return 0;
 }
 
+int
+BufferedSockOutputStream::write(const void * buf, size_t len)
+{
+  return m_buffer.append(buf, len);
+}
+
 void BufferedSockOutputStream::flush(){
   int elapsed = 0;
   if (write_socket(m_socket, m_timeout_ms, &elapsed,

=== modified file 'storage/ndb/src/mgmapi/mgmapi.cpp'
--- a/storage/ndb/src/mgmapi/mgmapi.cpp	2011-10-21 10:58:09 +0000
+++ b/storage/ndb/src/mgmapi/mgmapi.cpp	2011-10-24 13:05:48 +0000
@@ -499,7 +499,10 @@ ndb_mgm_call(NdbMgmHandle handle,
   out.println("%s", "");
 
   if (cmd_bulk)
-    out.println(cmd_bulk);
+  {
+    out.write(cmd_bulk, strlen(cmd_bulk));
+    out.write("\n", 1);
+  }
 
   CHECK_TIMEDOUT_RET(handle, in, out, NULL);
 

=== modified file 'storage/ndb/src/mgmsrv/Services.cpp'
--- a/storage/ndb/src/mgmsrv/Services.cpp	2011-10-21 10:58:09 +0000
+++ b/storage/ndb/src/mgmsrv/Services.cpp	2011-10-24 13:05:48 +0000
@@ -599,15 +599,17 @@ MgmApiSession::getConfig(Parser_t::Conte
   m_output->println("Content-Transfer-Encoding: base64");
   m_output->print("\n");
 
+  unsigned len = (unsigned)strlen(pack64.c_str());
   if(ERROR_INSERTED(3))
   {
     // Return only half the packed config
     BaseString half64 = pack64.substr(0, pack64.length());
-    m_output->println(half64.c_str());
+    m_output->write(half64.c_str(), (unsigned)strlen(half64.c_str()));
+    m_output->write("\n", 1);
     return;
   }
-  m_output->println(pack64.c_str());
-  m_output->print("\n");
+  m_output->write(pack64.c_str(), len);
+  m_output->write("\n\n", 2);
   return;
 }
 
@@ -1430,9 +1432,20 @@ Ndb_mgmd_event_service::log(int eventTyp
 
       int r;
       if (m_clients[i].m_parsable)
-        r= out.println(str.c_str());
+      {
+        unsigned len = str.length();
+        r= out.write(str.c_str(), len);
+      }
       else
-        r= out.println(pretty_text);
+      {
+        unsigned len = (unsigned)strlen(pretty_text);
+        r= out.write(pretty_text, len);
+      }
+
+      if (! (r < 0))
+      {
+        r = out.write("\n", 1);
+      }
 
       if (r<0)
       {

=== modified file 'storage/ndb/test/include/NdbMgmd.hpp'
--- a/storage/ndb/test/include/NdbMgmd.hpp	2011-09-13 08:58:27 +0000
+++ b/storage/ndb/test/include/NdbMgmd.hpp	2011-10-24 07:44:52 +0000
@@ -227,7 +227,7 @@ public:
 
     SocketOutputStream out(socket());
 
-    if (out.println(cmd)){
+    if (out.println("%s", cmd)){
       error("call: println failed at line %d", __LINE__);
       return false;
     }
@@ -278,9 +278,16 @@ public:
     }
 
     // Send any bulk data
-    if (bulk && out.println(bulk)){
-      error("call: print('<bulk>') failed at line %d", __LINE__);
-      return false;
+    if (bulk)
+    {
+      if (out.write(bulk, strlen(bulk)) >= 0)
+      {
+        if (out.write("\n", 1) < 0)
+        {
+          error("call: print('<bulk>') failed at line %d", __LINE__);
+          return false;
+        }
+      }
     }
 
     BaseString buf;

=== modified file 'storage/ndb/test/ndbapi/testMgm.cpp'
--- a/storage/ndb/test/ndbapi/testMgm.cpp	2011-09-19 19:55:58 +0000
+++ b/storage/ndb/test/ndbapi/testMgm.cpp	2011-10-24 13:05:48 +0000
@@ -736,7 +736,7 @@ get_nodeid_of_type(NdbMgmd& mgmd, ndb_mg
   int noOfNodes = cs->no_of_nodes;
   int randomnode = myRandom48(noOfNodes);
   ndb_mgm_node_state *ns = cs->node_states + randomnode;
-  assert(ns->node_type == (Uint32)type);
+  assert((Uint32)ns->node_type == (Uint32)type);
   assert(ns->node_id);
 
   *nodeId = ns->node_id;

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-telco-7.1 branch (jonas.oreland:4315 to 4316) Jonas Oreland25 Oct