From: Date: September 20 2006 12:17pm Subject: bk commit into 5.0 tree (Justin.He:1.2255) BUG#21036 List-Archive: http://lists.mysql.com/commits/12267 X-Bug: 21036 Message-Id: <200609201017.k8KAHeE3017791@qa3-104.qa.cn.tlan> 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-20 18:17:29+08:00, Justin.He@stripped +2 -0 BUG #21036, myOperation->getBlobHandle(..) on non-existing column cause segmentation fault add judgement to avoid NULL pointer's operation(segmentaion fault) ndb/src/ndbapi/NdbOperation.cpp@stripped, 2006-09-20 18:17:24+08:00, Justin.He@stripped +18 -2 if getColumn return NULL, set error code and return NULL in getBlobHandle ndb/src/ndbapi/ndberror.c@stripped, 2006-09-20 18:17:24+08:00, Justin.He@stripped +1 -1 change the err message more appropriate # 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.16/ndb/src/ndbapi/NdbOperation.cpp 2006-09-20 18:17:43 +08:00 +++ 1.17/ndb/src/ndbapi/NdbOperation.cpp 2006-09-20 18:17:43 +08:00 @@ -319,13 +319,29 @@ NdbBlob* NdbOperation::getBlobHandle(const char* anAttrName) { - return getBlobHandle(theNdbCon, m_currentTable->getColumn(anAttrName)); + if (m_currentTable->getColumn(anAttrName) == NULL) + { + setErrorCode(4004); + return NULL; + } + else + { + return getBlobHandle(theNdbCon, m_currentTable->getColumn(anAttrName)); + } } NdbBlob* NdbOperation::getBlobHandle(Uint32 anAttrId) { - return getBlobHandle(theNdbCon, m_currentTable->getColumn(anAttrId)); + if (m_currentTable->getColumn(anAttrId) == NULL) + { + setErrorCode(4004); + return NULL; + } + else + { + return getBlobHandle(theNdbCon, m_currentTable->getColumn(anAttrId)); + } } int --- 1.48/ndb/src/ndbapi/ndberror.c 2006-09-20 18:17:43 +08:00 +++ 1.49/ndb/src/ndbapi/ndberror.c 2006-09-20 18:17:43 +08:00 @@ -401,7 +401,7 @@ * Still uncategorized */ { 720, AE, "Attribute name reused in table definition" }, - { 4004, AE, "Attribute name not found in the Table" }, + { 4004, AE, "Attribute name or id not found in the Table" }, { 4100, AE, "Status Error in NDB" }, { 4101, AE, "No connections to NDB available and connect failed" },