diff --git a/dbcon/execplan/simplefilter.cpp b/dbcon/execplan/simplefilter.cpp index e6d544b02..4916a129c 100644 --- a/dbcon/execplan/simplefilter.cpp +++ b/dbcon/execplan/simplefilter.cpp @@ -150,14 +150,8 @@ SimpleFilter::SimpleFilter(const SimpleFilter& rhs) : SimpleFilter::~SimpleFilter() { //delete fOp; - if (fLhs != NULL) - delete fLhs; - - if (fRhs != NULL) - delete fRhs; - - fLhs = NULL; - fRhs = NULL; + delete fLhs; + delete fRhs; } /** diff --git a/dbcon/joblist/jlf_common.h b/dbcon/joblist/jlf_common.h index 313c4a7d1..fe6c477d9 100644 --- a/dbcon/joblist/jlf_common.h +++ b/dbcon/joblist/jlf_common.h @@ -364,11 +364,6 @@ struct JobInfo bool isDML; std::string timeZone; - // This is for tracking any dynamically allocated ParseTree objects - // in simpleScalarFilterToParseTree() for later deletion in - // JobList::~JobList() - std::vector> dynamicParseTreeVec; - private: //defaults okay //JobInfo(const JobInfo& rhs); diff --git a/dbcon/joblist/jlf_execplantojoblist.cpp b/dbcon/joblist/jlf_execplantojoblist.cpp index 8d72f893f..35f4110fa 100644 --- a/dbcon/joblist/jlf_execplantojoblist.cpp +++ b/dbcon/joblist/jlf_execplantojoblist.cpp @@ -3269,12 +3269,6 @@ void doOR(ParseTree* n, JobInfo& jobInfo, bool tryCombine) ccp->left(parseTree->left()); ccp->right(parseTree->right()); ccp->data(parseTree->data()); - jobInfo.dynamicParseTreeVec.push_back(make_pair(parseTree, ccp)); - } - else if (parseTree) - { - delete parseTree; - parseTree = NULL; } } diff --git a/dbcon/joblist/jlf_subquery.cpp b/dbcon/joblist/jlf_subquery.cpp index 1b6acb8ad..008bdc758 100644 --- a/dbcon/joblist/jlf_subquery.cpp +++ b/dbcon/joblist/jlf_subquery.cpp @@ -192,10 +192,7 @@ void ssfInHaving(ParseTree* pt, void* obj) pt->right(parseTree->right()); pt->data(parseTree->data()); - jobInfo->dynamicParseTreeVec.push_back(make_pair(parseTree, pt)); // don't delete the parseTree, it has been placed in the plan. - // Instead, we use the dynamicParseTreeVec above for deletion - // in the JobList dtor after the query executes. // delete parseTree; } else @@ -630,10 +627,7 @@ void doSimpleScalarFilter(ParseTree* p, JobInfo& jobInfo) // create job steps for each simple filter JLF_ExecPlanToJobList::walkTree(parseTree, jobInfo); - jobInfo.dynamicParseTreeVec.push_back(make_pair(parseTree, ccp)); // don't delete the parseTree, it has been placed in the plan. - // Instead, we use the dynamicParseTreeVec above for deletion - // in the JobList dtor after the query executes. // delete parseTree; } else diff --git a/dbcon/joblist/joblist.cpp b/dbcon/joblist/joblist.cpp index 42c386a3d..8a8a89065 100644 --- a/dbcon/joblist/joblist.cpp +++ b/dbcon/joblist/joblist.cpp @@ -142,26 +142,6 @@ JobList::~JobList() (*iter)->join(); } } - - for (auto& parseTree : fDynamicParseTreeVec) - { - if (parseTree.first) - { - delete parseTree.first; - parseTree.first = NULL; - // Note that we don't delete parseTree.second here, - // that is handled by CalpontSelectExecutionPlan::unserialize(). - // parseTree.first already deleted the objects pointed to by - // parseTree.second->left()/right()/data(), so we set the - // pointers to NULL here. - if (parseTree.second) - { - parseTree.second->left((ParseTree*) (NULL)); - parseTree.second->right((ParseTree*) (NULL)); - parseTree.second->data((TreeNode*) (NULL)); - } - } - } } catch (exception& ex) { diff --git a/dbcon/joblist/joblist.h b/dbcon/joblist/joblist.h index 5f30b17e5..4940e038d 100644 --- a/dbcon/joblist/joblist.h +++ b/dbcon/joblist/joblist.h @@ -34,7 +34,6 @@ #include "jobstep.h" #include "bytestream.h" -#include "parsetree.h" #ifndef __GNUC__ # ifndef __attribute__ @@ -191,12 +190,6 @@ public: fPmsConfigured = pms; } - virtual void setDynamicParseTreeVec( - const std::vector>& dynamicParseTreeVec) - { - fDynamicParseTreeVec = dynamicParseTreeVec; - } - protected: //defaults okay //JobList(const JobList& rhs); @@ -224,7 +217,6 @@ protected: volatile uint32_t fAborted; uint32_t fPriority; //higher #s = higher priority - std::vector> fDynamicParseTreeVec; }; class TupleJobList : public JobList diff --git a/dbcon/joblist/joblistfactory.cpp b/dbcon/joblist/joblistfactory.cpp index 972ae904d..d762d912c 100644 --- a/dbcon/joblist/joblistfactory.cpp +++ b/dbcon/joblist/joblistfactory.cpp @@ -2003,7 +2003,6 @@ SJLP makeJobList_( jl->addQuery(querySteps); jl->addProject(projectSteps); jl->addDelivery(deliverySteps); - jl->setDynamicParseTreeVec(jobInfo.dynamicParseTreeVec); dynamic_cast(jl)->setDeliveryFlag(true); }