List:Commits« Previous MessageNext Message »
From:Ole John Aske Date:May 11 2011 1:31pm
Subject:bzr commit into mysql-5.1-telco-7.0 branch (ole.john.aske:4368)
View as plain text  
#At file:///net/fimafeng09/export/home/tmp/oleja/mysql/mysql-5.1-telco-7.0/ based on revid:magnus.blaudd@stripped

 4368 Ole John Aske	2011-05-11
      Remove unused field & methods fron 'class NdbReceiver'
      
      1. Method NdbReceiver::copyout() is unused -> remove
      2. Struct m_recattr is unused after removal of ::copyout() -> remove
      3. Field m_record::m_column_count is unused ->remove
      4. Union enclosing m_recattr & m_record only contains m_record after '3.' -> remove
      5. Remove argument 'column_count' from ::do_setup_ndbrecord() is it
         was used to set the obsolete 'm_record::m_column_count'.

    modified:
      storage/ndb/include/ndbapi/NdbReceiver.hpp
      storage/ndb/src/ndbapi/NdbOperationExec.cpp
      storage/ndb/src/ndbapi/NdbQueryOperation.cpp
      storage/ndb/src/ndbapi/NdbReceiver.cpp
      storage/ndb/src/ndbapi/NdbScanOperation.cpp
=== modified file 'storage/ndb/include/ndbapi/NdbReceiver.hpp'
--- a/storage/ndb/include/ndbapi/NdbReceiver.hpp	2011-02-09 14:18:53 +0000
+++ b/storage/ndb/include/ndbapi/NdbReceiver.hpp	2011-05-11 13:31:44 +0000
@@ -118,7 +118,7 @@ private:
   */
   void do_setup_ndbrecord(const NdbRecord *ndb_record, Uint32 batch_size,
                           Uint32 key_size, Uint32 read_range_no,
-                          Uint32 rowsize, char *buf, Uint32 column_count);
+                          Uint32 rowsize, char *buf);
 
   static
   Uint32 ndbrecord_rowsize(const NdbRecord *ndb_record,
@@ -137,33 +137,27 @@ private:
     new NdbRecord style operation.
   */
   bool m_using_ndb_record;
-  union {
-    /* members used for NdbRecAttr operation. */
-    struct {
-      Uint32 m_hidden_count;
-    } m_recattr;
-
-    /* members used for NdbRecord operation. */
-    struct {
-      Uint32 m_column_count;
-      const NdbRecord *m_ndb_record;
-      char *m_row;
-      /* Block of memory used to receive all rows in a batch during scan. */
-      char *m_row_buffer;
-      /*
-        Offsets between two rows in m_row_buffer.
-        This can be different from m_ndb_record->m_row_size, as we sometimes
-        store extra information after each row (range_no and keyinfo).
-        For non-scan operations, this is set to zero.
-      */
-      Uint32 m_row_offset;
-      /*
-        m_read_range_no is true if we are storing the range_no at the end of
-        each row during scans.
-      */
-      bool m_read_range_no;
-    } m_record;
-  };
+
+  /* members used for NdbRecord operation. */
+  struct {
+    const NdbRecord *m_ndb_record;
+    char *m_row;
+    /* Block of memory used to receive all rows in a batch during scan. */
+    char *m_row_buffer;
+    /*
+      Offsets between two rows in m_row_buffer.
+      This can be different from m_ndb_record->m_row_size, as we sometimes
+      store extra information after each row (range_no and keyinfo).
+      For non-scan operations, this is set to zero.
+    */
+    Uint32 m_row_offset;
+    /*
+      m_read_range_no is true if we are storing the range_no at the end of
+      each row during scans.
+    */
+    bool m_read_range_no;
+  } m_record;
+
   class NdbRecAttr* theFirstRecAttr;
   class NdbRecAttr* theCurrentRecAttr;
 
@@ -212,7 +206,6 @@ private:
 
   bool hasResults() const { return m_result_rows > 0; }
   bool nextResult() const { return m_current_row < m_result_rows; }
-  NdbRecAttr* copyout(NdbReceiver&);
   Uint32 receive_packed_recattr(NdbRecAttr**, Uint32 bmlen, 
                                 const Uint32* aDataPtr, Uint32 aLength);
   Uint32 receive_packed_ndbrecord(Uint32 bmlen,

=== modified file 'storage/ndb/src/ndbapi/NdbOperationExec.cpp'
--- a/storage/ndb/src/ndbapi/NdbOperationExec.cpp	2011-04-28 07:47:53 +0000
+++ b/storage/ndb/src/ndbapi/NdbOperationExec.cpp	2011-05-11 13:31:44 +0000
@@ -1032,7 +1032,6 @@ NdbOperation::buildSignalsNdbRecord(Uint
       readMask.set(attrId);
       requestedCols++;
     }
-    theReceiver.m_record.m_column_count= requestedCols;
 
     /* Are there any columns to read via NdbRecord? */
     if (requestedCols > 0)

=== modified file 'storage/ndb/src/ndbapi/NdbQueryOperation.cpp'
--- a/storage/ndb/src/ndbapi/NdbQueryOperation.cpp	2011-05-05 11:06:08 +0000
+++ b/storage/ndb/src/ndbapi/NdbQueryOperation.cpp	2011-05-11 13:31:44 +0000
@@ -4069,8 +4069,7 @@ NdbQueryOperationImpl::prepareReceiver()
                           0 /*key_size*/, 
                           0 /*read_range_no*/, 
                           getRowSize(),
-                          rowBuf,
-                          0);
+                          rowBuf);
     m_resultStreams[i]->getReceiver().prepareSend();
   }
   // So that we can test for for buffer overrun.

