mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 14:54:20 +01:00
BUG #21036, myOperation->getBlobHandle(..) on non-existing column cause segmentation fault
add judgement to avoid NULL pointer's operation(segmentaion fault)
This commit is contained in:
parent
dbd808add5
commit
e88687121b
2 changed files with 21 additions and 3 deletions
|
@ -319,13 +319,31 @@ NdbOperation::setValue( Uint32 anAttrId,
|
|||
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
|
||||
|
|
|
@ -401,7 +401,7 @@ ErrorBundle ErrorCodes[] = {
|
|||
* 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" },
|
||||
|
|
Loading…
Add table
Reference in a new issue