From: Ole John Aske Date: June 16 2011 9:32am Subject: bzr commit into mysql-5.1-telco-7.0 branch (ole.john.aske:4458) List-Archive: http://lists.mysql.com/commits/139305 Message-Id: <20110616093247.F1A43224@fimafeng09.norway.sun.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5594615584405544325==" --===============5594615584405544325== 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:jan.wedvik@stripped 4458 Ole John Aske 2011-06-16 SPJ API update: The ndbapi for SPJ was not completely in synch with the primary SPJ source (mysql-5.1-telco-7.0-spj-scan-scan). Likely due to some late arriving patches when the SPJ api was merged into telco-7.0. This patch fix this unintentional diff between these branches. modified: storage/ndb/src/ndbapi/NdbQueryBuilder.cpp storage/ndb/src/ndbapi/NdbQueryBuilder.hpp storage/ndb/src/ndbapi/NdbQueryBuilderImpl.hpp storage/ndb/src/ndbapi/NdbQueryOperation.cpp storage/ndb/test/include/HugoQueryBuilder.hpp storage/ndb/test/src/HugoQueryBuilder.cpp === modified file 'storage/ndb/src/ndbapi/NdbQueryBuilder.cpp' --- a/storage/ndb/src/ndbapi/NdbQueryBuilder.cpp 2011-05-17 12:47:21 +0000 +++ b/storage/ndb/src/ndbapi/NdbQueryBuilder.cpp 2011-06-16 09:32:43 +0000 @@ -23,7 +23,6 @@ #include #include "signaldata/QueryTree.hpp" -#include #include "NdbDictionaryImpl.hpp" #include #include "AttributeHeader.hpp" @@ -575,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]; } } @@ -686,9 +684,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)) @@ -1045,9 +1043,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), @@ -1063,12 +1061,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; igetQueryBuilder(); + 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-06-16 09:32:43 +0000 @@ -24,7 +24,6 @@ // skip includes...and require them to be included first // BUH! -class Ndb; class NdbQueryDef; class NdbQueryDefImpl; class NdbQueryBuilderImpl; @@ -358,9 +357,8 @@ 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-05-05 11:06:08 +0000 +++ b/storage/ndb/src/ndbapi/NdbQueryBuilderImpl.hpp 2011-06-16 09:32:43 +0000 @@ -631,7 +631,7 @@ class NdbQueryBuilderImpl public: ~NdbQueryBuilderImpl(); - explicit NdbQueryBuilderImpl(Ndb& ndb); + explicit NdbQueryBuilderImpl(); const NdbQueryDefImpl* prepare(); @@ -665,7 +665,6 @@ private: bool contains(const NdbQueryOperationDefImpl*); NdbQueryBuilder m_interface; - Ndb& m_ndb; NdbError m_error; Vector m_operations; === modified file 'storage/ndb/src/ndbapi/NdbQueryOperation.cpp' --- a/storage/ndb/src/ndbapi/NdbQueryOperation.cpp 2011-05-26 14:44:59 +0000 +++ b/storage/ndb/src/ndbapi/NdbQueryOperation.cpp 2011-06-16 09:32:43 +0000 @@ -2895,7 +2895,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; @@ -2905,7 +2904,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 @@ -2917,7 +2916,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)) { @@ -2952,7 +2951,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)) { === 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-06-16 09:32:43 +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-06-16 09:32:43 +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; --===============5594615584405544325== 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\ # djarhihcuygdjde1 # target_branch: file:///net/fimafeng09/export/home/tmp/oleja/mysql\ # /mysql-5.1-telco-7.0/ # testament_sha1: 0e4106395408f1826238a89db82ef70ac8930ccc # timestamp: 2011-06-16 11:32:47 +0200 # base_revision_id: jan.wedvik@stripped\ # xsutb6fblxyzn34v # # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWRX99T4ABcjfgFAQcH///351 7gq////4YAq997p3t3lAdCguMrvdw8tAU9Fa0ANZQkVNUzEap+lP01PSepH5Kfqn4U0mn6oNPUBp oAABKSNNU/TJpqMptTTymmmTQ00AAAAAAlEaaE0gaaJtUNH6oxA0ABoaNAABiJE0mTRiZP1T01Gh poAGmCA00NMQHGTJkxGJgBMmCZADRhGAIYBJEJoAJkEYmmhMJp6TSm1Mh6QDQxqOTHZs2Le4worV 1OUiEZhXdnbQmUpzzGNVCpvTv/BCCgrZ1OpOQnx4k3ks9ggosdZskWDXMJSCM0FULLAkzVks7LSU qwKVi3Q7WRP6oiRQMVgNIbJ1+DlJZfetI3USWC7BXgMQxobEm0T7c3UIJuwxmcG3bG2S38TI6wVZ QJ1hJTg6weySrYpvLqOpBavC5QVVVKKkqTmqzkq1e6zrKFY0a5ZqCZILYUFSmYSM7unpNae3o9vr w4RaiGpphu0REfyRjXyk8dH0MWfEZMql+op5ShVCVxF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