From: Ole John Aske Date: April 14 2011 8:47am Subject: bzr commit into mysql-5.1-telco-7.0-spj-scan-vs-scan branch (ole.john.aske:3475) List-Archive: http://lists.mysql.com/commits/135396 Message-Id: <20110414084728.CFD23222@fimafeng09.norway.sun.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6523534441512045906==" --===============6523534441512045906== 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:jonas@stripped 3475 Ole John Aske 2011-04-14 SPJ: Minor refactoring: Remove unused 'Ndb' argument to ::NdbQueryBuilderImpl() and NdbQueryBuilder::create() Also fixed incorrect Copyright headers in HugoQueryBuilder.cpp and HugoQueryBuilder.hpp modified: sql/ha_ndbcluster.cc storage/ndb/src/ndbapi/NdbQueryBuilder.cpp storage/ndb/src/ndbapi/NdbQueryBuilder.hpp storage/ndb/src/ndbapi/NdbQueryBuilderImpl.hpp storage/ndb/test/include/HugoQueryBuilder.hpp storage/ndb/test/src/HugoQueryBuilder.cpp storage/ndb/test/tools/spj_performance_test.cpp storage/ndb/test/tools/spj_sanity_test.cpp === modified file 'sql/ha_ndbcluster.cc' --- a/sql/ha_ndbcluster.cc 2011-04-10 17:32:41 +0000 +++ b/sql/ha_ndbcluster.cc 2011-04-14 08:47:22 +0000 @@ -467,8 +467,7 @@ ha_ndbcluster::make_pushed_join(ndb_push * Parent operation is not defined before we have found the first * appendable child. */ - NdbQueryBuilder* const builder = - NdbQueryBuilder::create(*m_thd_ndb->ndb); + NdbQueryBuilder* const builder = NdbQueryBuilder::create(); if (unlikely (builder==NULL)) { DBUG_RETURN(HA_ERR_OUT_OF_MEM); === modified file 'storage/ndb/src/ndbapi/NdbQueryBuilder.cpp' --- a/storage/ndb/src/ndbapi/NdbQueryBuilder.cpp 2011-04-06 14:16:13 +0000 +++ b/storage/ndb/src/ndbapi/NdbQueryBuilder.cpp 2011-04-14 08:47:22 +0000 @@ -23,7 +23,6 @@ #include #include "signaldata/QueryTree.hpp" -#include #include "NdbDictionaryImpl.hpp" #include #include "AttributeHeader.hpp" @@ -686,9 +685,9 @@ NdbQueryOperationDef::getIndex() const * Implementation of NdbQueryBuilder factory ******************************************/ // Static method. -NdbQueryBuilder* NdbQueryBuilder::create(Ndb& ndb) +NdbQueryBuilder* NdbQueryBuilder::create() { - NdbQueryBuilderImpl* const impl = new NdbQueryBuilderImpl(ndb); + NdbQueryBuilderImpl* const impl = new NdbQueryBuilderImpl(); if (likely (impl != NULL)) { if (likely(impl->getNdbError().code == 0)) @@ -1128,9 +1127,9 @@ NdbQueryBuilder::prepare() // The (hidden) Impl of NdbQueryBuilder //////////////////////////////////////// -NdbQueryBuilderImpl::NdbQueryBuilderImpl(Ndb& ndb) +NdbQueryBuilderImpl::NdbQueryBuilderImpl() : m_interface(*this), - m_ndb(ndb), m_error(), + m_error(), m_operations(), m_operands(), m_paramCnt(0), @@ -2895,15 +2894,14 @@ main(int argc, const char** argv) assert (sizeof(NdbParamOperand) == sizeof(NdbQueryOperandImpl*)); assert (sizeof(NdbLinkedOperand) == sizeof(NdbQueryOperandImpl*)); - Ndb *myNdb = 0; - NdbQueryBuilder myBuilder(*myNdb); + NdbQueryBuilder* const myBuilder= NdbQueryBuilder::create(); const NdbDictionary::Table *manager = (NdbDictionary::Table*)0xDEADBEAF; // const NdbDictionary::Index *ix = (NdbDictionary::Index*)0x11223344; - NdbQueryDef* q1 = 0; + const NdbQueryDef* q1 = 0; { - NdbQueryBuilder* qb = &myBuilder; //myDict->getQueryBuilder(); + NdbQueryBuilder* qb = myBuilder; const NdbQueryOperand* managerKey[] = // Manager is indexed om {"dept_no", "emp_no"} { qb->constValue("d005"), // dept_no = "d005" === modified file 'storage/ndb/src/ndbapi/NdbQueryBuilder.hpp' --- a/storage/ndb/src/ndbapi/NdbQueryBuilder.hpp 2011-04-06 14:16:13 +0000 +++ b/storage/ndb/src/ndbapi/NdbQueryBuilder.hpp 2011-04-14 08:47:22 +0000 @@ -24,7 +24,6 @@ // skip includes...and require them to be included first // BUH! -class Ndb; class NdbQueryDef; class NdbQueryDefImpl; class NdbQueryBuilderImpl; @@ -358,8 +357,7 @@ private: * build phase. * * - The NdbQueryDef produced by the ::prepare() method has a lifetime - * determined by the Ndb object, or until it is explicit released by - * NdbQueryDef::release() + * until it is explicit released by NdbQueryDef::release() * */ class NdbQueryBuilder @@ -380,7 +378,7 @@ public: * Allocate an instance. * @return New instance, or NULL if allocation failed. */ - static NdbQueryBuilder* create(Ndb& ndb); + static NdbQueryBuilder* create(); /** * Release this object and any resources held by it. @@ -478,8 +476,7 @@ private: * NdbQueryDef represents a ::prepare()'d object from NdbQueryBuilder. * * The NdbQueryDef is reusable in the sense that it may be executed multiple - * times. Its lifetime is defined by the Ndb object which it was created with, - * or it may be explicitely released() when no longer required. + * times. It is valid until it is explicitely released(). * * The NdbQueryDef *must* be keept alive until the last thread * which executing a query based on this NdbQueryDef has completed execution === modified file 'storage/ndb/src/ndbapi/NdbQueryBuilderImpl.hpp' --- a/storage/ndb/src/ndbapi/NdbQueryBuilderImpl.hpp 2011-04-06 14:16:13 +0000 +++ b/storage/ndb/src/ndbapi/NdbQueryBuilderImpl.hpp 2011-04-14 08:47:22 +0000 @@ -644,7 +644,7 @@ class NdbQueryBuilderImpl public: ~NdbQueryBuilderImpl(); - explicit NdbQueryBuilderImpl(Ndb& ndb); + explicit NdbQueryBuilderImpl(); const NdbQueryDefImpl* prepare(); @@ -667,7 +667,6 @@ private: bool contains(const NdbQueryOperationDefImpl*); NdbQueryBuilder m_interface; - Ndb& m_ndb; NdbError m_error; Vector m_operations; === modified file 'storage/ndb/test/include/HugoQueryBuilder.hpp' --- a/storage/ndb/test/include/HugoQueryBuilder.hpp 2011-04-06 14:16:13 +0000 +++ b/storage/ndb/test/include/HugoQueryBuilder.hpp 2011-04-14 08:47:22 +0000 @@ -1,6 +1,5 @@ /* - Copyright (C) 2003 MySQL AB - All rights reserved. Use is subject to license terms. + Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -105,7 +104,7 @@ public: OptionMask getOptionMask() const { return m_options;} void setOptionMask(OptionMask om) { m_options = om;} - const NdbQueryDef * createQuery(Ndb*, bool takeOwnership = false); + const NdbQueryDef * createQuery(bool takeOwnership = false); private: struct TableDef === modified file 'storage/ndb/test/src/HugoQueryBuilder.cpp' --- a/storage/ndb/test/src/HugoQueryBuilder.cpp 2011-04-06 14:16:13 +0000 +++ b/storage/ndb/test/src/HugoQueryBuilder.cpp 2011-04-14 08:47:22 +0000 @@ -1,6 +1,5 @@ /* - Copyright (C) 2003 MySQL AB - All rights reserved. Use is subject to license terms. + Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -563,9 +562,9 @@ loop: } const NdbQueryDef * -HugoQueryBuilder::createQuery(Ndb* pNdb, bool takeOwnership) +HugoQueryBuilder::createQuery(bool takeOwnership) { - NdbQueryBuilder* const builder = NdbQueryBuilder::create(*pNdb); + NdbQueryBuilder* const builder = NdbQueryBuilder::create(); if (builder == NULL) { ndbout << "Failed to create NdbQueryBuilder." << endl; === modified file 'storage/ndb/test/tools/spj_performance_test.cpp' --- a/storage/ndb/test/tools/spj_performance_test.cpp 2011-03-31 07:44:04 +0000 +++ b/storage/ndb/test/tools/spj_performance_test.cpp 2011-04-14 08:47:22 +0000 @@ -248,7 +248,7 @@ void TestThread::run(){ } void TestThread::doLinkedAPITest(){ - NdbQueryBuilder* const builder = NdbQueryBuilder::create(m_ndb); + NdbQueryBuilder* const builder = NdbQueryBuilder::create(); const NdbQueryDef* queryDef = NULL; const Row** resultPtrs = new const Row*[m_params->m_depth+1]; === modified file 'storage/ndb/test/tools/spj_sanity_test.cpp' --- a/storage/ndb/test/tools/spj_sanity_test.cpp 2011-03-31 07:44:04 +0000 +++ b/storage/ndb/test/tools/spj_sanity_test.cpp 2011-04-14 08:47:22 +0000 @@ -544,7 +544,7 @@ namespace SPJSanityTest{ Query::Query(Ndb& ndb): m_ndb(ndb), - m_builder(NdbQueryBuilder::create(ndb)), + m_builder(NdbQueryBuilder::create()), m_root(NULL), m_queryDef(NULL), m_query(NULL), --===============6523534441512045906== 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\ # 66dxut2cygwuxbxv # target_branch: file:///net/fimafeng09/export/home/tmp/oleja/mysql\ # /mysql-5.1-telco-7.0-spj-scan-scan/ # testament_sha1: 418466139a2d962c312e218d12ec4022ceb6f293 # timestamp: 2011-04-14 10:47:28 +0200 # source_branch: bzr+ssh://oaske@stripped/bzrroot/server\ # /mysql-5.1-telco-7.0/ # base_revision_id: jonas@stripped # # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWb3+VDUABklfgEAQUPf//35z +AC////wYAscD5VAAAAAhAAkUKUUEgHMJgEwAmEwmmAAATJpoGOYTAJgBMJhNMAAAmTTQMcwmATA CYTCaYAABMmmgYSJNIETCZqNGSjxqeVA/Qp6n6iZNGRoyHMJgEwAmEwmmAAATJpoGEkgRoAJhAIC aaJ6VNtInqB6mPSepBZoz6TPqinbstzwGkpBFKUG5R8ddpi/o3QjogQTYRMRorOyyvZTNlcq5Cjs hCuYgoK8rVmm+JbJicNJkuvwMMMCtbOkUB1wQIfr/hmn2vYBzA0iGDG2gbG02g/rw+CSOmpnzxle Ws0o9bJtoUxMTGmtlzJeNYisFzJyzhODucXw3NYVbZmcjqNu5ljtbmHZFXN0WPZ+9f7Xz+Hy7zHa YxtnDjYHGPXkE/xJx/rzJ/gw7WnypVtRak1JbQBp/i6ZOhnLM0KqoeIDoOAsHQnMigpKWHA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