List:Commits« Previous MessageNext Message »
From:jonas Date:January 10 2006 10:05am
Subject:bk commit into 5.1 tree (jonas:1.1997) BUG#16306
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
  1.1997 06/01/10 11:04:59 jonas@stripped +1 -0
  bug#16306 - ndb dd
    fix error during create file prepare

  storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
    1.71 06/01/10 11:04:56 jonas@stripped +75 -52
    Fix error during create_file_prepare

# 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-dd

--- 1.70/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2006-01-10 10:39:15 +01:00
+++ 1.71/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2006-01-10 11:04:56 +01:00
@@ -14796,6 +14796,9 @@
   getSection(objInfoPtr, ((OpCreateObj*)op)->m_obj_info_ptr_i);
   SimplePropertiesSectionReader it(objInfoPtr, getSectionSegmentPool());
   
+  Ptr<DictObject> obj_ptr; obj_ptr.setNull();
+  FilePtr filePtr; filePtr.setNull();
+
   DictFilegroupInfo::File f; f.init();
   SimpleProperties::UnpackStatus status;
   status = SimpleProperties::unpack(it, &f, 
@@ -14845,16 +14848,13 @@
     }
     
     // Loop through all filenames...
-    Ptr<DictObject> obj_ptr;
     if(!c_obj_pool.seize(obj_ptr)){
       op->m_errorCode = CreateTableRef::NoMoreTableRecords;
       break;
     }
     
-    FilePtr filePtr;
     if (! c_file_pool.seize(filePtr)){
       op->m_errorCode = CreateFileRef::OutOfFileRecords;
-      c_obj_pool.release(obj_ptr);
       break;
     }
 
@@ -14862,8 +14862,6 @@
       Rope name(c_rope_pool, obj_ptr.p->m_name);
       if(!name.assign(f.FileName, len, hash)){
 	op->m_errorCode = CreateTableRef::TableNameTooLong;
-	c_obj_pool.release(obj_ptr);
-	c_file_pool.release(filePtr);
 	break;
       }
     }
@@ -14900,6 +14898,22 @@
 
     op->m_obj_ptr_i = filePtr.i;
   } while(0);
+
+  if (op->m_errorCode)
+  {
+    jam();
+    if (!filePtr.isNull())
+    {
+      jam();
+      c_file_pool.release(filePtr);
+    }
+
+    if (!obj_ptr.isNull())
+    {
+      jam();
+      c_obj_pool.release(obj_ptr);
+    }
+  }
   
   execute(signal, op->m_callback, 0);
 }
@@ -15031,62 +15045,71 @@
 {
   CreateFileImplReq* req = (CreateFileImplReq*)signal->getDataPtrSend();
 
-  FilePtr f_ptr;
-  c_file_pool.getPtr(f_ptr, op->m_obj_ptr_i);
-
-  FilegroupPtr fg_ptr;
-  ndbrequire(c_filegroup_hash.find(fg_ptr, f_ptr.p->m_filegroup_id));
-
-  req->senderData = op->key;
-  req->senderRef = reference();
-  req->requestInfo = CreateFileImplReq::Abort;
-  
-  req->file_id = f_ptr.p->key;
-  req->filegroup_id = f_ptr.p->m_filegroup_id;
-  req->filegroup_version = fg_ptr.p->m_version;
-
-  Uint32 ref= 0;
-  switch(op->m_obj_type){
-  case DictTabInfo::Datafile:
-    ref = TSMAN_REF;
-    break;
-  case DictTabInfo::Undofile:
-    ref = LGMAN_REF;
-    break;
-  default:
-    ndbrequire(false);
+  if (op->m_obj_ptr_i != RNIL)
+  {
+    FilePtr f_ptr;
+    c_file_pool.getPtr(f_ptr, op->m_obj_ptr_i);
+    
+    FilegroupPtr fg_ptr;
+    ndbrequire(c_filegroup_hash.find(fg_ptr, f_ptr.p->m_filegroup_id));
+    
+    req->senderData = op->key;
+    req->senderRef = reference();
+    req->requestInfo = CreateFileImplReq::Abort;
+    
+    req->file_id = f_ptr.p->key;
+    req->filegroup_id = f_ptr.p->m_filegroup_id;
+    req->filegroup_version = fg_ptr.p->m_version;
+    
+    Uint32 ref= 0;
+    switch(op->m_obj_type){
+    case DictTabInfo::Datafile:
+      ref = TSMAN_REF;
+      break;
+    case DictTabInfo::Undofile:
+      ref = LGMAN_REF;
+      break;
+    default:
+      ndbrequire(false);
+    }
+    
+    sendSignal(ref, GSN_CREATE_FILE_REQ, signal, 
+	       CreateFileImplReq::AbortLength, JBB);
+    return;
   }
-  
-  sendSignal(ref, GSN_CREATE_FILE_REQ, signal, 
-	     CreateFileImplReq::AbortLength, JBB);
+
+  execute(signal, op->m_callback, 0);
 }
 
 void
 Dbdict::create_file_abort_complete(Signal* signal, SchemaOp* op)
 {
-  FilePtr f_ptr;
-  c_file_pool.getPtr(f_ptr, op->m_obj_ptr_i);
-
-  FilegroupPtr fg_ptr;
-  ndbrequire(c_filegroup_hash.find(fg_ptr, f_ptr.p->m_filegroup_id));
-  
-  switch(fg_ptr.p->m_type){
-  case DictTabInfo::Tablespace:
-    decrease_ref_count(fg_ptr.p->m_obj_ptr_i);
-    break;
-  case DictTabInfo::LogfileGroup:
+  if (op->m_obj_ptr_i != RNIL)
   {
-    LocalDLList<File> list(c_file_pool, fg_ptr.p->m_logfilegroup.m_files);
-    list.remove(f_ptr);
-    break;
-  }
-  default:
-    ndbrequire(false);
+    FilePtr f_ptr;
+    c_file_pool.getPtr(f_ptr, op->m_obj_ptr_i);
+    
+    FilegroupPtr fg_ptr;
+    ndbrequire(c_filegroup_hash.find(fg_ptr, f_ptr.p->m_filegroup_id));
+    
+    switch(fg_ptr.p->m_type){
+    case DictTabInfo::Tablespace:
+      decrease_ref_count(fg_ptr.p->m_obj_ptr_i);
+      break;
+    case DictTabInfo::LogfileGroup:
+    {
+      LocalDLList<File> list(c_file_pool, fg_ptr.p->m_logfilegroup.m_files);
+      list.remove(f_ptr);
+      break;
+    }
+    default:
+      ndbrequire(false);
+    }
+    
+    release_object(f_ptr.p->m_obj_ptr_i);
+    c_file_pool.release(f_ptr);
   }
   
-  release_object(f_ptr.p->m_obj_ptr_i);
-  c_file_pool.release(f_ptr);
-
   execute(signal, op->m_callback, 0);
 }
 
Thread
bk commit into 5.1 tree (jonas:1.1997) BUG#16306jonas10 Jan