List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:October 20 2011 1:02pm
Subject:bzr push into mysql-5.1-telco-7.0 branch (jonas.oreland:4611 to 4613)
View as plain text  
 4613 Jonas Oreland	2011-10-20
      ndb - first stab at windows warning

    modified:
      sql/ha_ndbcluster.cc
      storage/ndb/src/common/util/ndb_init.cpp
      storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
      storage/ndb/src/kernel/blocks/ndbfs/Filename.cpp
      storage/ndb/src/kernel/error/ndbd_exit_codes.c
      storage/ndb/src/kernel/vm/SimulatedBlock.cpp
      storage/ndb/src/mgmapi/ndb_logevent.cpp
      storage/ndb/src/mgmsrv/Defragger.hpp
      storage/ndb/src/ndbapi/ndberror.c
 4612 Jonas Oreland	2011-10-20
      ndb - fix compiler warning in Dbspj

    modified:
      storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp
 4611 Jan Wedvik	2011-10-20
      This commit concerns SPJ (i.e. pushed queries).
      
      The commit fixes two errors that may happend when there is a pruned child
      scan operation:
      1. The api did not set SIP_PRUNE_PARAMS as it should.
      2. There was an error in Dbspj::parseScanIndex().  When it called 
      Dbspj::expand() to process prune keys, it used to start reading
      query parameters from after whatever parseDA() had consumed. Now it starts 
      from the beginning of the query parameters (for that operation). In other 
      words, the parameter values are only sent once, and these values are used for 
      building both the scan bounds and the prune key. 

    modified:
      storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp
      storage/ndb/src/ndbapi/NdbQueryBuilder.cpp
      storage/ndb/src/ndbapi/NdbQueryBuilderImpl.hpp
      storage/ndb/src/ndbapi/NdbQueryOperation.cpp
=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc	2011-10-17 12:43:31 +0000
+++ b/sql/ha_ndbcluster.cc	2011-10-20 13:01:37 +0000
@@ -1451,7 +1451,7 @@ bool ha_ndbcluster::get_error_message(in
 
   const NdbError err= ndb->getNdbError(error);
   bool temporary= err.status==NdbError::TemporaryError;
-  buf->set(err.message, strlen(err.message), &my_charset_bin);
+  buf->set(err.message, (uint32)strlen(err.message), &my_charset_bin);
   DBUG_PRINT("exit", ("message: %s, temporary: %d", buf->ptr(), temporary));
   DBUG_RETURN(temporary);
 }

