List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:February 9 2011 3:00pm
Subject:bzr push into mysql-5.1-telco-7.0-spj-scan-vs-scan branch (jonas:3423 to
3424)
View as plain text  
 3424 Jonas Oreland	2011-02-09 [merge]
      ndb - merge 70-main again

    modified:
      mysql-test/suite/ndb/r/ndb_basic.result
      sql/ha_ndbcluster.cc
      storage/ndb/include/ndbapi/NdbIndexScanOperation.hpp
      storage/ndb/include/ndbapi/NdbReceiver.hpp
      storage/ndb/src/ndbapi/NdbRecAttr.cpp
      storage/ndb/src/ndbapi/NdbReceiver.cpp
      storage/ndb/src/ndbapi/NdbScanOperation.cpp
      storage/ndb/src/ndbapi/NdbTransactionScan.cpp
 3423 Jonas Oreland	2011-02-09
      ndb spj - remove added member variable NdbReceiver::m_query_operation_impl
        which is a duplicate of m_owner (albeit type-safe).
      
        changing sizeof(NdbReceiver) also changes sizeof(NdbOperation)
          which could be safe...i don't want to check...

    modified:
      storage/ndb/include/ndbapi/NdbReceiver.hpp
      storage/ndb/src/ndbapi/NdbImpl.hpp
      storage/ndb/src/ndbapi/NdbQueryOperation.cpp
      storage/ndb/src/ndbapi/NdbReceiver.cpp
      storage/ndb/src/ndbapi/NdbTransaction.cpp
      storage/ndb/src/ndbapi/NdbTransactionScan.cpp
      storage/ndb/src/ndbapi/Ndbif.cpp
=== modified file 'mysql-test/suite/ndb/r/ndb_basic.result'
--- a/mysql-test/suite/ndb/r/ndb_basic.result	2011-02-08 14:29:52 +0000
+++ b/mysql-test/suite/ndb/r/ndb_basic.result	2011-02-09 14:59:39 +0000
@@ -2,12 +2,12 @@ DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t
 drop database if exists mysqltest;
 SHOW GLOBAL STATUS LIKE 'ndb\_%';
 Variable_name	Value
-Ndb_api_bytes_received	#
-Ndb_api_bytes_received_session	#
-Ndb_api_bytes_received_slave	#
-Ndb_api_bytes_sent	#
-Ndb_api_bytes_sent_session	#
-Ndb_api_bytes_sent_slave	#
+Ndb_api_bytes_received_count	#
+Ndb_api_bytes_received_count_session	#
+Ndb_api_bytes_received_count_slave	#
+Ndb_api_bytes_sent_count	#
+Ndb_api_bytes_sent_count_session	#
+Ndb_api_bytes_sent_count_slave	#
 Ndb_api_event_bytes_count	#
 Ndb_api_event_bytes_count_injector	#
 Ndb_api_event_data_count	#
@@ -56,9 +56,9 @@ Ndb_api_wait_exec_complete_count_slave	#
 Ndb_api_wait_meta_request_count	#
 Ndb_api_wait_meta_request_count_session	#
 Ndb_api_wait_meta_request_count_slave	#
-Ndb_api_wait_nanos	#
-Ndb_api_wait_nanos_session	#
-Ndb_api_wait_nanos_slave	#
+Ndb_api_wait_nanos_count	#
+Ndb_api_wait_nanos_count_session	#
+Ndb_api_wait_nanos_count_slave	#
 Ndb_api_wait_scan_result_count	#
 Ndb_api_wait_scan_result_count_session	#
 Ndb_api_wait_scan_result_count_slave	#

