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:51:32+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:51:27+08:00,
Justin.He@stripped +20 -2
if getColumn return NULL, set error code and return NULL in getBlobHandle
ndb/src/ndbapi/ndberror.c@stripped, 2006-09-20 18:51:27+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:51:45 +08:00
+++ 1.17/ndb/src/ndbapi/NdbOperation.cpp 2006-09-20 18:51:45 +08:00
@@ -319,13 +319,31 @@
NdbBlob*
NdbOperation::getBlobHandle(const char* anAttrName)
{
- return getBlobHandle(theNdbCon, m_currentTable->getColumn(anAttrName));
+ const NdbColumnImpl* col = m_currentTable->getColumn(anAttrName);
+ if (col == NULL)
+ {
+ setErrorCode(4004);
+ return NULL;
+ }
+ else
+ {
+ return getBlobHandle(theNdbCon, col);
+ }
}
NdbBlob*
NdbOperation::getBlobHandle(Uint32 anAttrId)
{
- return getBlobHandle(theNdbCon, m_currentTable->getColumn(anAttrId));
+ const NdbColumnImpl* col = m_currentTable->getColumn(anAttrId);
+ if (col == NULL)
+ {
+ setErrorCode(4004);
+ return NULL;
+ }
+ else
+ {
+ return getBlobHandle(theNdbCon, col);
+ }
}
int
--- 1.48/ndb/src/ndbapi/ndberror.c 2006-09-20 18:51:45 +08:00
+++ 1.49/ndb/src/ndbapi/ndberror.c 2006-09-20 18:51:45 +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" },
| Thread |
|---|
| • bk commit into 5.0 tree (Justin.He:1.2255) BUG#21036 | jhe | 20 Sep |