List:Commits« Previous MessageNext Message »
From:jonas Date:April 12 2007 2:04pm
Subject:bk commit into 5.1 tree (jonas:1.2533)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of jonas. When jonas 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-04-12 16:04:47+02:00, jonas@stripped +10 -0
  Merge perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb
  into  perch.ndb.mysql.com:/home/jonas/src/51-telco
  MERGE: 1.2494.1.85

  sql/ha_ndbcluster.cc@stripped, 2007-04-12 16:04:43+02:00, jonas@stripped +0 -0
    Auto merged
    MERGE: 1.408.1.36

  storage/ndb/include/ndbapi/NdbDictionary.hpp@stripped, 2007-04-12 16:04:43+02:00, jonas@stripped +0 -0
    Auto merged
    MERGE: 1.87.2.5

  storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp@stripped, 2007-04-12 16:04:43+02:00, jonas@stripped +0 -0
    Auto merged
    MERGE: 1.22.1.5

  storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp@stripped, 2007-04-12 16:04:43+02:00, jonas@stripped +0 -0
    Auto merged
    MERGE: 1.35.1.1

  storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp@stripped, 2007-04-12 16:04:43+02:00, jonas@stripped +0 -0
    Auto merged
    MERGE: 1.159.2.5

  storage/ndb/src/ndbapi/ndb_cluster_connection.cpp@stripped, 2007-04-12 16:04:43+02:00, jonas@stripped +0 -0
    Auto merged
    MERGE: 1.49.2.3

  storage/ndb/test/ndbapi/testBasic.cpp@stripped, 2007-04-12 16:04:44+02:00, jonas@stripped +0 -0
    Auto merged
    MERGE: 1.17.1.2

  storage/ndb/test/run-test/daily-basic-tests.txt@stripped, 2007-04-12 16:04:44+02:00, jonas@stripped +0 -0
    Auto merged
    MERGE: 1.61.1.17

  storage/ndb/tools/restore/consumer_restore.cpp@stripped, 2007-04-12 16:04:44+02:00, jonas@stripped +0 -0
    Auto merged
    MERGE: 1.41.1.3

  storage/ndb/tools/restore/restore_main.cpp@stripped, 2007-04-12 16:04:44+02:00, jonas@stripped +0 -0
    Auto merged
    MERGE: 1.50.1.5

# 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:	jonas
# Host:	perch.ndb.mysql.com
# Root:	/home/jonas/src/51-telco/RESYNC

--- 1.88/storage/ndb/test/run-test/daily-basic-tests.txt	2007-04-12 16:04:53 +02:00
+++ 1.89/storage/ndb/test/run-test/daily-basic-tests.txt	2007-04-12 16:04:53 +02:00
@@ -239,6 +239,10 @@
 cmd: testBasic
 args: -n Bug25090 T1
 
+max-time: 1000
+cmd: testBasic
+args: -n Bug27756
+
 max-time: 500
 cmd: testIndex
 args: -n Bug25059 -r 3000 T1

--- 1.93/storage/ndb/include/ndbapi/NdbDictionary.hpp	2007-04-12 16:04:53 +02:00
+++ 1.94/storage/ndb/include/ndbapi/NdbDictionary.hpp	2007-04-12 16:04:53 +02:00
@@ -546,6 +546,7 @@
     static const Column * ROWID;
     static const Column * ROW_GCI;
     static const Column * ANY_VALUE;
+    static const Column * COPY_ROWID;
     
     int getSizeInBytes() const;
 #endif

--- 1.57/storage/ndb/tools/restore/restore_main.cpp	2007-04-12 16:04:53 +02:00
+++ 1.58/storage/ndb/tools/restore/restore_main.cpp	2007-04-12 16:04:53 +02:00
@@ -783,8 +783,8 @@
       for(Uint32 j= 0; j < g_consumers.size(); j++)
 	if (!g_consumers[j]->table(* table))
 	{
-	  err << "Restore: Failed to restore table: ";
-          err << table->getTableName() << " ... Exiting " << endl;
+	  err << "Restore: Failed to restore table: `";
+          err << table->getTableName() << "` ... Exiting " << endl;
 	  exitHandler(NDBT_FAILED);
 	} 
     } else {

--- 1.29/storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp	2007-04-12 16:04:53 +02:00
+++ 1.30/storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp	2007-04-12 16:04:53 +02:00
@@ -106,8 +106,7 @@
   /**
    * Release copy tuple
    */
-  if(regOperPtr->op_struct.op_type != ZDELETE && 
-     !regOperPtr->m_copy_tuple_location.isNull())
+  if(!regOperPtr->m_copy_tuple_location.isNull())
     c_undo_buffer.free_copy_tuple(&regOperPtr->m_copy_tuple_location);
   
   if (regOperPtr->op_struct.in_active_list) {

--- 1.37/storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp	2007-04-12 16:04:53 +02:00
+++ 1.38/storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp	2007-04-12 16:04:53 +02:00
@@ -2099,6 +2099,10 @@
       return 2;
     }
     return 0;
+  case AttributeHeader::COPY_ROWID:
+    outBuffer[0] = operPtr.p->m_copy_tuple_location.m_page_no;
+    outBuffer[0] = operPtr.p->m_copy_tuple_location.m_page_idx;
+    return 2;
   default:
     return 0;
   }