=== modified file 'storage/ndb/src/ndbapi/NdbReceiver.cpp'
--- a/storage/ndb/src/ndbapi/NdbReceiver.cpp	2011-04-06 14:16:13 +0000
+++ b/storage/ndb/src/ndbapi/NdbReceiver.cpp	2011-05-11 13:31:44 +0000
@@ -60,7 +60,6 @@ NdbReceiver::init(ReceiverType type, boo
     m_record.m_row_buffer= NULL;
     m_record.m_row_offset= 0;
     m_record.m_read_range_no= false;
-    m_record.m_column_count= 0;
   }
   theFirstRecAttr = NULL;
   theCurrentRecAttr = NULL;
@@ -216,8 +215,7 @@ NdbReceiver::calculate_batch_size(Uint32
 void
 NdbReceiver::do_setup_ndbrecord(const NdbRecord *ndb_record, Uint32 batch_size,
                                 Uint32 key_size, Uint32 read_range_no,
-                                Uint32 rowsize, char *row_buffer,
-                                Uint32 column_count)
+                                Uint32 rowsize, char *row_buffer)
 {
   m_using_ndb_record= true;
   m_record.m_ndb_record= ndb_record;
@@ -225,7 +223,6 @@ NdbReceiver::do_setup_ndbrecord(const Nd
   m_record.m_row_buffer= row_buffer;
   m_record.m_row_offset= rowsize;
   m_record.m_read_range_no= read_range_no;
-  m_record.m_column_count= column_count;
 }
 
 //static
@@ -261,26 +258,6 @@ NdbReceiver::ndbrecord_rowsize(const Ndb
   return rowsize;
 }
 
-NdbRecAttr*
-NdbReceiver::copyout(NdbReceiver & dstRec){
-  assert(!m_using_ndb_record);
-  NdbRecAttr *src = m_rows[m_current_row++];
-  NdbRecAttr *dst = dstRec.theFirstRecAttr;
-  NdbRecAttr *start = src;
-  Uint32 tmp = m_recattr.m_hidden_count;
-  while(tmp--)
-    src = src->next();
-  
-  while(dst){
-    Uint32 len = src->get_size_in_bytes();
-    dst->receive_data((Uint32*)src->aRef(), len);
-    src = src->next();
-    dst = dst->next();
-  }
-
-  return start;
-}
-
 /**
  * pad
  * This function determines how much 'padding' should be applied

=== modified file 'storage/ndb/src/ndbapi/NdbScanOperation.cpp'
--- a/storage/ndb/src/ndbapi/NdbScanOperation.cpp	2011-04-27 10:48:16 +0000
+++ b/storage/ndb/src/ndbapi/NdbScanOperation.cpp	2011-05-11 13:31:44 +0000
@@ -395,8 +395,6 @@ NdbScanOperation::generatePackedReadAIs(
     columnCount++;
   }
 
-  theReceiver.m_record.m_column_count= columnCount;
-
   int result= 0;
 
   /* Are there any columns to read via NdbRecord? 
@@ -2335,8 +2333,7 @@ int NdbScanOperation::prepareSendScan(Ui
   {
     m_receivers[i]->do_setup_ndbrecord(m_attribute_record, batch_size,
                                        key_size, m_read_range_no,
-                                       rowsize, buf,
-                                       theReceiver.m_record.m_column_count);
+                                       rowsize, buf);
     buf+= bufsize;
   }
 


Attachment: [text/bzr-bundle] bzr/ole.john.aske@oracle.com-20110511133144-ldyacfqrxouq124w.bundle
Thread
bzr commit into mysql-5.1-telco-7.0 branch (ole.john.aske:4368) Ole John Aske11 May