List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:September 30 2009 8:01am
Subject:bzr push into mysql-5.1-telco-6.3 branch (jonas:3075 to 3078)
View as plain text  
 3078 Jonas Oreland	2009-09-30
      ndb - fix "bug" where transaction is closed, and error code is retreived afterwards

    modified:
      sql/ha_ndbcluster_binlog.cc
 3077 Jonas Oreland	2009-09-30
      ndb - fix "bugs" where objects are accessed after they've been released

    modified:
      storage/ndb/src/ndbapi/Ndb.cpp
      storage/ndb/src/ndbapi/NdbScanOperation.cpp
 3076 Jonas Oreland	2009-09-30
      ndb - improve valgrind "precision" by not pooling any object, instead doing new/delete

    modified:
      storage/ndb/src/ndbapi/NdbImpl.hpp
 3075 Frazer Clement	2009-09-29
      bug#47323 merge fix, as ndb_log_update* vars become visible in 6.3+, and DELETE logs all columns in 6.3+ when log_update_only=OFF

    modified:
      mysql-test/suite/ndb_binlog/r/ndb_binlog_variants.result
=== modified file 'sql/ha_ndbcluster_binlog.cc'
--- a/sql/ha_ndbcluster_binlog.cc	2009-09-21 13:53:09 +0000
+++ b/sql/ha_ndbcluster_binlog.cc	2009-09-30 07:07:41 +0000
@@ -3811,7 +3811,6 @@ ndbcluster_read_binlog_replication(THD *
       ndb->closeTransaction(trans);
       break;
     }
-    ndb->closeTransaction(trans);
     for (i= 0; i < 2; i++)
     {
       if (op[i]->getNdbError().code)
@@ -3860,9 +3859,11 @@ ndbcluster_read_binlog_replication(THD *
       {
         error_str= tmp_buf;
         error= 1;
+        ndb->closeTransaction(trans);
         goto err;
       }
     }
+    ndb->closeTransaction(trans);
 
     DBUG_RETURN(0);
   }

=== modified file 'storage/ndb/src/ndbapi/Ndb.cpp'
--- a/storage/ndb/src/ndbapi/Ndb.cpp	2009-09-21 13:53:09 +0000
+++ b/storage/ndb/src/ndbapi/Ndb.cpp	2009-09-30 07:03:58 +0000
@@ -192,13 +192,13 @@ Ndb::NDB_connect(Uint32 tNode) 
     tNdbCon->theNext = tPrevFirst;
     DBUG_RETURN(1);
   } else {
-    releaseNdbCon(tNdbCon);
 //****************************************************************************
 // Unsuccessful connect is indicated by 3.
 //****************************************************************************
     DBUG_PRINT("info",
 	       ("unsuccessful connect tReturnCode %d, tNdbCon->Status() %d",
 		tReturnCode, tNdbCon->Status()));
+    releaseNdbCon(tNdbCon);
     if (theError.code == 299 || // single user mode
         theError.code == 281 )  // cluster shutdown in progress
     {

=== modified file 'storage/ndb/src/ndbapi/NdbImpl.hpp'
--- a/storage/ndb/src/ndbapi/NdbImpl.hpp	2009-06-22 08:23:35 +0000
+++ b/storage/ndb/src/ndbapi/NdbImpl.hpp	2009-09-30 06:58:07 +0000
@@ -224,6 +224,7 @@ inline
 int
 Ndb_free_list_t<T>::fill(Ndb* ndb, Uint32 cnt)
 {
+#ifndef HAVE_purify
   if (m_free_list == 0)
   {
     m_free_cnt++;
@@ -251,6 +252,9 @@ Ndb_free_list_t<T>::fill(Ndb* ndb, Uint3
     m_free_list = obj;
   }
   return 0;
+#else
+  return 0;
+#endif
 }
 
 template<class T>
@@ -258,6 +262,7 @@ inline
 T*
 Ndb_free_list_t<T>::seize(Ndb* ndb)
 {
+#ifndef HAVE_purify
   T* tmp = m_free_list;
   if (tmp)
   {
@@ -277,6 +282,9 @@ Ndb_free_list_t<T>::seize(Ndb* ndb)
     assert(false);
   }
   return tmp;
+#else
+  return new T(ndb);
+#endif
 }
 
 template<class T>
@@ -284,9 +292,13 @@ inline
 void
 Ndb_free_list_t<T>::release(T* obj)
 {
+#ifndef HAVE_purify
   obj->next(m_free_list);
   m_free_list = obj;
   m_free_cnt++;
+#else
+  delete obj;
+#endif
 }
 
 
@@ -310,6 +322,7 @@ inline
 void
 Ndb_free_list_t<T>::release(Uint32 cnt, T* head, T* tail)
 {
+#ifndef HAVE_purify
   if (cnt)
   {
 #ifdef VM_TRACE
@@ -323,6 +336,19 @@ Ndb_free_list_t<T>::release(Uint32 cnt, 
     m_free_list = head;
     m_free_cnt += cnt;
   }
+#else
+  if (cnt)
+  {
+    T* tmp = head;
+    while (tmp != 0 && tmp != tail)
+    {
+      T * next = (T*)tmp->next();
+      delete tmp;
+      tmp = next;
+    }
+    delete tail;
+  }
+#endif
 }
 
 #endif

=== modified file 'storage/ndb/src/ndbapi/NdbScanOperation.cpp'
--- a/storage/ndb/src/ndbapi/NdbScanOperation.cpp	2009-05-27 12:11:46 +0000
+++ b/storage/ndb/src/ndbapi/NdbScanOperation.cpp	2009-09-30 07:03:58 +0000
@@ -1991,8 +1991,11 @@ void NdbScanOperation::close(bool forceS
     close_impl(tp, forceSend, &poll_guard);
   }
 
+  // Keep in local variables, as "this" might be destructed below
   NdbConnection* tCon = theNdbCon;
   NdbConnection* tTransCon = m_transConnection;
+  Ndb* tNdb = theNdb;
+
   theNdbCon = NULL;
   m_transConnection = NULL;
 
@@ -2020,8 +2023,8 @@ void NdbScanOperation::close(bool forceS
   }
   
   tCon->theScanningOp = 0;
-  theNdb->closeTransaction(tCon);
-  theNdb->theRemainingStartTransactions--;
+  tNdb->closeTransaction(tCon);
+  tNdb->theRemainingStartTransactions--;
   DBUG_VOID_RETURN;
 }
 


Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20090930070741-13u316s7s2l7e1ej.bundle
Thread
bzr push into mysql-5.1-telco-6.3 branch (jonas:3075 to 3078)Jonas Oreland30 Sep