From: Ole John Aske Date: May 13 2011 8:36am Subject: bzr commit into mysql-5.1-telco-7.0 branch (ole.john.aske:4369) List-Archive: http://lists.mysql.com/commits/137288 Message-Id: <20110513083641.765A3222@fimafeng09.norway.sun.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0954619541980268262==" --===============0954619541980268262== 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/ based on revid:ole.john.aske@stripped 4369 Ole John Aske 2011-05-13 Fixed a problem in SPJ block with 'bushy index scans' where condition for when to release or keep buffered rows and/or rangekeys was incorrect. modified: storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp === modified file 'storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp' --- a/storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp 2011-05-04 11:45:33 +0000 +++ b/storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp 2011-05-13 08:36:37 +0000 @@ -1150,7 +1150,7 @@ Dbspj::batchComplete(Signal* signal, Ptr /** * Locate next TreeNode(s) to retrieve more rows from. * - * Calcule set of 'm_active_nodes' we will receive from in NEXTREQ. + * Calculate set of the 'm_active_nodes' we will receive from in NEXTREQ. * Add these TreeNodes to the cursor list to be iterated. */ void @@ -1168,7 +1168,7 @@ Dbspj::prepareNextBatch(Signal* signal, if (requestPtr.p->m_bits & Request::RT_REPEAT_SCAN_RESULT) { /** - * If REPEAT_SCAN_RESULT we handle byshy scans by return more *new* rows + * If REPEAT_SCAN_RESULT we handle bushy scans by return more *new* rows * from only one of the active child scans. If there are multiple * bushy scans not being able to return their current result set in * a single batch, result sets from the other child scans are repeated @@ -1239,7 +1239,7 @@ Dbspj::prepareNextBatch(Signal* signal, { /** * If not REPEAT_SCAN_RESULT multiple active TreeNodes may return their - * remaining result simultaneously. In case of byshy-scans, these + * remaining result simultaneously. In case of bushy-scans, these * concurrent result streams are cross joins of each other * in SQL terms. In order to produce the cross joined result, it is * the responsibility of the API-client to buffer these streams and @@ -1415,7 +1415,13 @@ Dbspj::releaseScanBuffers(Ptr r releaseNodeRows(requestPtr, treeNodePtr); } - if (treeNodePtr.p->m_state == TreeNode::TN_ACTIVE) + /** + * Cleanup ACTIVE nodes fetching more rows in a NEXTREQ, + * or nodes being in 'm_active_nodes' as they will 'repeat'. + * (and then become active) + */ + if (treeNodePtr.p->m_state == TreeNode::TN_ACTIVE || + requestPtr.p->m_active_nodes.get(treeNodePtr.p->m_node_no)) { jam(); cleanupChildBranch(requestPtr, treeNodePtr); @@ -1423,9 +1429,11 @@ Dbspj::releaseScanBuffers(Ptr r } /** - * Build Bitmask of all nodes having TN_ACTIVE childs + * Collect ancestors of all nodes which are, or will + * become active in NEXTREQ (possibly repeated) */ - if (treeNodePtr.p->m_state == TreeNode::TN_ACTIVE) + if (treeNodePtr.p->m_state == TreeNode::TN_ACTIVE || + requestPtr.p->m_active_nodes.get(treeNodePtr.p->m_node_no)) { ancestors_of_active.bitOR(treeNodePtr.p->m_ancestors); } --===============0954619541980268262== MIME-Version: 1.0 Content-Type: text/bzr-bundle; charset="us-ascii"; name="bzr/ole.john.aske@stripped" Content-Transfer-Encoding: 7bit Content-Disposition: inline # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: ole.john.aske@stripped\ # tjhtzrrp1oulursw # target_branch: file:///net/fimafeng09/export/home/tmp/oleja/mysql\ # /mysql-5.1-telco-7.0/ # testament_sha1: f780f079521a922667a403cb2f789b3d4eb2a17c # timestamp: 2011-05-13 10:36:41 +0200 # base_revision_id: ole.john.aske@stripped\ # ldyacfqrxouq124w # # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWWNofLQAAhffgH0QUPf/9383 /0C////0UAUPc7uNAAWwAAMqAanqbSaR6Rtommg1MCD1GgyMQGmjTTBolPU0GYhlGgmnqaGJk0DA JgIaMmQEU9BM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