List:Commits« Previous MessageNext Message »
From:Martin Skold Date:April 11 2006 12:29pm
Subject:bk commit into 5.1 tree (mskold:1.2322)
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
  1.2322 06/04/11 14:29:37 mskold@stripped +1 -0
  Merge 192.168.123.145:MySQL/mysql-5.1-new
  into  mysql.com:/usr/local/home/marty/MySQL/mysql-5.1-new

  sql/ha_ndbcluster.cc
    1.295 06/04/11 14:29:29 mskold@stripped +0 -0
    Auto merged

# 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:	blowfish.ndb.mysql.com
# Root:	/usr/local/home/marty/MySQL/mysql-5.1-new/RESYNC

--- 1.294/sql/ha_ndbcluster.cc	2006-04-11 09:53:50 +02:00
+++ 1.295/sql/ha_ndbcluster.cc	2006-04-11 14:29:29 +02:00
@@ -4696,8 +4696,9 @@
   DBUG_RETURN(my_errno);
 }
 
-int ha_ndbcluster::create_handler_files(const char *file) 
+int ha_ndbcluster::create_handler_files(const char *file, HA_CREATE_INFO *info) 
 { 
+  char path[FN_REFLEN];
   const char *name;
   Ndb* ndb;
   const NDBTAB *tab;
@@ -4707,16 +4708,21 @@
 
   DBUG_ENTER("create_handler_files");
 
+  DBUG_PRINT("enter", ("file: %s", file));
   if (!(ndb= get_ndb()))
     DBUG_RETURN(HA_ERR_NO_CONNECTION);
 
   NDBDICT *dict= ndb->getDictionary();
-  if (!(tab= dict->getTable(m_tabname)))
+  if (!info->frm_only)
     DBUG_RETURN(0); // Must be a create, ignore since frm is saved in create
+  set_dbname(file);
+  set_tabname(file);
+  DBUG_PRINT("info", ("m_dbname: %s, m_tabname: %s", m_dbname, m_tabname));
+  if (!(tab= dict->getTable(m_tabname)))
+    DBUG_RETURN(0); // Unkown table, must be temporary table
+
   DBUG_ASSERT(get_ndb_share_state(m_share) == NSS_ALTERED);
-  name= table->s->normalized_path.str;
-  DBUG_PRINT("enter", ("m_tabname: %s, path: %s", m_tabname, name));
-  if (readfrm(name, &data, &length) ||
+  if (readfrm(file, &data, &length) ||
       packfrm(data, length, &pack_data, &pack_length))
   {
     DBUG_PRINT("info", ("Missing frm for %s", m_tabname));
@@ -4732,6 +4738,7 @@
     my_free((char*)data, MYF(MY_ALLOW_ZERO_PTR));
     my_free((char*)pack_data, MYF(MY_ALLOW_ZERO_PTR));
   }
+  
   set_ndb_share_state(m_share, NSS_INITIAL);
   free_share(&m_share); // Decrease ref_count
 
@@ -4839,6 +4846,15 @@
 }
 
 /*
+ Prepare for an on-line alter table
+*/ 
+void ha_ndbcluster::prepare_for_alter()
+{
+  ndbcluster_get_share(m_share); // Increase ref_count
+  set_ndb_share_state(m_share, NSS_ALTERED);
+}
+
+/*
   Add an index on-line to a table
 */
 int ha_ndbcluster::add_index(TABLE *table_arg, 
@@ -4850,7 +4866,7 @@
   int error= 0;
   uint idx;
 
-  DBUG_ASSERT(m_share->state == NSS_INITIAL);
+  DBUG_ASSERT(m_share->state == NSS_ALTERED);
   for (idx= 0; idx < num_of_keys; idx++)
   {
     KEY *key= key_info + idx;
@@ -4866,10 +4882,10 @@
     if((error= create_index(key_info[idx].name, key, idx_type, idx)))
       break;
   }
-  if (!error)
+  if (error)
   {
-    ndbcluster_get_share(m_share); // Increase ref_count
-    set_ndb_share_state(m_share, NSS_ALTERED);
+    set_ndb_share_state(m_share, NSS_INITIAL);
+    free_share(&m_share); // Decrease ref_count
   }
   DBUG_RETURN(error);  
 }
@@ -4894,7 +4910,7 @@
                                       uint *key_num, uint num_of_keys)
 {
   DBUG_ENTER("ha_ndbcluster::prepare_drop_index");
-  DBUG_ASSERT(m_share->state == NSS_INITIAL);
+  DBUG_ASSERT(m_share->state == NSS_ALTERED);
   // Mark indexes for deletion
   uint idx;
   for (idx= 0; idx < num_of_keys; idx++)
@@ -4907,8 +4923,6 @@
   Thd_ndb *thd_ndb= get_thd_ndb(thd);
   Ndb *ndb= thd_ndb->ndb;
   renumber_indexes(ndb, table_arg);
-  ndbcluster_get_share(m_share); // Increase ref_count
-  set_ndb_share_state(m_share, NSS_ALTERED);
   DBUG_RETURN(0);
 }
  
Thread
bk commit into 5.1 tree (mskold:1.2322)Martin Skold11 Apr