List:Commits« Previous MessageNext Message »
From:Magnus Blåudd Date:November 7 2011 12:54pm
Subject:bzr push into mysql-5.5-cluster branch (magnus.blaudd:3626 to 3627)
View as plain text  
 3627 Magnus Blåudd	2011-11-05
      ndbcluster
       - add class fucntion for destroying NDB_SHARE object

    modified:
      sql/ha_ndbcluster.cc
      sql/ndb_share.cc
      sql/ndb_share.h
 3626 Magnus Blåudd	2011-11-05
      ndbcluster
       - move the logic for "have_lock" out of 'ndbcluster_get_share'

    modified:
      sql/ha_ndbcluster.cc
=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc	2011-11-05 09:10:46 +0000
+++ b/sql/ha_ndbcluster.cc	2011-11-05 11:35:57 +0000
@@ -13838,25 +13838,8 @@ void ndbcluster_real_free_share(NDB_SHAR
     found= my_hash_delete(&ndbcluster_open_tables, (uchar*) *share) == 0;
   }
   assert(found);
-  thr_lock_delete(&(*share)->lock);
-  pthread_mutex_destroy(&(*share)->mutex);
 
-#ifdef HAVE_NDB_BINLOG
-  if ((*share)->m_cfn_share && (*share)->m_cfn_share->m_ex_tab && g_ndb)
-  {
-    NDBDICT *dict= g_ndb->getDictionary();
-    dict->removeTableGlobal(*(*share)->m_cfn_share->m_ex_tab, 0);
-    (*share)->m_cfn_share->m_ex_tab= 0;
-  }
-#endif
-  (*share)->new_op= 0;
-  if ((*share)->event_data)
-  {
-    delete (*share)->event_data;
-    (*share)->event_data= 0;
-  }
-  free_root(&(*share)->mem_root, MYF(0));
-  my_free((uchar*) *share, MYF(0));
+  NDB_SHARE::destroy(*share);
   *share= 0;
 
   dbug_print_open_tables();

=== modified file 'sql/ndb_share.cc'
--- a/sql/ndb_share.cc	2011-03-08 09:04:24 +0000
+++ b/sql/ndb_share.cc	2011-11-05 11:35:57 +0000
@@ -16,3 +16,32 @@
 */
 
 #include "ndb_share.h"
+#include "ndb_event_data.h"
+
+#include <my_sys.h>
+
+extern Ndb* g_ndb;
+
+void
+NDB_SHARE::destroy(NDB_SHARE* share)
+{
+  thr_lock_delete(&share->lock);
+  pthread_mutex_destroy(&share->mutex);
+
+#ifdef HAVE_NDB_BINLOG
+  if (share->m_cfn_share && share->m_cfn_share->m_ex_tab && g_ndb)
+  {
+    NdbDictionary::Dictionary *dict= g_ndb->getDictionary();
+    dict->removeTableGlobal(*(share->m_cfn_share->m_ex_tab), 0);
+    share->m_cfn_share->m_ex_tab= 0;
+  }
+#endif
+  share->new_op= 0;
+  if (share->event_data)
+  {
+    delete share->event_data;
+    share->event_data= 0;
+  }
+  free_root(&share->mem_root, MYF(0));
+  my_free(share);
+}
\ No newline at end of file

=== modified file 'sql/ndb_share.h'
--- a/sql/ndb_share.h	2011-10-31 15:57:15 +0000
+++ b/sql/ndb_share.h	2011-11-05 11:35:57 +0000
@@ -187,6 +187,8 @@ struct NDB_SHARE {
   char *old_names; // for rename table
   MY_BITMAP *subscriber_bitmap;
   class NdbEventOperation *new_op;
+
+  static void destroy(NDB_SHARE* share);
 };
 
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.5-cluster branch (magnus.blaudd:3626 to 3627) Magnus Blåudd7 Nov