From: Ole John Aske Date: February 11 2011 1:16pm Subject: bzr commit into mysql-5.1-telco-7.0-spj-scan-vs-scan branch (ole.john.aske:3431) List-Archive: http://lists.mysql.com/commits/131126 Message-Id: <20110211131641.B2664223@fimafeng09.norway.sun.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8204072070875675543==" --===============8204072070875675543== 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 3431 Ole John Aske 2011-02-11 SPJ-scan-scan: ::setInterpretedCode() as part of the NdbQueryDef instead of setting it as part of each instantiated NdbQuery. modified: sql/ha_ndbcluster.cc === modified file 'sql/ha_ndbcluster.cc' --- a/sql/ha_ndbcluster.cc 2011-02-09 14:59:39 +0000 +++ b/sql/ha_ndbcluster.cc 2011-02-11 13:16:37 +0000 @@ -486,6 +486,16 @@ ha_ndbcluster::make_pushed_join(ndb_push */ if (push_cnt == 0) { + NdbQueryOptions options; + if (m_cond) + { + NdbInterpretedCode code(m_table); + if (m_cond->generate_scan_filter(&code, NULL) != 0) + ERR_RETURN(code.getNdbError()); + + options.setInterpretedCode(code); + } + if (ndbcluster_is_lookup_operation(access_type)) { const KEY* const key= @@ -511,7 +521,7 @@ ha_ndbcluster::make_pushed_join(ndb_push DBUG_PRINT("info", ("Root operation is 'primary-key-lookup'")); DBUG_ASSERT(join_root->get_index_no() == static_cast(table->s->primary_key)); - query_op= builder->readTuple(m_table, root_key); + query_op= builder->readTuple(m_table, root_key, &options); } else { @@ -519,7 +529,7 @@ ha_ndbcluster::make_pushed_join(ndb_push const NdbDictionary::Index* const index = m_index[join_root->get_index_no()].unique_index; DBUG_ASSERT(index); - query_op= builder->readTuple(index, m_table, root_key); + query_op= builder->readTuple(index, m_table, root_key, &options); } } /** @@ -542,12 +552,12 @@ ha_ndbcluster::make_pushed_join(ndb_push // Bounds will be generated and supplied during execute query_op= - builder->scanIndex(m_index[join_root->get_index_no()].index, m_table); + builder->scanIndex(m_index[join_root->get_index_no()].index, m_table, 0, &options); } else if (access_type == AQP::AT_TABLE_SCAN) { DBUG_PRINT("info", ("Root operation is 'table scan'")); - query_op= builder->scanTable(m_table); + query_op= builder->scanTable(m_table, &options); } else { @@ -700,6 +710,14 @@ ha_ndbcluster::make_pushed_join(ndb_push DBUG_ASSERT(parent_op != NULL); options.setParent(parent_op); } + if (handler->m_cond) + { + NdbInterpretedCode code(table); + if (handler->m_cond->generate_scan_filter(&code, NULL) != 0) + ERR_RETURN(code.getNdbError()); + + options.setInterpretedCode(code); + } if (join_tab->get_access_type() == AQP::AT_ORDERED_INDEX_SCAN) { @@ -721,7 +739,6 @@ ha_ndbcluster::make_pushed_join(ndb_push query_op= builder->readTuple(index, table, linked_key, &options); } -// DBUG_ASSERT(query_op); if (unlikely(!query_op)) { const NdbError error = builder->getNdbError(); @@ -1019,7 +1036,6 @@ ha_ndbcluster::create_pushed_join(NdbQue ERR_RETURN(m_thd_ndb->trans->getNdbError()); // Bind to instantiated NdbQueryOperations. - // Append filters for for pushed conditions where available for (uint i= 0; i < m_pushed_join->get_operation_count(); i++) { const TABLE* const tab= m_pushed_join->get_table(i); @@ -1028,16 +1044,6 @@ ha_ndbcluster::create_pushed_join(NdbQue NdbQueryOperation* const op= query->getQueryOperation(i); handler->m_pushed_operation= op; - if (handler->m_cond) - { - NdbInterpretedCode code(handler->m_table); - if (handler->m_cond->generate_scan_filter(&code, NULL) != 0) - ERR_RETURN(code.getNdbError()); - - if (op->setInterpretedCode(code) != 0) - ERR_RETURN(query->getNdbError()); - } - // Bind to result buffers const NdbRecord* const resultRec= handler->m_ndb_record; int res= op->setResultRowRef( --===============8204072070875675543== 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\ # zfb58opd4zlnnf5z # target_branch: file:///net/fimafeng09/export/home/tmp/oleja/mysql\ # /mysql-5.1-telco-7.0-spj-scan-scan/ # testament_sha1: 63d54cbe25e6907cb416b6fc640f80300130010d # timestamp: 2011-02-11 14:16:41 +0100 # source_branch: bzr+ssh://oaske@stripped/bzrroot/server\ # /mysql-5.1-telco-7.0/ # base_revision_id: ole.john.aske@stripped\ # 035d51yxve08mctk # # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWQsylpEAAkPfgFUQcWf//341 /gq////6UAU71sa7RW66GlLYBhKKaagYmp5Jmj1IyeU2jUAaAMjQ0BoA0QQwEj0jTUaGQAAABoAA 0BKNTQiaj1Mp+qZppqaBiek9CMJhNMIA0GhzTIyGTBDRhMEaaNGIGmTIwABBJIjI0IaZCaYRNPUw 1MU9T001PyEmhp6j0nik2YPHOZfPbIFH02P8Zl5sLPHMi6E8KW1DsTWeDbsTKDBo1V1xfrhRPjjN G4EeLCQPSCw1BMWMaN9rM7gbhT7d43hS2Sxu2N1kmYQSc8k0Q84dEPKtN7VAsJqeiljRhKuv+r62 67RebAbNj7wo0UruMV512af120cyOkpDAZGNjjeTDmXu4Lyo0+BJaDKEQfwkXhSMbFcegj0MWA0Y xZzifr2Hl6Tltsvli5xTtzQdERgWK4F/jCMxohKbXZKCOfHyPFhZQZbWiTkMQ4RTdmmY3OdlcPUQ rLtVsQTCbIolcM7kQn1F7NMRDwvM3NQIkgggmntVdhKi22elBDwaZYh+f811imAKB1Bl/QjKIW+Q 1BNIgVr7EnE3LfaAUCVUV5BA7209SWzOcsprWtPQsHC+paPqEMFbuF5eseeq1xNoKAVdMIDaxKgZ wc31nGgMoBhJX76QkO2BcyhSFxxqrUoMfj/BIqBojDlRnQMIJzYSwIqoGR+RJQSVuKxymmLDjMm4 A6wExFtJLChAE65Kwkzm0MBRi1cVxpKoKX2VfENgtiGy3rXe2mi+J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