=== modified file 'storage/ndb/include/transporter/TransporterDefinitions.hpp'
--- a/storage/ndb/include/transporter/TransporterDefinitions.hpp	2007-02-12 07:40:11 +0000
+++ b/storage/ndb/include/transporter/TransporterDefinitions.hpp	2008-08-26 14:12:34 +0000
@@ -41,11 +41,22 @@
 };
 
 /**
- * Protocol6 Header + 
- *  (optional signal id) + (optional checksum) + (signal data)
+ * Maximum message sizes
+ * ---------------------
+ * Maximum byte sizes for sent and received messages.
+ * The maximum send message size is temporarily smaller than 
+ * the maximum receive message size to support online
+ * upgrade
+ * Maximum received size increased in :
+ *   mysql-5.1-telco-6.3.17 from 16516 bytes to 32768
+ * The maximum send size can be increased in a future
+ * release to match the maximum receive size.  That
+ * release will be unable to send messages to a release
+ * lower than mysql-5.1-telco-6.3.17.
+ * 
  */
-//const Uint32 MAX_MESSAGE_SIZE = (12+4+4+(4*25));
-const Uint32 MAX_MESSAGE_SIZE = (12+4+4+(4*25)+(3*4)+4*4096);
+const Uint32 MAX_RECV_MESSAGE_BYTESIZE = 32768;
+const Uint32 MAX_SEND_MESSAGE_BYTESIZE = 16516;
 
 /**
  * TransporterConfiguration

=== modified file 'storage/ndb/src/common/transporter/Packer.cpp'
--- a/storage/ndb/src/common/transporter/Packer.cpp	2007-09-10 09:16:32 +0000
+++ b/storage/ndb/src/common/transporter/Packer.cpp	2008-08-26 14:12:34 +0000
@@ -54,7 +54,7 @@
       const Uint16 messageLen32    = Protocol6::getMessageLength(word1);
       const Uint32 messageLenBytes = ((Uint32)messageLen32) << 2;
 
-      if(messageLen32 == 0 || messageLen32 > MAX_MESSAGE_SIZE){
+      if(messageLenBytes == 0 || messageLenBytes > MAX_RECV_MESSAGE_BYTESIZE){
         DEBUG("Message Size = " << messageLenBytes);
 	reportError(callbackObj, remoteNodeId, TE_INVALID_MESSAGE_LENGTH);
         return usedData;
@@ -136,7 +136,7 @@
       
       const Uint16 messageLen32    = Protocol6::getMessageLength(word1);
       const Uint32 messageLenBytes = ((Uint32)messageLen32) << 2;
-      if(messageLen32 == 0 || messageLen32 > MAX_MESSAGE_SIZE){
+      if(messageLenBytes == 0 || messageLenBytes > MAX_RECV_MESSAGE_BYTESIZE){
 	DEBUG("Message Size = " << messageLenBytes);
 	reportError(callbackObj, remoteNodeId, TE_INVALID_MESSAGE_LENGTH);
         return usedData;
@@ -234,7 +234,9 @@
       
       const Uint16 messageLen32    = Protocol6::getMessageLength(word1);
       
-      if(messageLen32 == 0 || messageLen32 > MAX_MESSAGE_SIZE){
+      if(messageLen32 == 0 || 
+         messageLen32 > (MAX_RECV_MESSAGE_BYTESIZE >> 2))
+      {
         DEBUG("Message Size(words) = " << messageLen32);
 	reportError(callbackObj, remoteNodeId, TE_INVALID_MESSAGE_LENGTH);
         return readPtr;
@@ -304,7 +306,9 @@
 #endif
       
       const Uint16 messageLen32    = Protocol6::getMessageLength(word1);
-      if(messageLen32 == 0 || messageLen32 > MAX_MESSAGE_SIZE){
+      if(messageLen32 == 0 || 
+         messageLen32 > (MAX_RECV_MESSAGE_BYTESIZE >> 2))
+      {
 	DEBUG("Message Size(words) = " << messageLen32);
 	reportError(callbackObj, remoteNodeId, TE_INVALID_MESSAGE_LENGTH);
         return readPtr;

=== modified file 'storage/ndb/src/common/transporter/SHM_Transporter.cpp'
--- a/storage/ndb/src/common/transporter/SHM_Transporter.cpp	2007-01-27 01:46:45 +0000
+++ b/storage/ndb/src/common/transporter/SHM_Transporter.cpp	2008-08-26 14:12:34 +0000
@@ -80,7 +80,8 @@
   sharedSize += 28; //SHM_Reader::getSharedSize();
   sharedSize += 28; //SHM_Writer::getSharedSize();
 
-  const Uint32 slack = MAX_MESSAGE_SIZE;
+  const Uint32 slack = MAX(MAX_RECV_MESSAGE_BYTESIZE,
+                           MAX_SEND_MESSAGE_BYTESIZE);
 
   /**
    *  NOTE: There is 7th shared variable in Win2k (sharedCountAttached).

=== modified file 'storage/ndb/src/common/transporter/SendBuffer.cpp'
--- a/storage/ndb/src/common/transporter/SendBuffer.cpp	2006-12-23 19:20:40 +0000
+++ b/storage/ndb/src/common/transporter/SendBuffer.cpp	2008-08-26 14:12:34 +0000
@@ -19,8 +19,8 @@
 SendBuffer::SendBuffer(Uint32 bufSize) {
 
   sizeOfBuffer = bufSize;
-  if(sizeOfBuffer < MAX_MESSAGE_SIZE)
-    sizeOfBuffer = 2 * MAX_MESSAGE_SIZE; 
+  if(sizeOfBuffer < MAX_SEND_MESSAGE_BYTESIZE)
+    sizeOfBuffer = 2 * MAX_SEND_MESSAGE_BYTESIZE; 
   startOfBuffer = NULL;
 
   // Initalise pointers 

=== modified file 'storage/ndb/src/common/transporter/TCP_Transporter.cpp'
--- a/storage/ndb/src/common/transporter/TCP_Transporter.cpp	2008-05-08 10:07:00 +0000
+++ b/storage/ndb/src/common/transporter/TCP_Transporter.cpp	2008-08-26 14:12:34 +0000
@@ -143,11 +143,11 @@
   // Let it be the maximum size we receive plus 8 kB for any earlier received
   // incomplete messages (slack)
   Uint32 recBufSize = maxReceiveSize;
-  if(recBufSize < MAX_MESSAGE_SIZE){
-    recBufSize = MAX_MESSAGE_SIZE;
+  if(recBufSize < MAX_RECV_MESSAGE_BYTESIZE){
+    recBufSize = MAX_RECV_MESSAGE_BYTESIZE;
   }
   
-  if(!receiveBuffer.init(recBufSize+MAX_MESSAGE_SIZE)){
+  if(!receiveBuffer.init(recBufSize+MAX_RECV_MESSAGE_BYTESIZE)){
     return false;
   }
   

=== modified file 'storage/ndb/src/common/transporter/TransporterRegistry.cpp'
--- a/storage/ndb/src/common/transporter/TransporterRegistry.cpp	2008-08-13 19:47:08 +0000
+++ b/storage/ndb/src/common/transporter/TransporterRegistry.cpp	2008-08-26 14:12:34 +0000
@@ -554,7 +554,7 @@
 	 
     if(t->isConnected()){
       Uint32 lenBytes = t->m_packer.getMessageLength(signalHeader, ptr);
-      if(lenBytes <= MAX_MESSAGE_SIZE){
+      if(lenBytes <= MAX_SEND_MESSAGE_BYTESIZE){
 	Uint32 * insertPtr = t->getWritePtr(lenBytes, prio);
 	if(insertPtr != 0){
 	  t->m_packer.pack(insertPtr, prio, signalHeader, signalData, ptr);
@@ -626,7 +626,7 @@
     
     if(t->isConnected()){
       Uint32 lenBytes = t->m_packer.getMessageLength(signalHeader, ptr);
-      if(lenBytes <= MAX_MESSAGE_SIZE){
+      if(lenBytes <= MAX_SEND_MESSAGE_BYTESIZE){
 	Uint32 * insertPtr = t->getWritePtr(lenBytes, prio);
 	if(insertPtr != 0){
 	  t->m_packer.pack(insertPtr, prio, signalHeader, signalData, thePool, ptr);

=== modified file 'storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp	2008-08-05 10:13:56 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp	2008-08-26 14:12:34 +0000
@@ -908,7 +908,7 @@
 }
 
 
-#define MAX_READ (sizeof(signal->theData) > MAX_MESSAGE_SIZE ? MAX_MESSAGE_SIZE : sizeof(signal->theData))
+#define MAX_READ (MIN(sizeof(signal->theData), MAX_RECV_MESSAGE_BYTESIZE))
 
 /* ---------------------------------------------------------------- */
 /* ----------------------------- READ  ---------------------------- */



