List:Commits« Previous MessageNext Message »
From:jonas Date:May 14 2007 7:37pm
Subject:bk commit into 5.1 tree (jonas:1.2535)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of jonas. When jonas does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-05-14 21:36:55+02:00, jonas@stripped +4 -0
  ndb - yet another interface tweak for computeHash
    make it static returning error code

  storage/ndb/include/ndbapi/Ndb.hpp@stripped, 2007-05-14 21:36:52+02:00, jonas@stripped +5 -27
    yet another interface tweak for computeHash
      make it static returning error code

  storage/ndb/src/ndbapi/Ndb.cpp@stripped, 2007-05-14 21:36:52+02:00, jonas@stripped +11 -18
    yet another interface tweak for computeHash
      make it static returning error code

  storage/ndb/src/ndbapi/NdbOperationSearch.cpp@stripped, 2007-05-14 21:36:52+02:00, jonas@stripped +2 -3
    yet another interface tweak for computeHash
      make it static returning error code

  storage/ndb/src/ndbapi/NdbTransaction.cpp@stripped, 2007-05-14 21:36:53+02:00, jonas@stripped +2 -3
    yet another interface tweak for computeHash
      make it static returning error code

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	jonas
# Host:	perch.ndb.mysql.com
# Root:	/home/jonas/src/51-telco

--- 1.67/storage/ndb/include/ndbapi/Ndb.hpp	2007-05-14 21:37:01 +02:00
+++ 1.68/storage/ndb/include/ndbapi/Ndb.hpp	2007-05-14 21:37:01 +02:00
@@ -1365,12 +1365,12 @@
    *       if xfrmbuf is not null but length is too short, method will fail
    *
    * @return 0 - ok - hashvalueptr is set
-   *         else - fail, with error code set
+   *         else - fail, return error code
    */
-  int computeHash(Uint32* hashvalueptr,
-                  const NdbDictionary::Table*, 
-                  const struct Key_part_ptr * keyData,
-                  void* xfrmbuf = 0, Uint32 xfrmbuflen = 0);
+  static int computeHash(Uint32* hashvalueptr,
+                         const NdbDictionary::Table*, 
+                         const struct Key_part_ptr * keyData,
+                         void* xfrmbuf = 0, Uint32 xfrmbuflen = 0);
   
   /**
    * Close a transaction.
@@ -1830,28 +1830,6 @@
 #ifdef VM_TRACE
   void printState(const char* fmt, ...);
 #endif
-
-  friend void
-  set_distribution_key_from_range(class NdbIndexScanOperation *op,
-                                  const class NdbRecord *record,
-                                  const char *row,
-                                  Uint32 distkey_max);
-
-  static int computeHash(NdbError*, Uint32* hashvalueptr,
-                         const NdbDictionary::Table*, 
-                         const struct Key_part_ptr * keyData,
-                         void* xfrmbuf, Uint32 xfrmbuflen);
 };
-
-inline
-int 
-Ndb::computeHash(Uint32* hashvalueptr,
-                 const NdbDictionary::Table* table, 
-                 const struct Key_part_ptr * keyData,
-                 void* xfrmbuf, Uint32 xfrmbuflen)
-{
-  return Ndb::computeHash(&theError, hashvalueptr, table, keyData,
-                          xfrmbuf, xfrmbuflen);
-}
 
 #endif

--- 1.89/storage/ndb/src/ndbapi/Ndb.cpp	2007-05-14 21:37:01 +02:00
+++ 1.90/storage/ndb/src/ndbapi/Ndb.cpp	2007-05-14 21:37:01 +02:00
@@ -306,8 +306,7 @@
 Remark:         Start transaction. Synchronous.
 *****************************************************************************/ 
 int
-Ndb::computeHash(NdbError* theError,
-                 Uint32 *retval,
+Ndb::computeHash(Uint32 *retval,
                  const NdbDictionary::Table *table,
                  const struct Key_part_ptr * keyData, 
                  void* buf, Uint32 bufLen)
@@ -457,36 +456,28 @@
   return 0;
   
 enullptr:
-  theError->code = 4316;
-  return -1;
+  return 4316;
   
 emissingnullptr:
-  theError->code = 4276;
-  return -1;
+  return 4276;
 
 elentosmall:
-  theError->code = 4277;
-  return -1;
+  return 4277;
 
 ebuftosmall:
-  theError->code = 4278;
-  return -1;
+  return 4278;
 
 emalformedstring:
   if (bufLen == 0)
     free(buf);
   
-  theError->code = 4279;
-  return -1;
+  return 4279;
   
 emalformedkey:
-  theError->code = 4280;
-  return -1;
+  return 4280;
 
 enomem:
-  theError->code = 4000;
-  return -1;
-
+  return 4000;
 }
 
 NdbTransaction* 
@@ -494,12 +485,14 @@
 		      const struct Key_part_ptr * keyData, 
 		      void* buf, Uint32 bufLen)
 {
+  int ret;
   Uint32 hash;
-  if (computeHash(&hash, table, keyData, buf, bufLen) == 0)
+  if ((ret = computeHash(&hash, table, keyData, buf, bufLen)) == 0)
   {
     return startTransaction(table, table->getPartitionId(hash));
   }
 
+  theError.code = ret;
   return 0;
 }
 

--- 1.86/storage/ndb/src/ndbapi/NdbTransaction.cpp	2007-05-14 21:37:01 +02:00
+++ 1.87/storage/ndb/src/ndbapi/NdbTransaction.cpp	2007-05-14 21:37:01 +02:00
@@ -2455,8 +2455,7 @@
   ptrs[i].ptr = 0;
   
   Uint32 hashValue;
-  NdbError err;
-  int ret = Ndb::computeHash(&err, &hashValue, 
+  int ret = Ndb::computeHash(&hashValue, 
                              record->base_table, 
                              ptrs, tmp, sizeof(tmp));
   if (ret == 0)
@@ -2466,7 +2465,7 @@
 #ifdef VM_TRACE
   else
   {
-    ndbout << "err: " << err.code << endl;
+    ndbout << "err: " << ret << endl;
     assert(false);
   }
 #endif

--- 1.37/storage/ndb/src/ndbapi/NdbOperationSearch.cpp	2007-05-14 21:37:01 +02:00
+++ 1.38/storage/ndb/src/ndbapi/NdbOperationSearch.cpp	2007-05-14 21:37:01 +02:00
@@ -537,10 +537,9 @@
     ptrs[0].len = len;
     ptrs[1].ptr = 0;
     
-    NdbError err;
     Uint64 tmp[1000];
     Uint32 hashValue;
-    int ret = Ndb::computeHash(&err, &hashValue, 
+    int ret = Ndb::computeHash(&hashValue, 
                                m_currentTable,
                                ptrs, tmp, sizeof(tmp));
     
@@ -551,7 +550,7 @@
 #ifdef VM_TRACE
     else
     {
-      ndbout << "Err: " << err.code << endl;
+      ndbout << "Err: " << ret << endl;
       assert(false);
     }
 #endif
Thread
bk commit into 5.1 tree (jonas:1.2535)jonas14 May