From: Ole John Aske Date: April 14 2011 9:21am Subject: bzr commit into mysql-5.1-telco-7.0-spj-scan-vs-scan branch (ole.john.aske:3477) List-Archive: http://lists.mysql.com/commits/135406 Message-Id: <20110414092122.E8288222@fimafeng09.norway.sun.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2866648072444848919==" --===============2866648072444848919== MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline #At file:///net/fimafeng09/export/home/tmp/oleja/mysql/mysql-5.1-telco-7.0-spj-scan-scan/ based on revid:ole.john.aske@stripped 3477 Ole John Aske 2011-04-14 SPJ: Refactoring of how NdbQueryOperationDef objects was released: Previously NdbQueryOperationDef's was released by either ::~NdbQueryBuilderImpl() or ::~NdbQueryDefImpl() doing a 'delete' on the NdbQueryOperationDef being the root of the query tree and each NdbQueryOperationDef recursively deleting its children. This had the implicit assumption that the query tree was in a consistent state - Which it might not be in the case where a NdbQueryBuilder factory method failed before a query tree had been completed. It simplify the logic to remove the recursive deletion of children, and instead iterate the m_operations[] vector to find the NdbQueryOperationDef to delete. modified: storage/ndb/src/ndbapi/NdbQueryBuilder.cpp === modified file 'storage/ndb/src/ndbapi/NdbQueryBuilder.cpp' --- a/storage/ndb/src/ndbapi/NdbQueryBuilder.cpp 2011-04-14 08:59:45 +0000 +++ b/storage/ndb/src/ndbapi/NdbQueryBuilder.cpp 2011-04-14 09:21:18 +0000 @@ -574,16 +574,15 @@ NdbQueryIndexScanOperationDef::~NdbQuery NdbQueryOperationDefImpl::~NdbQueryOperationDefImpl() { + // Unlink any parent and child refering this object if (m_parent != NULL) { m_parent->removeChild(this); } - // Delete children recursively also. for (Uint32 i = 0; im_parent == this); m_children[i]->m_parent = NULL; - delete m_children[i]; } } @@ -1145,12 +1144,13 @@ NdbQueryBuilderImpl::NdbQueryBuilderImpl NdbQueryBuilderImpl::~NdbQueryBuilderImpl() { // Delete all operand and operator in Vector's - if (m_operations.size() > 0) + for (Uint32 i=0; i 0) + for (Uint32 i=0; i