--- 1.172/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp	2007-04-12 16:04:53 +02:00
+++ 1.173/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp	2007-04-12 16:04:53 +02:00
@@ -388,6 +388,11 @@
     col->m_impl.m_attrId = AttributeHeader::ANY_VALUE;
     col->m_impl.m_attrSize = 4;
     col->m_impl.m_arraySize = 1;
+  } else if(!strcmp(name, "NDB$COPY_ROWID")){
+    col->setType(NdbDictionary::Column::Bigunsigned);
+    col->m_impl.m_attrId = AttributeHeader::COPY_ROWID;
+    col->m_impl.m_attrSize = 4;
+    col->m_impl.m_arraySize = 2;
   } else {
     abort();
   }
@@ -5477,3 +5482,4 @@
 const NdbDictionary::Column * NdbDictionary::Column::ROWID = 0;
 const NdbDictionary::Column * NdbDictionary::Column::ROW_GCI = 0;
 const NdbDictionary::Column * NdbDictionary::Column::ANY_VALUE = 0;
+const NdbDictionary::Column * NdbDictionary::Column::COPY_ROWID = 0;

--- 1.19/storage/ndb/test/ndbapi/testBasic.cpp	2007-04-12 16:04:53 +02:00
+++ 1.20/storage/ndb/test/ndbapi/testBasic.cpp	2007-04-12 16:04:53 +02:00
@@ -1318,6 +1318,64 @@
   return NDBT_OK;
 }
 
+int
+runBug27756(NDBT_Context* ctx, NDBT_Step* step)
+{
+  
+  Ndb* pNdb = GETNDB(step);
+  NdbDictionary::Dictionary * dict = pNdb->getDictionary();
+  
+  HugoOperations ops(*ctx->getTab());
+
+  int loops = ctx->getNumLoops();
+  const int rows = ctx->getNumRecords();
+  
+  Vector<Uint64> copies;
+  while (loops--)
+  {
+    ops.startTransaction(pNdb);
+    ops.pkInsertRecord(pNdb, 1, 1);
+    ops.execute_NoCommit(pNdb);
+    
+    NdbTransaction* pTrans = ops.getTransaction();
+    NdbOperation* op = pTrans->getNdbOperation(ctx->getTab()->getName());
+    op->interpretedUpdateTuple();
+    ops.equalForRow(op, 1);
+    NdbRecAttr* attr = op->getValue(NdbDictionary::Column::COPY_ROWID);
+    ops.execute_NoCommit(pNdb);
+    
+    copies.push_back(attr->u_64_value());
+    ndbout_c("copy at: %llx", copies.back());
+    ops.execute_NoCommit(pNdb);
+    
+    ops.pkDeleteRecord(pNdb, 1, 1);
+    ops.execute_NoCommit(pNdb);
+    
+    if (loops & 1)
+    {
+      ops.execute_Rollback(pNdb);
+      ops.closeTransaction(pNdb);
+    }
+    else
+    {
+      ops.execute_Commit(pNdb);
+      ops.closeTransaction(pNdb);
+      ops.clearTable(pNdb, 100);
+    }
+  }
+  
+  for (Uint32 i = 0; i<copies.size(); i++)
+    if (copies[i] != copies.back())
+    {
+      ndbout_c("Memleak detected");
+      return NDBT_FAILED;
+    }
+  
+  return NDBT_OK;
+}
+
+template class Vector<Uint64>;
+
 NDBT_TESTSUITE(testBasic);
 TESTCASE("PkInsert", 
 	 "Verify that we can insert and delete from this table using PK"
@@ -1593,6 +1651,10 @@
   INITIALIZER(runLoadTable);
   INITIALIZER(runDeleteRead);
   FINALIZER(runClearTable2);
+}
+TESTCASE("Bug27756", 
+	 "Verify what happens when we fill the db" ){
+  STEP(runBug27756);
 }
 NDBT_TESTSUITE_END(testBasic);
 

--- 1.54/storage/ndb/src/ndbapi/ndb_cluster_connection.cpp	2007-04-12 16:04:54 +02:00
+++ 1.55/storage/ndb/src/ndbapi/ndb_cluster_connection.cpp	2007-04-12 16:04:54 +02:00
@@ -353,6 +353,8 @@
       NdbColumnImpl::create_pseudo("NDB$ROW_GCI");
     NdbDictionary::Column::ANY_VALUE= 
       NdbColumnImpl::create_pseudo("NDB$ANY_VALUE");
+    NdbDictionary::Column::COPY_ROWID= 
+      NdbColumnImpl::create_pseudo("NDB$COPY_ROWID");
   }
   NdbMutex_Unlock(g_ndb_connection_mutex);
 
