From: Date: April 17 2008 8:59am Subject: bk commit into 5.1 tree (mskold:1.2583) BUG#33747 List-Archive: http://lists.mysql.com/commits/45533 X-Bug: 33747 Message-Id: <200804170659.m3H6xLqc001514@quadfish.ndb.mysql.com> Below is the list of changes that have just been committed into a local 5.1 repository of mskold. When mskold 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, 2008-04-17 08:59:16+02:00, mskold@stripped +1 -0 bug#33747 Still more cases where passing a nonexistant column name crashes NDBAPI: Added checks for existing column storage/ndb/src/ndbapi/NdbOperation.cpp@stripped, 2008-04-17 08:59:08+02:00, mskold@stripped +40 -4 bug#33747 Still more cases where passing a nonexistant column name crashes NDBAPI: Added checks for existing column diff -Nrup a/storage/ndb/src/ndbapi/NdbOperation.cpp b/storage/ndb/src/ndbapi/NdbOperation.cpp --- a/storage/ndb/src/ndbapi/NdbOperation.cpp 2008-02-19 11:41:21 +01:00 +++ b/storage/ndb/src/ndbapi/NdbOperation.cpp 2008-04-17 08:59:08 +02:00 @@ -313,26 +313,62 @@ NdbOperation::getValue(const NdbDictiona int NdbOperation::equal(const char* anAttrName, const char* aValuePassed) { - return equal_impl(m_accessTable->getColumn(anAttrName), aValuePassed); + const NdbColumnImpl* col = m_accessTable->getColumn(anAttrName); + if (col == NULL) + { + setErrorCode(4004); + return -1; + } + else + { + return equal_impl(col, aValuePassed); + } } int NdbOperation::equal(Uint32 anAttrId, const char* aValuePassed) { - return equal_impl(m_accessTable->getColumn(anAttrId), aValuePassed); + const NdbColumnImpl* col = m_accessTable->getColumn(anAttrId); + if (col == NULL) + { + setErrorCode(4004); + return -1; + } + else + { + return equal_impl(col, aValuePassed); + } } int NdbOperation::setValue(const char* anAttrName, const char* aValuePassed) { - return setValue(m_currentTable->getColumn(anAttrName), aValuePassed); + const NdbColumnImpl* col = m_currentTable->getColumn(anAttrName); + if (col == NULL) + { + setErrorCode(4004); + return -1; + } + else + { + return setValue(col, aValuePassed); + } } int NdbOperation::setValue(Uint32 anAttrId, const char* aValuePassed) { - return setValue(m_currentTable->getColumn(anAttrId), aValuePassed); + const NdbColumnImpl* col = m_currentTable->getColumn(anAttrId); + if (col == NULL) + { + setErrorCode(4004); + return -1; + } + else + { + return setValue(col, aValuePassed); + } } NdbBlob*