=== modified file 'storage/ndb/src/common/util/ndb_init.cpp'
--- a/storage/ndb/src/common/util/ndb_init.cpp	2011-09-27 17:28:13 +0000
+++ b/storage/ndb/src/common/util/ndb_init.cpp	2011-10-20 13:01:37 +0000
@@ -56,7 +56,7 @@ ndb_init_internal()
   {
     {
       const char* err = "ndb_init() failed - exit\n";
-      int res = write(2, err, strlen(err));
+      int res = (int)write(2, err, strlen(err));
       (void)res;
       exit(1);
     }
@@ -79,7 +79,7 @@ ndb_init()
     if (my_init())
     {
       const char* err = "my_init() failed - exit\n";
-      int res = write(2, err, strlen(err));
+      int res = (int)write(2, err, strlen(err));
       (void)res;
       exit(1);
     }

=== modified file 'storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp	2011-10-20 12:45:36 +0000
+++ b/storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp	2011-10-20 12:56:14 +0000
@@ -5086,7 +5086,8 @@ Dbspj::scanIndex_parent_batch_complete(S
       parallelism = (data.m_fragCount - data.m_frags_complete) / roundTrips;
     }
 
-    ndbassert(parallelism <= data.m_fragCount - data.m_frags_complete);
+    ndbassert(parallelism >= 1);
+    ndbassert((Uint32)parallelism + data.m_frags_complete <= data.m_fragCount);
     data.m_parallelism = static_cast<Uint32>(parallelism);
 
 #ifdef DEBUG_SCAN_FRAGREQ

=== modified file 'storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp'
--- a/storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp	2011-06-30 15:59:25 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp	2011-10-20 13:01:37 +0000
@@ -110,7 +110,7 @@ AsyncFile::writeReq(Request * request)
     bool write_not_complete = true;
 
     while(write_not_complete) {
-      int totsize = 0;
+      size_t totsize = 0;
       off_t offset = request->par.readWrite.pages[page_num].offset;
       char* bufptr = theWriteBuffer;
 
@@ -128,7 +128,7 @@ AsyncFile::writeReq(Request * request)
           if (((i + 1) < request->par.readWrite.numberOfPages)) {
             // There are more pages to write
             // Check that offsets are consequtive
-            off_t tmp = page_offset + request->par.readWrite.pages[i].size;
+            off_t tmp=(off_t)page_offset + request->par.readWrite.pages[i].size;
             if (tmp != request->par.readWrite.pages[i+1].offset) {
               // Next page is not aligned with previous, not allowed
               DEBUG(ndbout_c("Page offsets are not aligned"));
@@ -143,7 +143,7 @@ AsyncFile::writeReq(Request * request)
               break;
             }
           }
-          page_offset += request->par.readWrite.pages[i].size;
+          page_offset += (off_t)request->par.readWrite.pages[i].size;
         }
         bufptr = theWriteBuffer;
       } else {

=== modified file 'storage/ndb/src/kernel/blocks/ndbfs/Filename.cpp'
--- a/storage/ndb/src/kernel/blocks/ndbfs/Filename.cpp	2011-06-30 15:59:25 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbfs/Filename.cpp	2011-10-20 13:01:37 +0000
@@ -197,7 +197,7 @@ Filename::set(Ndbfs* fs,
   strcat(theName, fileExtension[type]);
   
   if(dir == true){
-    for(int l = strlen(theName) - 1; l >= 0; l--){
+    for(int l = (int)strlen(theName) - 1; l >= 0; l--){
       if(theName[l] == DIR_SEPARATOR[0]){
 	theName[l] = 0;
 	break;

=== modified file 'storage/ndb/src/kernel/error/ndbd_exit_codes.c'
--- a/storage/ndb/src/kernel/error/ndbd_exit_codes.c	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/kernel/error/ndbd_exit_codes.c	2011-10-20 13:01:37 +0000
@@ -267,7 +267,7 @@ const char *ndbd_exit_status_message(ndb
 
 int ndbd_exit_string(int err_no, char *str, unsigned int size)
 {
-  unsigned int len;
+  size_t len;
 
   ndbd_exit_classification cl;
   ndbd_exit_status st;
@@ -279,8 +279,8 @@ int ndbd_exit_string(int err_no, char *s
 
     len = my_snprintf(str, size-1, "%s: %s: %s", msg, st_msg, cl_msg);
     str[size-1]= '\0';
-  
-    return len;
+
+    return (int)len;
   }
   return -1;
 }

=== modified file 'storage/ndb/src/kernel/vm/SimulatedBlock.cpp'
--- a/storage/ndb/src/kernel/vm/SimulatedBlock.cpp	2011-08-27 06:06:02 +0000
+++ b/storage/ndb/src/kernel/vm/SimulatedBlock.cpp	2011-10-20 13:01:37 +0000
@@ -1827,7 +1827,7 @@ SimulatedBlock::infoEvent(const char * m
   BaseString::vsnprintf(buf, 96, msg, ap); // 96 = 100 - 4
   va_end(ap);
   
-  int len = strlen(buf) + 1;
+  size_t len = strlen(buf) + 1;
   if(len > 96){
     len = 96;
     buf[95] = 0;
@@ -1872,7 +1872,7 @@ SimulatedBlock::warningEvent(const char
   BaseString::vsnprintf(buf, 96, msg, ap); // 96 = 100 - 4
   va_end(ap);
   
-  int len = strlen(buf) + 1;
+  size_t len = strlen(buf) + 1;
   if(len > 96){
     len = 96;
     buf[95] = 0;

=== modified file 'storage/ndb/src/mgmapi/ndb_logevent.cpp'
--- a/storage/ndb/src/mgmapi/ndb_logevent.cpp	2011-06-30 15:59:25 +0000
+++ b/storage/ndb/src/mgmapi/ndb_logevent.cpp	2011-10-20 13:01:37 +0000
@@ -616,7 +616,7 @@ int ndb_logevent_get_next(const NdbLogEv
     BaseString tmp(val);
     Vector<BaseString> list;
     tmp.split(list);
-    for (size_t j = 0; j<list.size(); j++)
+    for (unsigned j = 0; j<list.size(); j++)
     {
       dst->Data[j] = atoi(list[j].c_str());
     }

=== modified file 'storage/ndb/src/mgmsrv/Defragger.hpp'
--- a/storage/ndb/src/mgmsrv/Defragger.hpp	2011-07-04 13:37:56 +0000
+++ b/storage/ndb/src/mgmsrv/Defragger.hpp	2011-10-20 13:01:37 +0000
@@ -37,7 +37,7 @@ class Defragger {
   Vector<DefragBuffer*> m_buffers;
 
   DefragBuffer* find_buffer(NodeId nodeId, Uint32 fragId){
-    for (size_t i = 0; i < m_buffers.size(); i++)
+    for (unsigned i = 0; i < m_buffers.size(); i++)
     {
       DefragBuffer* dbuf = m_buffers[i];
       if (dbuf->m_node_id == nodeId &&
@@ -48,7 +48,7 @@ class Defragger {
   }
 
   void erase_buffer(const DefragBuffer* dbuf){
-    for (size_t i = 0; i < m_buffers.size(); i++)
+    for (unsigned i = 0; i < m_buffers.size(); i++)
     {
       if (m_buffers[i] == dbuf)
       {
@@ -64,7 +64,7 @@ public:
   Defragger() {};
   ~Defragger()
   {
-    for (size_t i = m_buffers.size(); i > 0; --i)
+    for (unsigned i = m_buffers.size(); i > 0; --i)
     {
       delete m_buffers[i-1]; // free the memory of the fragment
     }
@@ -121,7 +121,7 @@ public:
     clear any unassembled signal buffers from node
   */
   void node_failed(NodeId nodeId) {
-    for (size_t i = m_buffers.size(); i > 0; --i)
+    for (unsigned i = m_buffers.size(); i > 0; --i)
     {
       if (m_buffers[i-1]->m_node_id == nodeId)
       {

=== modified file 'storage/ndb/src/ndbapi/ndberror.c'
--- a/storage/ndb/src/ndbapi/ndberror.c	2011-10-07 13:15:08 +0000
+++ b/storage/ndb/src/ndbapi/ndberror.c	2011-10-20 13:01:37 +0000
@@ -979,17 +979,17 @@ int ndb_error_string(int err_no, char *s
   int len;
 
   assert(size > 1);
-  if(size <= 1) 
+  if(size <= 1)
     return 0;
+
   error.code = err_no;
   ndberror_update(&error);
 
-  len =
-    my_snprintf(str, size-1, "%s: %s: %s", error.message,
+  len = (int)my_snprintf(str, size-1, "%s: %s: %s", error.message,
 		ndberror_status_message(error.status),
 		ndberror_classification_message(error.classification));
   str[size-1]= '\0';
-  
+
   if (error.classification != UE)
     return len;
   return -len;

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-telco-7.0 branch (jonas.oreland:4611 to 4613) Jonas Oreland20 Oct