=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc	2011-02-08 14:29:52 +0000
+++ b/sql/ha_ndbcluster.cc	2011-02-09 14:59:39 +0000
@@ -1244,13 +1244,13 @@ static int update_status_variables(Thd_n
   {"api_wait_meta_request_count" NAME_SUFFIX,                           \
    (char*) ARRAY_LOCATION[ Ndb::WaitMetaRequestCount ],                 \
    SHOW_LONGLONG},                                                      \
-  {"api_wait_nanos" NAME_SUFFIX,                                        \
+  {"api_wait_nanos_count" NAME_SUFFIX,                                  \
    (char*) ARRAY_LOCATION[ Ndb::WaitNanosCount ],                       \
    SHOW_LONGLONG},                                                      \
-  {"api_bytes_sent" NAME_SUFFIX,                                        \
+  {"api_bytes_sent_count" NAME_SUFFIX,                                  \
    (char*) ARRAY_LOCATION[ Ndb::BytesSentCount ],                       \
    SHOW_LONGLONG},                                                      \
-  {"api_bytes_received" NAME_SUFFIX,                                    \
+  {"api_bytes_received_count" NAME_SUFFIX,                              \
    (char*) ARRAY_LOCATION[ Ndb::BytesRecvdCount ],                      \
    SHOW_LONGLONG},                                                      \
   {"api_trans_start_count" NAME_SUFFIX,                                 \

=== modified file 'storage/ndb/include/ndbapi/NdbIndexScanOperation.hpp'
--- a/storage/ndb/include/ndbapi/NdbIndexScanOperation.hpp	2011-02-04 11:45:24 +0000
+++ b/storage/ndb/include/ndbapi/NdbIndexScanOperation.hpp	2011-02-09 14:59:39 +0000
@@ -376,7 +376,7 @@ NdbIndexScanOperation::setBound(Uint32 a
   return setBound(anAttrId, type, value);
 }
 
-/** 
+/**
  *   Compare keys of  the current records of two NdbReceiver objects.
  * @param r1 holds the first record to compare.
  * @param r2 holds the second record to compare.

=== modified file 'storage/ndb/include/ndbapi/NdbReceiver.hpp'
--- a/storage/ndb/include/ndbapi/NdbReceiver.hpp	2011-02-09 13:15:56 +0000
+++ b/storage/ndb/include/ndbapi/NdbReceiver.hpp	2011-02-09 14:59:39 +0000
@@ -199,8 +199,8 @@ private:
   Uint32 m_current_row;
   /* m_result_rows: Total number of rows contained in this batch. */
   Uint32 m_result_rows;
-  /* m_defined_rows: One less that the allocated length of the m_rows array. */
-//Uint32 m_defined_rows; - UNUSED
+
+  Uint32 m__UNUSED;
 
   /*
     m_expected_result_length: Total number of 32-bit words of TRANSID_AI and

=== modified file 'storage/ndb/src/ndbapi/NdbRecAttr.cpp'
--- a/storage/ndb/src/ndbapi/NdbRecAttr.cpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/ndbapi/NdbRecAttr.cpp	2011-02-09 11:15:39 +0000
@@ -182,7 +182,7 @@ ndbrecattr_print_formatted(NdbOut& out, 
   return NdbDictionary::printFormattedValue(out,
                                             f,
                                             r.getColumn(),
-                                            r.aRef());
+                                            r.isNULL()==0 ? r.aRef() : 0);
 }
 
 NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r)

=== modified file 'storage/ndb/src/ndbapi/NdbReceiver.cpp'
--- a/storage/ndb/src/ndbapi/NdbReceiver.cpp	2011-02-09 13:15:56 +0000
+++ b/storage/ndb/src/ndbapi/NdbReceiver.cpp	2011-02-09 14:59:39 +0000
@@ -33,7 +33,6 @@ NdbReceiver::NdbReceiver(Ndb *aNdb) :
   m_rows(NULL),
   m_current_row(0xffffffff),
   m_result_rows(0)
-//m_defined_rows(0),
 {}
  
 NdbReceiver::~NdbReceiver()
@@ -253,7 +252,8 @@ NdbReceiver::ndbrecord_rowsize(const Ndb
   */
   const NdbRecAttr *ra= first_rec_attr;
   while (ra != NULL)
-  { rowsize+= sizeof(Uint32) + ra->getColumn()->getSizeInBytes();
+  {
+    rowsize+= sizeof(Uint32) + ra->getColumn()->getSizeInBytes();
     ra= ra->next();
   }
   /* Ensure 4-byte alignment. */
@@ -667,7 +667,7 @@ NdbReceiver::execTRANSID_AI(const Uint32
   Uint32 save_pos= 0;
 
   bool ndbrecord_part_done= !m_using_ndb_record;
-  const bool isScan= (m_type == NDB_SCANRECEIVER) || 
+  const bool isScan= (m_type == NDB_SCANRECEIVER) ||
     (m_type == NDB_QUERY_OPERATION);
 
   /* Read words from the incoming signal train.
@@ -885,10 +885,13 @@ void
 NdbReceiver::setErrorCode(int code)
 {
   theMagicNumber = 0;
-  if(getType()==NDB_QUERY_OPERATION){
+  if (getType()==NDB_QUERY_OPERATION)
+  {
     NdbQueryOperationImpl* op = (NdbQueryOperationImpl*)getOwner();
     op->getQuery().setErrorCode(code);
-  }else{
+  }
+  else
+  {
     NdbOperation* const op = (NdbOperation*)getOwner();
     assert(op->checkMagicNumber()==0);
     op->setErrorCode(code);

=== modified file 'storage/ndb/src/ndbapi/NdbScanOperation.cpp'
--- a/storage/ndb/src/ndbapi/NdbScanOperation.cpp	2011-02-08 14:29:52 +0000
+++ b/storage/ndb/src/ndbapi/NdbScanOperation.cpp	2011-02-09 14:59:39 +0000
@@ -3692,7 +3692,7 @@ NdbIndexScanOperation::ordered_insert_re
   while (first < last)
   {
     Uint32 idx= (first+last)/2;
-    int res= compare_ndbrecord(receiver, 
+    int res= compare_ndbrecord(receiver,
                                m_api_receivers[idx],
                                m_key_record,
                                m_attribute_record,

=== modified file 'storage/ndb/src/ndbapi/NdbTransactionScan.cpp'
--- a/storage/ndb/src/ndbapi/NdbTransactionScan.cpp	2011-02-09 13:15:56 +0000
+++ b/storage/ndb/src/ndbapi/NdbTransactionScan.cpp	2011-02-09 14:59:39 +0000
@@ -103,7 +103,7 @@ NdbTransaction::receiveSCAN_TABCONF(cons
       return 1; // -> Finished
     }
 
-    int scanStatus = 0;
+    int retVal = -1;
     Uint32 words_per_op = theScanningOp ? 3 : 4;
     for(Uint32 i = 0; i<len; i += words_per_op)
     {
@@ -122,7 +122,7 @@ NdbTransaction::receiveSCAN_TABCONF(cons
         opCount = * ops++;
         totalLen = * ops++;
       }
-      
+
       void * tPtr = theNdb->int2void(ptrI);
       assert(tPtr); // For now
       NdbReceiver* tOp = theNdb->void2rec(tPtr);
@@ -135,21 +135,24 @@ NdbTransaction::receiveSCAN_TABCONF(cons
           assert (&queryOp->getQuery() == m_scanningQuery);
 
           if (queryOp->execSCAN_TABCONF(tcPtrI, opCount, totalLen, tOp))
-            scanStatus = 1; // We have result data, wakeup receiver
+            retVal = 0; // We have result data, wakeup receiver
         }
         else
         {
           if (tcPtrI == RNIL && opCount == 0)
+          {
             theScanningOp->receiver_completed(tOp);
+            retVal = 0;
+          }
           else if (tOp->execSCANOPCONF(tcPtrI, totalLen, opCount))
+          {
             theScanningOp->receiver_delivered(tOp);
-
-          // Plain Old scans always wakeup after SCAN_TABCONF
-          scanStatus = 1;
+            retVal = 0;
+          }
         }
       }
     } //for
-    return scanStatus;
+    return retVal;
   } else {
 #ifdef NDB_NO_DROPPED_SIGNAL
     abort();

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-telco-7.0-spj-scan-vs-scan branch (jonas:3423 to3424) Jonas Oreland9 Feb