List:Commits« Previous MessageNext Message »
From:Martin Skold Date:July 20 2007 8:11am
Subject:bk commit into 5.1 tree (mskold:1.2585)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of marty. When marty 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-07-20 08:11:44+02:00, mskold@stripped +2 -0
  ha_ndbcluster_binlog.cc:
    WL3680 On-line add attribute, ndbcluster handler part: handling of locally dropped
table
  ha_ndbcluster.cc:
    WL3680 On-line add attribute, ndbcluster handler part: fixed cleanup in error handling

  sql/ha_ndbcluster.cc@stripped, 2007-07-20 07:58:29+02:00, mskold@stripped +15 -18
    WL3680 On-line add attribute, ndbcluster handler part: fixed cleanup in error handling

  sql/ha_ndbcluster_binlog.cc@stripped, 2007-07-20 08:00:27+02:00, mskold@stripped +5 -3
    WL3680 On-line add attribute, ndbcluster handler part: handling of locally dropped
table

# 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:	mskold
# Host:	linux.site
# Root:	/windows/Linux_space/MySQL/mysql-5.1-telco-6.2

--- 1.483/sql/ha_ndbcluster.cc	2007-07-20 08:11:59 +02:00
+++ 1.484/sql/ha_ndbcluster.cc	2007-07-20 08:11:59 +02:00
@@ -6251,14 +6251,6 @@ int ha_ndbcluster::add_index(TABLE *tabl
     if((error= create_index(key_info[idx].name, key, idx_type, idx)))
       break;
   }
-  if (error)
-  {
-    set_ndb_share_state(m_share, NSS_INITIAL);
-    /* ndb_share reference schema free */
-    DBUG_PRINT("NDB_SHARE", ("%s binlog schema free  use_count: %u",
-                             m_share->key, m_share->use_count));
-    free_share(&m_share); // Decrease ref_count
-  }
   DBUG_RETURN(error);  
 }
 
@@ -6298,14 +6290,7 @@ int ha_ndbcluster::final_drop_index(TABL
   THD *thd= current_thd;
   Thd_ndb *thd_ndb= get_thd_ndb(thd);
   Ndb *ndb= thd_ndb->ndb;
-  if((error= drop_indexes(ndb, table_arg)))
-  {
-    m_share->state= NSS_INITIAL;
-    /* ndb_share reference schema free */
-    DBUG_PRINT("NDB_SHARE", ("%s binlog schema free  use_count: %u",
-                             m_share->key, m_share->use_count));
-    free_share(&m_share); // Decrease ref_count
-  }
+  error= drop_indexes(ndb, table_arg);
   DBUG_RETURN(error);
 }
 
@@ -10883,8 +10868,7 @@ int ha_ndbcluster::alter_table_phase1(TH
   }
 #endif
 
-  ndbcluster_get_share(m_share); // Increase ref_count
-  set_ndb_share_state(m_share, NSS_ALTERED);
+  prepare_for_alter();
 
   if ((*alter_flags & adding).is_set())
   {
@@ -10987,6 +10971,11 @@ int ha_ndbcluster::alter_table_phase1(TH
 
   DBUG_RETURN(0);
  err:
+  set_ndb_share_state(m_share, NSS_INITIAL);
+  /* ndb_share reference schema free */
+  DBUG_PRINT("NDB_SHARE", ("%s binlog schema free  use_count: %u",
+                           m_share->key, m_share->use_count));
+  free_share(&m_share); // Decrease ref_count
   delete alter_data;
   DBUG_RETURN(error);
 }
@@ -11078,6 +11067,14 @@ int ha_ndbcluster::alter_table_phase2(TH
   DBUG_ASSERT(alter_data);
   error= alter_frm(altered_table->s->path.str, alter_data);
  err:
+  if (error)
+  {
+    set_ndb_share_state(m_share, NSS_INITIAL);
+    /* ndb_share reference schema free */
+    DBUG_PRINT("NDB_SHARE", ("%s binlog schema free  use_count: %u",
+                             m_share->key, m_share->use_count));
+    free_share(&m_share); // Decrease ref_count
+  }
   delete alter_data;
   DBUG_RETURN(error);
 }

--- 1.124/sql/ha_ndbcluster_binlog.cc	2007-07-20 08:11:59 +02:00
+++ 1.125/sql/ha_ndbcluster_binlog.cc	2007-07-20 08:11:59 +02:00
@@ -1860,7 +1860,8 @@ ndb_handle_schema_change(THD *thd, Ndb *
     share->table->s->table_name.str= share->table_name;
     share->table->s->table_name.length= strlen(share->table_name);
   }
-  DBUG_ASSERT(share->op == pOp || ndb_is_old_event_op(share, pOp));
+  DBUG_ASSERT(share->state == NSS_DROPPED || 
+              share->op == pOp || ndb_is_old_event_op(share, pOp));
   if (ndb_is_old_event_op(share, pOp))
   {
     Ndb_event_data *event_data= (Ndb_event_data *) pOp->getCustomData();
@@ -1871,7 +1872,7 @@ ndb_handle_schema_change(THD *thd, Ndb *
     }
     ndb_remove_old_event_op(share, pOp);
   }
-  else
+  else if (share->op)
   {
     Ndb_event_data *event_data= (Ndb_event_data *) share->op->getCustomData();
     if (event_data)
@@ -2321,7 +2322,8 @@ ndb_binlog_thread_handle_schema_event_po
       case SOT_RENAME_TABLE:
         // fall through
       case SOT_ALTER_TABLE:
-	   if (share) ndb_drop_old_event_ops(injector_ndb, share);
+        if (share && schema_type == SOT_ALTER_TABLE)
+          ndb_drop_old_event_ops(injector_ndb, share);
         // invalidation already handled by binlog thread
         if (!share || !share->op)
         {
Thread
bk commit into 5.1 tree (mskold:1.2585)Martin Skold20 Jul