List:Commits« Previous MessageNext Message »
From:gni Date:November 29 2007 3:15am
Subject:bk commit into 5.1 tree (gni:1.2555) BUG#30417
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of gni. When gni 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-11-29 10:15:07+08:00, gni@stripped +1 -0
  BUG#30417 Cluster misbehaves on auto-inc w/o PK.

  storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp@stripped, 2007-11-29 10:15:04+08:00,
gni@stripped +16 -15
    The check that how many auto_increment columns in table are there should be preceded
creating the table.
    If there are more than one auto_increment columns, the table shouldn't be created.

diff -Nrup a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
--- a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp	2007-09-12 19:57:58 +08:00
+++ b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp	2007-11-29 10:15:04 +08:00
@@ -2340,6 +2340,22 @@ NdbDictionaryImpl::createTable(NdbTableI
 { 
   DBUG_ENTER("NdbDictionaryImpl::createTable");
 
+  
+  bool autoIncrement = false;
+  Uint64 initialValue = 0;
+  for (Uint32 i = 0; i < t.m_columns.size(); i++) {
+    const NdbColumnImpl* c = t.m_columns[i];
+    assert(c != NULL);
+    if (c->m_autoIncrement) {
+      if (autoIncrement) {
+        m_error.code = 4335;
+        DBUG_RETURN(-1);
+      }
+      autoIncrement = true;
+      initialValue = c->m_autoIncrementInitialValue;
+    }
+  }
+ 
   // if the new name has not been set, use the copied name
   if (t.m_newExternalName.empty())
   {
@@ -2377,21 +2393,6 @@ NdbDictionaryImpl::createTable(NdbTableI
 
   // auto-increment - use "t" because initial value is not in DICT
   {
-    bool autoIncrement = false;
-    Uint64 initialValue = 0;
-    for (Uint32 i = 0; i < t.m_columns.size(); i++) {
-      const NdbColumnImpl* c = t.m_columns[i];
-      assert(c != NULL);
-      if (c->m_autoIncrement) {
-        if (autoIncrement) {
-          m_error.code = 4335;
-          delete t2;
-          DBUG_RETURN(-1);
-        }
-        autoIncrement = true;
-        initialValue = c->m_autoIncrementInitialValue;
-      }
-    }
     if (autoIncrement) {
       // XXX unlikely race condition - t.m_id may no longer be same table
       // the tuple id range is not used on input
Thread
bk commit into 5.1 tree (gni:1.2555) BUG#30417gni29 Nov