@@ -424,6 +426,9 @@
     NdbDictionary::Column::ROWID= 0;
     NdbDictionary::Column::ROW_GCI= 0;
     NdbDictionary::Column::ANY_VALUE= 0;
+
+    delete NdbDictionary::Column::COPY_ROWID;
+    NdbDictionary::Column::COPY_ROWID = 0;
   }
   NdbMutex_Unlock(g_ndb_connection_mutex);
 

--- 1.44/storage/ndb/tools/restore/consumer_restore.cpp	2007-04-12 16:04:54 +02:00
+++ 1.45/storage/ndb/tools/restore/consumer_restore.cpp	2007-04-12 16:04:54 +02:00
@@ -813,7 +813,7 @@
   BaseString tmp(name);
   Vector<BaseString> split;
   if(tmp.split(split, "/") != 3){
-    err << "Invalid table name format " << name << endl;
+    err << "Invalid table name format `" << name << "`" << endl;
     return false;
   }
 
@@ -881,7 +881,7 @@
 
     if (dict->createTable(copy) == -1) 
     {
-      err << "Create table " << table.getTableName() << " failed: "
+      err << "Create table `" << table.getTableName() << "` failed: "
           << dict->getNdbError() << endl;
       if (dict->getNdbError().code == 771)
       {
@@ -898,12 +898,13 @@
       }
       return false;
     }
-    info << "Successfully restored table " << table.getTableName()<< endl ;
+    info << "Successfully restored table `"
+         << table.getTableName() << "`" << endl;
   }  
   
   const NdbDictionary::Table* tab = dict->getTable(split[2].c_str());
   if(tab == 0){
-    err << "Unable to find table: " << split[2].c_str() << endl;
+    err << "Unable to find table: `" << split[2].c_str() << "`" << endl;
     return false;
   }
   if(m_restore_meta)
@@ -965,12 +966,15 @@
   for(size_t i = 0; i<m_indexes.size(); i++){
     NdbTableImpl & indtab = NdbTableImpl::getImpl(* m_indexes[i]);
 
-    BaseString tmp(indtab.m_primaryTable.c_str());
     Vector<BaseString> split;
-    if(tmp.split(split, "/") != 3){
-      err << "Invalid table name format " << indtab.m_primaryTable.c_str()
-	  << endl;
-      return false;
+    {
+      BaseString tmp(indtab.m_primaryTable.c_str());
+      if (tmp.split(split, "/") != 3)
+      {
+        err << "Invalid table name format `" << indtab.m_primaryTable.c_str()
+            << "`" << endl;
+        return false;
+      }
     }
     
     m_ndb->setDatabaseName(split[0].c_str());
@@ -978,39 +982,41 @@
     
     const NdbDictionary::Table * prim = dict->getTable(split[2].c_str());
     if(prim == 0){
-      err << "Unable to find base table \"" << split[2].c_str() 
-	  << "\" for index "
-	  << indtab.getName() << endl;
+      err << "Unable to find base table `" << split[2].c_str() 
+	  << "` for index `"
+	  << indtab.getName() << "`" << endl;
       return false;
     }
     NdbTableImpl& base = NdbTableImpl::getImpl(*prim);
     NdbIndexImpl* idx;
-    int id;
-    char idxName[255], buf[255];
-    if(sscanf(indtab.getName(), "%[^/]/%[^/]/%d/%s",
-	      buf, buf, &id, idxName) != 4){
-      err << "Invalid index name format " << indtab.getName() << endl;
-      return false;
+    Vector<BaseString> split_idx;
+    {
+      BaseString tmp(indtab.getName());
+      if (tmp.split(split_idx, "/") != 4)
+      {
+        err << "Invalid index name format `" << indtab.getName() << "`" << endl;
+        return false;
+      }
     }
     if(NdbDictInterface::create_index_obj_from_table(&idx, &indtab, &base))
     {
-      err << "Failed to create index " << idxName
-	  << " on " << split[2].c_str() << endl;
+      err << "Failed to create index `" << split_idx[3]
+	  << "` on " << split[2].c_str() << endl;
 	return false;
     }
-    idx->setName(idxName);
+    idx->setName(split_idx[3].c_str());
     if(dict->createIndex(* idx) != 0)
     {
       delete idx;
-      err << "Failed to create index " << idxName
-	  << " on " << split[2].c_str() << endl
+      err << "Failed to create index `" << split_idx[3].c_str()
+	  << "` on `" << split[2].c_str() << "`" << endl
 	  << dict->getNdbError() << endl;
 
       return false;
     }
     delete idx;
-    info << "Successfully created index " << idxName
-	 << " on " << split[2].c_str() << endl;
+    info << "Successfully created index `" << split_idx[3].c_str()
+	 << "` on `" << split[2].c_str() << "`" << endl;
   }
   return true;
 }
Thread
bk commit into 5.1 tree (jonas:1.2533)jonas12 Apr