MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Martin Skold Date:May 31 2006 1:33pm
Subject:bk commit into 5.0 tree (mskold:1.2156)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 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.2156 06/05/31 15:32:49 mskold@stripped +2 -0
  Merge mskold@stripped:/home/bk/mysql-5.0
  into  mysql.com:/home/marty/MySQL/mysql-5.0

  sql/ha_ndbcluster.cc
    1.249 06/05/31 15:32:24 mskold@stripped +0 -0
    Auto merged

  ndb/src/ndbapi/NdbDictionaryImpl.cpp
    1.91 06/05/31 15:32:21 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:	linux.site
# Root:	/home/marty/MySQL/mysql-5.0/RESYNC

--- 1.90/ndb/src/ndbapi/NdbDictionaryImpl.cpp	2006-05-17 12:30:57 +02:00
+++ 1.91/ndb/src/ndbapi/NdbDictionaryImpl.cpp	2006-05-31 15:32:21 +02:00
@@ -2267,7 +2267,7 @@
     m_error.code = 4243;
     return -1;
   }
-  int ret = dropIndex(*idx, tableName);
+  int ret = dropIndex(*idx); //, tableName);
   // If index stored in cache is incompatible with the one in the kernel
   // we must clear the cache and try again
   if (ret == INCOMPATIBLE_VERSION) {
@@ -2289,40 +2289,23 @@
 }
 
 int
-NdbDictionaryImpl::dropIndex(NdbIndexImpl & impl, const char * tableName)
+NdbDictionaryImpl::dropIndex(NdbIndexImpl & impl)
 {
-  const char * indexName = impl.getName();
-  if (tableName || m_ndb.usingFullyQualifiedNames()) {
     NdbTableImpl * timpl = impl.m_table;
     
     if (timpl == 0) {
       m_error.code = 709;
       return -1;
     }
-
-    const BaseString internalIndexName((tableName)
-      ?
-      m_ndb.internalize_index_name(getTable(tableName), indexName)
-      :
-      m_ndb.internalize_table_name(indexName)); // Index is also a table
-
-    if(impl.m_status == NdbDictionary::Object::New){
-      return dropIndex(indexName, tableName);
-    }
-
     int ret = m_receiver.dropIndex(impl, *timpl);
     if(ret == 0){
-      m_localHash.drop(internalIndexName.c_str());
+      m_localHash.drop(timpl->m_internalName.c_str());
       m_globalHash->lock();
-      impl.m_table->m_status = NdbDictionary::Object::Invalid;
-      m_globalHash->drop(impl.m_table);
+      timpl->m_status = NdbDictionary::Object::Invalid;
+      m_globalHash->drop(timpl);
       m_globalHash->unlock();
     }
     return ret;
-  }
-
-  m_error.code = 4243;
-  return -1;
 }
 
 int

--- 1.248/sql/ha_ndbcluster.cc	2006-05-22 14:39:34 +02:00
+++ 1.249/sql/ha_ndbcluster.cc	2006-05-31 15:32:24 +02:00
@@ -73,7 +73,6 @@
   HTON_NO_FLAGS
 };
 
-#define NDB_FAILED_AUTO_INCREMENT ~(Uint64)0
 #define NDB_AUTO_INCREMENT_RETRIES 10
 
 #define NDB_INVALID_SCHEMA_OBJECT 241
@@ -2114,14 +2113,15 @@
   {
     // Table has hidden primary key
     Ndb *ndb= get_ndb();
-    Uint64 auto_value= NDB_FAILED_AUTO_INCREMENT;
+    int ret;
+    Uint64 auto_value;
     uint retries= NDB_AUTO_INCREMENT_RETRIES;
     do {
-      auto_value= ndb->getAutoIncrementValue((const NDBTAB *) m_table);
-    } while (auto_value == NDB_FAILED_AUTO_INCREMENT && 
+      ret= ndb->getAutoIncrementValue((const NDBTAB *) m_table, auto_value, 1);
+    } while (ret == -1 && 
              --retries &&
              ndb->getNdbError().status == NdbError::TemporaryError);
-    if (auto_value == NDB_FAILED_AUTO_INCREMENT)
+    if (ret == -1)
       ERR_RETURN(ndb->getNdbError());
     if (set_hidden_key(op, table->s->fields, (const byte*)&auto_value))
       ERR_RETURN(op->getNdbError());
@@ -2199,11 +2199,11 @@
     Ndb *ndb= get_ndb();
     Uint64 next_val= (Uint64) table->next_number_field->val_int() + 1;
     DBUG_PRINT("info", 
-               ("Trying to set next auto increment value to %lu",
-                (ulong) next_val));
-    if (ndb->setAutoIncrementValue((const NDBTAB *) m_table, next_val, TRUE))
-      DBUG_PRINT("info", 
-                 ("Setting next auto increment value to %u", next_val));  
+               ("Trying to set next auto increment value to %llu",
+                (ulonglong) next_val));
+    if (ndb->setAutoIncrementValue((const NDBTAB *) m_table, next_val, TRUE)
+        == -1)
+      ERR_RETURN(ndb->getNdbError());
   }
   m_skip_auto_increment= TRUE;
 
@@ -3049,8 +3049,17 @@
     {
       Ndb *ndb= get_ndb();
       
-      auto_increment_value= 
-        ndb->readAutoIncrementValue((const NDBTAB *) m_table);
+      Uint64 auto_increment_value64;
+      if (ndb->readAutoIncrementValue((const NDBTAB *) m_table,
+                                      auto_increment_value64) == -1)
+      {
+        const NdbError err= ndb->getNdbError();
+        sql_print_error("Error %lu in readAutoIncrementValue(): %s",
+                        (ulong) err.code, err.message);
+        auto_increment_value= ~(Uint64)0;
+      }
+      else
+        auto_increment_value= (ulonglong)auto_increment_value64;
     }
   }
   DBUG_VOID_RETURN;
@@ -4414,17 +4423,17 @@
            m_rows_to_insert - m_rows_inserted :
            ((m_rows_to_insert > m_autoincrement_prefetch) ?
             m_rows_to_insert : m_autoincrement_prefetch));
-  auto_value= NDB_FAILED_AUTO_INCREMENT;
+  int ret;
   uint retries= NDB_AUTO_INCREMENT_RETRIES;
   do {
-    auto_value=
-      (m_skip_auto_increment) ? 
-      ndb->readAutoIncrementValue((const NDBTAB *) m_table)
-      : ndb->getAutoIncrementValue((const NDBTAB *) m_table, cache_size);
-  } while (auto_value == NDB_FAILED_AUTO_INCREMENT && 
+    ret=
+      m_skip_auto_increment ? 
+      ndb->readAutoIncrementValue((const NDBTAB *) m_table, auto_value) :
+      ndb->getAutoIncrementValue((const NDBTAB *) m_table, auto_value, cache_size);
+  } while (ret == -1 && 
            --retries &&
            ndb->getNdbError().status == NdbError::TemporaryError);
-  if (auto_value == NDB_FAILED_AUTO_INCREMENT)
+  if (ret == -1)
   {
     const NdbError err= ndb->getNdbError();
     sql_print_error("Error %lu in ::get_auto_increment(): %s",
Thread
bk commit into 5.0 tree (mskold:1.2156)Martin Skold31 May