From: Ole John Aske Date: April 14 2011 9:28am Subject: bzr push into mysql-5.1-telco-7.0-spj-scan-vs-scan branch (ole.john.aske:3477 to 3478) List-Archive: http://lists.mysql.com/commits/135409 Message-Id: <20110414092842.B85E0222@fimafeng09.norway.sun.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3478 Ole John Aske 2011-04-14 Minor refactoring to fix that both 'NdbImpl* const ndb' and 'NdbImpl* const impl' was declared - Both referring the same NdbImpl object. modified: storage/ndb/src/ndbapi/NdbQueryOperation.cpp 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/NdbQueryOperation.cpp' --- a/storage/ndb/src/ndbapi/NdbQueryOperation.cpp 2011-04-06 14:16:13 +0000 +++ b/storage/ndb/src/ndbapi/NdbQueryOperation.cpp 2011-04-14 09:28:28 +0000 @@ -2898,7 +2898,6 @@ NdbQueryImpl::closeTcCursor(bool forceSe assert (m_queryDef.isScanQuery()); NdbImpl* const ndb = m_transaction.getNdb()->theImpl; - NdbImpl* const impl = ndb; const Uint32 timeout = ndb->get_waitfor_timeout(); const Uint32 nodeId = m_transaction.getConnectedNodeId(); const Uint32 seq = m_transaction.theNodeSequence; @@ -2908,7 +2907,7 @@ NdbQueryImpl::closeTcCursor(bool forceSe */ PollGuard poll_guard(*ndb); - if (unlikely(impl->getNodeSequence(nodeId) != seq)) + if (unlikely(ndb->getNodeSequence(nodeId) != seq)) { setErrorCode(Err_NodeFailCausedAbort); return -1; // Transporter disconnected and reconnected, no need to close @@ -2920,7 +2919,7 @@ NdbQueryImpl::closeTcCursor(bool forceSe const FetchResult result = static_cast (poll_guard.wait_scan(3*timeout, nodeId, forceSend)); - if (unlikely(impl->getNodeSequence(nodeId) != seq)) + if (unlikely(ndb->getNodeSequence(nodeId) != seq)) setFetchTerminated(Err_NodeFailCausedAbort,false); else if (unlikely(result != FetchResult_ok)) { @@ -2955,7 +2954,7 @@ NdbQueryImpl::closeTcCursor(bool forceSe const FetchResult result = static_cast (poll_guard.wait_scan(3*timeout, nodeId, forceSend)); - if (unlikely(impl->getNodeSequence(nodeId) != seq)) + if (unlikely(ndb->getNodeSequence(nodeId) != seq)) setFetchTerminated(Err_NodeFailCausedAbort,false); else if (unlikely(result != FetchResult_ok)) { No bundle (reason: useless for push emails).