List:Commits« Previous MessageNext Message »
From:jhe Date:September 11 2006 11:11am
Subject:bk commit into 5.0 tree (Justin.He:1.2255) BUG#21036
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of justin.he. When justin.he 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, 2006-09-11 17:11:47+08:00, Justin.He@stripped +3 -0
  BUG #21036, myOperation->getBlobHandle(..) on non-existing column cause segmentation
fault
  
  add some arguments judgement to avoid NULL pointer's operation(segmentaion fault)

  ndb/src/ndbapi/NdbBlob.cpp@stripped, 2006-09-11 17:11:41+08:00, Justin.He@stripped
+2 -0
    if the Column is NULL, it will cause segmentation fault,
    so return if NULL

  ndb/src/ndbapi/NdbDictionaryImpl.hpp@stripped, 2006-09-11 17:11:41+08:00,
Justin.He@stripped +8 -4
    if getColumn cannot find the column, print the error message

  ndb/src/ndbapi/NdbOperationDefine.cpp@stripped, 2006-09-11 17:11:42+08:00,
Justin.He@stripped +2 -0
    add tAttrInfo judgement, or it will cause segmentation fault in next,
    	tBob->atPrepare(...):
    	getType()

# 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:	Justin.He
# Host:	qa3-104.qa.cn.tlan
# Root:	/mnt/sda7/justin.he/mysql/mysql-5.0/bug21036-mysql-5.0

--- 1.40/ndb/src/ndbapi/NdbDictionaryImpl.hpp	2006-09-11 17:12:01 +08:00
+++ 1.41/ndb/src/ndbapi/NdbDictionaryImpl.hpp	2006-09-11 17:12:01 +08:00
@@ -445,7 +445,8 @@
   if(m_columns.size() > attrId){
     return m_columns[attrId];
   }
-  return 0;
+  ndbout_c("NdbTableImpl::getColumn attribute id %d not found", attrId);
+  DBUG_RETURN(NULL);
 }
 
 inline
@@ -520,7 +521,8 @@
 	return col;
     }
   }
-  return 0;
+  ndbout_c("NdbTableImpl::getColumn attribute name %s not found", name);
+  DBUG_RETURN(NULL);
 }
 
 inline
@@ -529,7 +531,8 @@
   if(m_columns.size() > attrId){
     return m_columns[attrId];
   }
-  return 0;
+  ndbout_c("const NdbTableImpl::getColumn attribute id %d not found", attrId);
+  DBUG_RETURN(NULL);
 }
 
 inline
@@ -542,7 +545,8 @@
     if(col != 0 && strcmp(name, col->m_name.c_str()) == 0)
       return col;
   }
-  return 0;
+  ndbout_c("const NdbTableImpl::getColumn attribute name %s not found", name);
+  DBUG_RETURN(NULL);
 }
 
 inline

--- 1.19/ndb/src/ndbapi/NdbOperationDefine.cpp	2006-09-11 17:12:01 +08:00
+++ 1.20/ndb/src/ndbapi/NdbOperationDefine.cpp	2006-09-11 17:12:01 +08:00
@@ -588,6 +588,8 @@
   tBlob = theNdb->getNdbBlob();
   if (tBlob == NULL)
     return NULL;
+  if (aCon == NULL || tAttrInfo == NULL)
+    return NULL;
   if (tBlob->atPrepare(aCon, this, tAttrInfo) == -1) {
     theNdb->releaseNdbBlob(tBlob);
     return NULL;

--- 1.29/ndb/src/ndbapi/NdbBlob.cpp	2006-09-11 17:12:01 +08:00
+++ 1.30/ndb/src/ndbapi/NdbBlob.cpp	2006-09-11 17:12:01 +08:00
@@ -1093,6 +1093,8 @@
   theAccessTable = anOp->m_accessTable;
   theColumn = aColumn;
   NdbDictionary::Column::Type partType = NdbDictionary::Column::Undefined;
+  if(theColumn == NULL)
+    DBUG_RETURN(-1);
   switch (theColumn->getType()) {
   case NdbDictionary::Column::Blob:
     partType = NdbDictionary::Column::Binary;
Thread
bk commit into 5.0 tree (Justin.He:1.2255) BUG#21036jhe11 Sep