http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/7a95e1da/core/sql/optimizer/ScanOptimizer.cpp ---------------------------------------------------------------------- diff --git a/core/sql/optimizer/ScanOptimizer.cpp b/core/sql/optimizer/ScanOptimizer.cpp index 6528913..23caa79 100644 --- a/core/sql/optimizer/ScanOptimizer.cpp +++ b/core/sql/optimizer/ScanOptimizer.cpp @@ -75,7 +75,6 @@ #define FSOWARNING(x) #endif -// LCOV_EXCL_START :dpm #ifdef MDAM_TRACE THREAD_P FILE *MdamTrace::outputFile_ = NULL; @@ -315,7 +314,6 @@ void MdamTrace::setLevel(enum MdamTraceLevel l) } #endif // if MDAM_TRACE -// LCOV_EXCL_STOP enum restrictCheckStrategy { MAJORITY_WITH_PREDICATES=1, TOTAL_UECS=2, BOTH=3 }; @@ -688,7 +686,6 @@ private: CostScalar rcAfterApplyFirstKeyPreds_; }; -// LCOV_EXCL_START :dpm #ifndef NDEBUG static Int32 @@ -1211,7 +1208,6 @@ ScanOptimizerAllTests(const FileScan& associatedFileScan } #endif -// LCOV_EXCL_STOP // ----------------------------------------------------------------------- // getDp2CacheSizeInBlocks @@ -1229,7 +1225,6 @@ getDP2CacheSizeInBlocks(const CostScalar& blockSizeInKb) else if (blockSizeInKb == 32.) cacheSizeInBlocks = CostPrimitives::getBasicCostFactor(DP2_CACHE_32K_BLOCKS); -// LCOV_EXCL_START :cnu else if (blockSizeInKb == 16.) cacheSizeInBlocks = CostPrimitives::getBasicCostFactor(DP2_CACHE_16K_BLOCKS); @@ -1251,7 +1246,6 @@ getDP2CacheSizeInBlocks(const CostScalar& blockSizeInKb) else cacheSizeInBlocks = CostPrimitives::getBasicCostFactor(NCM_CACHE_SIZE_IN_BLOCKS); -// LCOV_EXCL_STOP return cacheSizeInBlocks; @@ -1428,7 +1422,6 @@ ordersMatch(const InputPhysicalProperty* ipp, if ((ipp != NULL) AND (!(ipp->getAssumeSortedForCosting())) AND (!(ipp->getExplodedOcbJoinForCosting()))) { - // LCOV_EXCL_START :rfi // Shouldn't have an ipp if there are no outer order columns! if ((ipp->getNjOuterOrder() == NULL) OR ipp->getNjOuterOrder()->isEmpty()) @@ -1452,7 +1445,6 @@ ordersMatch(const InputPhysicalProperty* ipp, CCMPASSERT(FALSE); return FALSE; } - // LCOV_EXCL_STOP // Get the physical partitioning function for the access path const PartitioningFunction* physicalPartFunc = @@ -1513,14 +1505,12 @@ ordersMatch(const InputPhysicalProperty* ipp, // There MUST be some probe columns, otherwise there should not // have been an ipp! - // LCOV_EXCL_START :rfi if (innerOrderProbeCols.isEmpty()) { if (NOT noCmpAssert) CCMPASSERT(FALSE); return FALSE; } - // LCOV_EXCL_STOP ValueIdList njOuterOrder = *(ipp->getNjOuterOrder()); // Sol 10-040303-3781. The number of entries of innerOrderProbCols(5) @@ -1593,7 +1583,7 @@ ordersMatch(const InputPhysicalProperty* ipp, if (NOT partiallyInOrder) { if (NOT noCmpAssert) - CCMPASSERT(FALSE); // LCOV_EXCL_LINE :rfi + CCMPASSERT(FALSE); return FALSE; } } // end if ipp exists @@ -1646,11 +1636,9 @@ ordersMatch(const InputPhysicalProperty* ipp, baseTableColIndex, innerOrderProbeColsNoInv[keyColIndex]) ) { - // LCOV_EXCL_START :rfi if (NOT noCmpAssert) CCMPASSERT(FALSE); return FALSE; - // LCOV_EXCL_STOP } currentColUec = csdl[baseTableColIndex]->getColStats()->getTotalUec(); totalInOrderColsUec = totalInOrderColsUec * currentColUec; @@ -1699,7 +1687,6 @@ ordersMatch(const InputPhysicalProperty* ipp, // columnId in any of its operands. // // ----------------------------------------------------------------------- -// LCOV_EXCL_START :cnu static NABoolean predReferencesColumn(const ItemExpr *predIEPtr ,const ValueId& columnId) @@ -1749,7 +1736,6 @@ predReferencesColumn(const ItemExpr *predIEPtr return itDoes; } -// LCOV_EXCL_STOP // ----------------------------------------------------------------------- @@ -1816,7 +1802,6 @@ computeTotalBlocksLowerBound( innerBlocksUpperBound ); } -// LCOV_EXCL_START :dpm #ifndef NDEBUG @@ -1848,7 +1833,6 @@ ScanOptimizer::printCostObject(const Cost * costPtr) const } printf("\n"); } -// LCOV_EXCL_STOP #endif @@ -1916,14 +1900,12 @@ Histograms::containsAtLeastOneFake() const } // containsAtLeastOneFake() -// LCOV_EXCL_START :cnu NABoolean Histograms::getColStatDescForColumn(CollIndex index, const ValueId& column) const { return getColStatDescList().getColStatDescIndexForColumn(index,column); } -// LCOV_EXCL_STOP const ColStats& @@ -1968,14 +1950,12 @@ Histograms::getColStatsPtrForColumn(const ValueId& column) const }// getColStatsForColumn(...) -// LCOV_EXCL_START :cnu void Histograms::displayHistogramForColumn(const ValueId& column) const { getColStatsForColumn(column).display(); }// getColStatsForColumn(...) -// LCOV_EXCL_STOP void Histograms::applyPredicates(const ValueIdSet& predicates, @@ -2160,7 +2140,6 @@ Histograms::applyPredicatesWhenMultipleProbes( } // Histograms::applyPredicatesWhenMultipleProbes(...) -// LCOV_EXCL_START :cnu void Histograms::applyPredicate(const ValueId& predicate, const RelExpr & scan, @@ -2173,7 +2152,6 @@ Histograms::applyPredicate(const ValueId& predicate, vis.insert(predicate); applyPredicates(vis, scan, selHint, cardHint, opType); } // applyPredicate(...) -// LCOV_EXCL_STOP NABoolean Histograms::isAnIndexJoin(const EstLogProp& inputEstLogProp @@ -2241,7 +2219,6 @@ Histograms::isAnIndexJoin(const EstLogProp& inputEstLogProp } // Histograms::isAnIndexJoin() const -// LCOV_EXCL_START :dpm void Histograms::display() const { @@ -2258,7 +2235,6 @@ Histograms::print (FILE *ofd, getColStatDescList().print(emptySelectList) ; #endif }// print() -// LCOV_EXCL_STOP //------------------------------------------------------- // Methods for IndexDescHistograms @@ -2347,7 +2323,7 @@ IndexDescHistograms::appendHistogramForColumnPosition( else { // There must be a ColStatDesc for every key column! - CMPABORT; // LCOV_EXCL_LINE :rfi + CMPABORT; } // propagate all base-table multi-col uec info : easiest way @@ -2393,7 +2369,6 @@ IndexDescHistograms::estimateUecUsingMultiColUec( CostScalar& estimatedUec/*out*/) { ValueIdList columnList= keyPredsByCol.getColumnList(); -// LCOV_EXCL_START :dpm #ifndef NDEBUG if(getenv("MDAM_MCUEC")){ fprintf(stdout,"\n\n---columnList before reduction \n\n----"); @@ -2401,7 +2376,6 @@ IndexDescHistograms::estimateUecUsingMultiColUec( } #endif -// LCOV_EXCL_STOP //remove everything beyond the column under consideration for ( CollIndex i = keyPredsByCol.entries()-1; i>indexOfColumn; i--){ columnList.removeAt(i); @@ -2412,7 +2386,6 @@ IndexDescHistograms::estimateUecUsingMultiColUec( const MultiColumnUecList * MCUL = getIndexDesc().getPrimaryTableDesc()->getTableColStats().getUecList(); -// LCOV_EXCL_START :dpm #ifndef NDEBUG if(getenv("MDAM_MCUEC")){ fprintf(stdout,"\n\n---columnList for Index[%d]: \n", indexOfColumn); @@ -2421,14 +2394,12 @@ IndexDescHistograms::estimateUecUsingMultiColUec( MCUL->print(); } #endif -// LCOV_EXCL_STOP //get all the valueIdSets that contains the column and columns from the //columnList only LIST(ValueIdSet) * listOfSubsets= MCUL->getListOfSubsetsContainsColumns(columnList,uecCount); if(listOfSubsets->entries()==0) return FALSE; -// LCOV_EXCL_START :dpm #ifndef NDEBUG if(getenv("MDAM_MCUEC")){ fprintf(stdout,"\n\n---Got my value ID list-----\n\n"); @@ -2438,7 +2409,6 @@ IndexDescHistograms::estimateUecUsingMultiColUec( } } #endif -// LCOV_EXCL_STOP //Trying to find the matching denominator for the numerator CostScalar uecWithoutColumn=0; CollIndex entriesInSubset=0; @@ -2497,7 +2467,6 @@ IndexDescHistograms::estimateUecUsingMultiColUec( vidSet.remove(idInBaseCol); //Do we have a matching denominator perfectDenom = MCUL->findDenom(vidSet); -// LCOV_EXCL_START :dpm #ifndef NDEBUG if(getenv("MDAM_MCUEC")) { @@ -2505,7 +2474,6 @@ IndexDescHistograms::estimateUecUsingMultiColUec( vidSet.print(); } #endif -// LCOV_EXCL_STOP //choose the MC uecs with the most entries so for col d , best would // be abcd/abc even if you have abd/ab. But if there are two of same // entries select the one with higher uec count for the denominator. @@ -3485,7 +3453,6 @@ ScanOptimizer::isMdamEnabled() const return mdamIsEnabled; } // isMdamEnabled() -// LCOV_EXCL_START :cnu const CostScalar ScanOptimizer::getIndexLevelsSeeks() const { @@ -3499,7 +3466,6 @@ ScanOptimizer::getIndexLevelsSeeks() const else return csZero; } -// LCOV_EXCL_STOP // ----------------------------------------------------------------------- // INPUT: @@ -3698,14 +3664,12 @@ ScanOptimizer::computeCostObject( CostScalar frIOTime = tempFirst.getIOTime(); -// LCOV_EXCL_START :dpm #ifndef NDEBUG Lng32 planFragmentsPerCPU = (Lng32)partitionsPerCPU.getValue(); if ( planFragmentsPerCPU > 1 AND CURRSTMT_OPTGLOBALS->synCheckFlag ) (*CURRSTMT_OPTGLOBALS->asynchrMonitor).enter(); #endif //NDEBUG -// LCOV_EXCL_STOP tempLast.setIdleTime(0.); tempFirst.setIdleTime(0.); @@ -3723,12 +3687,10 @@ ScanOptimizer::computeCostObject( costPtr->cplr().setIOTime(lrIOTime); costPtr->totalCost().setIOTime(lrIOTime); -// LCOV_EXCL_START :dpm #ifndef NDEBUG if ( planFragmentsPerCPU > 1 AND CURRSTMT_OPTGLOBALS->synCheckFlag) (*CURRSTMT_OPTGLOBALS->asynchrMonitor).exit(); #endif //NDEBUG -// LCOV_EXCL_STOP DCMPASSERT(costPtr != NULL); @@ -4416,14 +4378,12 @@ FileScanOptimizer::optimize(SearchKey*& searchKeyPtr /* out */ // compute blocks read per access computeNumberOfBlocksToReadPerAccess(*winnerCostPtr ,mdamIsWinner, winnerCostPtrNumKBytes); -// LCOV_EXCL_START :dpm #ifndef NDEBUG if (CURRSTMT_OPTDEFAULTS->optimizerHeuristic2()) { if ( isIndexJoin ) (*CURRSTMT_OPTGLOBALS->indexJoinMonitor).exit(); } #endif //NDEBUG -// LCOV_EXCL_STOP MDAM_DEBUG0(MTL2, "END Scan Costing ********************************\n\n"); return winnerCostPtr; @@ -4599,7 +4559,6 @@ FileScanOptimizer::computeCostForSingleSubset( return scmComputeCostForSingleSubset(); } - // LCOV_EXCL_START :cnu -- OCM code MDAM_DEBUG0(MTL2, "BEGIN Single Subset Costing --------"); // This was added as part of the project @@ -5375,11 +5334,9 @@ FileScanOptimizer::computeCostForSingleSubset( MDAM_DEBUG0(MTL2, "END Single Subset Costing --------\n"); return costPtr; - // LCOV_EXCL_STOP }// computeCostForSingleSubset(...) -// LCOV_EXCL_START :dpm #ifndef NDEBUG void FileScanOptimizer::runMdamTests @@ -5479,7 +5436,6 @@ FileScanOptimizer::runMdamTests MdamTrace::setLevel(origLevel); } #endif -// LCOV_EXCL_STOP NABoolean FileScanOptimizer::isMDAMFeasibleForHBase(const IndexDesc* idesc, ValueIdSet& preds) { @@ -5648,7 +5604,6 @@ FileScanOptimizer::computeCostForMultipleSubset sharedMdamKeyPtr); } -// LCOV_EXCL_START :cnu OCM code #ifndef NDEBUG if(getenv("MDAM_TEST")) { @@ -5682,11 +5637,9 @@ FileScanOptimizer::computeCostForMultipleSubset mdamTypeIsCommon, sharedMdamKeyPtr); } -// LCOV_EXCL_STOP } -// LCOV_EXCL_START :cnu OCM code // ----------------------------------------------------------------------- // Use this routine to compute the cost of a given MdamKey // INPUT: @@ -7241,7 +7194,6 @@ FileScanOptimizer::oldComputeCostForMultipleSubset } // oldComputeCostForMultipleSubset(...) #pragma warn(262) // warning elimination -// LCOV_EXCL_STOP // ----------------------------------------------------------------------- // This function will check if current context has the same basic physical @@ -7320,7 +7272,6 @@ FileScanBasicCost::hasSameBasicProperties(const Context & currentContext) const *(currentIPP->getNjOuterOrder()) == *(existingIPP->getNjOuterOrder()) ); } -// LCOV_EXCL_START :cnu // ----------------------------------------------------------------------- // Use this routine to compare the current cost with a given bound. // INPUT: @@ -7372,9 +7323,7 @@ FileScanOptimizer::exceedsBound(const Cost *costBoundPtr, return FALSE; } // FileScanOptimizer::exceedsBound(...) -// LCOV_EXCL_STOP -// LCOV_EXCL_START : OCM code ///////////////////////////////////////////////////////////////////// // fix the estimation // for seeks beginBlocksLowerBound = no. of unique entries WHICH ARE @@ -7461,7 +7410,6 @@ FileScanOptimizer::computeSeekForDp2ReadAheadAndProbeOrder( } } } -// LCOV_EXCL_STOP void FileScanOptimizer::computeIOForFullCacheBenefit( @@ -7564,7 +7512,6 @@ FileScanOptimizer::computeIOForRandomCase( } -// LCOV_EXCL_START :cnu void FileScanOptimizer::computeIOForFullTableScan( CostScalar& dataRows /* out */ @@ -7593,7 +7540,6 @@ FileScanOptimizer::computeIOForFullTableScan( indexBlocksLowerBound; // index seeks } // FileScanOptimizer::computeIOForFullTableScan(...) -// LCOV_EXCL_STOP void FileScanOptimizer::computeCostVectorsForMultipleSubset( @@ -8653,7 +8599,6 @@ void MDAMCostWA::compute() return; } } - // LCOV_EXCL_START :cnu -- OCM code else { disjunctsFR_.reset(); @@ -8692,7 +8637,6 @@ void MDAMCostWA::compute() return; } } - // LCOV_EXCL_STOP } // for every disjunct // update rows accessed @@ -8940,7 +8884,6 @@ MDAMOptimalDisjunctPrefixWA::~MDAMOptimalDisjunctPrefixWA() delete pMinCost_; } -// LCOV_EXCL_START :cnu // This method find if there are any intervenning missing key column present NABoolean MDAMOptimalDisjunctPrefixWA::missingKeyColumnExists() const { @@ -8961,7 +8904,6 @@ NABoolean MDAMOptimalDisjunctPrefixWA::missingKeyColumnExists() const } return FALSE; } -// LCOV_EXCL_STOP // This function computes the optimal prefix of the disjunct void MDAMOptimalDisjunctPrefixWA::compute() @@ -9884,7 +9826,6 @@ const CostScalar & MDAMOptimalDisjunctPrefixWA::getOptSeqKBRead() const const ValueIdSet & MDAMOptimalDisjunctPrefixWA::getOptKeyPreds() const { return optKeyPreds_; } -// LCOV_EXCL_START :cnu // return true if has resuable shared basic cost for this mdam NABoolean FileScanOptimizer::getSharedCost(FileScanBasicCost * &fileScanBasicCostPtr /*out, never NULL*/ @@ -9921,10 +9862,8 @@ FileScanOptimizer::getSharedCost(FileScanBasicCost * &fileScanBasicCostPtr /*out // disjunctsLRPtr->getCPUTime() > csZero AND CURRSTMT_OPTDEFAULTS->reuseBasicCost() ); } -// LCOV_EXCL_STOP -// LCOV_EXCL_START :cnu Cost* FileScanOptimizer::newComputeCostForMultipleSubset ( MdamKey* mdamKeyPtr, @@ -10043,7 +9982,6 @@ Cost* FileScanOptimizer::newComputeCostForMultipleSubset MDAM_DEBUG0(MTL2, "END MDAM Costing --------\n"); return costPtr; } // newComputeCostForMultipleSubset(...) -// LCOV_EXCL_STOP Cost* FileScanOptimizer::scmComputeCostForMultipleSubset(MdamKey* mdamKeyPtr,
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/7a95e1da/core/sql/optimizer/SearchKey.cpp ---------------------------------------------------------------------- diff --git a/core/sql/optimizer/SearchKey.cpp b/core/sql/optimizer/SearchKey.cpp index 5f0d915..31477b7 100644 --- a/core/sql/optimizer/SearchKey.cpp +++ b/core/sql/optimizer/SearchKey.cpp @@ -673,7 +673,6 @@ SearchKey::SearchKey(const ValueIdList & keyColumns, } } // SearchKey::SearchKey() -// LCOV_EXCL_START :cnu RR part func table not supported // ----------------------------------------------------------------------- // Constructor to set up partition search keys for a RR partitioned table // ----------------------------------------------------------------------- @@ -764,7 +763,6 @@ SearchKey::SearchKey(const ValueIdList & keyColumns, setOfPredicates); } } // SearchKey::SearchKey() -// LCOV_EXCL_STOP ItemExpr *SearchKey::getBeginKeyExclusionExpr() const { @@ -801,7 +799,6 @@ ValueId SearchKey::computeMissingKeyValue(ValueId keyColumn, return minMaxConstant->getValueId(); } // SearchKey::computeMissingKeyValue() -// LCOV_EXCL_START :dpm // ----------------------------------------------------------------------- // Methods for debugging // ----------------------------------------------------------------------- @@ -822,7 +819,6 @@ void SearchKey::display() const { SearchKey::print(); } // SearchKey::display() -// LCOV_EXCL_STOP // *********************************************************************** // $$$ SearchKeyBounds @@ -897,7 +893,7 @@ void SearchKeyBounds::analyzeSearchPredicates(const ValueIdSet & setOfPredicates // All value id's in SearchKeyBounds *must* be either // an index column or a base table column, // if we reach here it is an internal error: - CMPASSERT(FALSE); // LCOV_EXCL_LINE :rfi + CMPASSERT(FALSE); } // switch on type of input column @@ -1402,7 +1398,6 @@ ValueId SearchKeyBounds::computeMissingKeyValue(NABoolean wantMinValue) } // SearchKeyBounds::computeMissingKeyValue() -// LCOV_EXCL_START :dpm // ----------------------------------------------------------------------- // Method for allocating the work space. // ----------------------------------------------------------------------- @@ -1461,7 +1456,6 @@ void SearchKeyBounds::display() const { SearchKeyBounds::print(); } // SearchKeyBounds::display() -// LCOV_EXCL_STOP // *********************************************************************** // $$$ SearchKeyWorkSpace @@ -1931,7 +1925,6 @@ void SearchKey::getKeyPredicates(ValueIdSet &keyPredicates, /* out */ } // getKeyPredicates(...) -// LCOV_EXCL_START :cnu // Generate the data structures needed by the generator and // rewrite VEG preds and predicates: void SearchKey::preCodeGen(ValueIdSet& executorPredicates, @@ -1994,7 +1987,6 @@ void SearchKey::replaceBegEndPivs(ValueIdSet & oldPivs, } } } -// LCOV_EXCL_STOP http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/7a95e1da/core/sql/optimizer/Stats.cpp ---------------------------------------------------------------------- diff --git a/core/sql/optimizer/Stats.cpp b/core/sql/optimizer/Stats.cpp index fc85025..f607a3a 100644 --- a/core/sql/optimizer/Stats.cpp +++ b/core/sql/optimizer/Stats.cpp @@ -136,17 +136,14 @@ void HistInt::setCardinality (CostScalar card) { if (card < csZero) { -// LCOV_EXCL_START - rfi // min cardinality of an interval is zero CCMPASSERT (card >= csZero) ; card = csZero; -// LCOV_EXCL_STOP } card.roundIfZero(); rows_ = card ; } -// LCOV_EXCL_START - cnu void HistInt::setCardinality2mfv (CostScalar card) { if (card < csZero) @@ -158,17 +155,14 @@ void HistInt::setCardinality2mfv (CostScalar card) card.roundIfZero(); rows2mfv_ = card ; } -// LCOV_EXCL_STOP void HistInt::setUec (CostScalar uec) { if (uec < csZero) { -// LCOV_EXCL_START - rfi // min UEC of an interval is zero CCMPASSERT (uec >= csZero) ; uec = csZero; -// LCOV_EXCL_STOP } uec.roundIfZero(); uec_ = uec ; @@ -289,7 +283,6 @@ HistInt::mergeInterval(const HistInt & left, return maxUEC; } // mergeInterval -// LCOV_EXCL_START - dpm void HistInt::display (FILE *f, const char * prefix, const char * suffix, CollHeap *c, char *buf) const @@ -314,7 +307,6 @@ HistInt::display (FILE *f, const char * prefix, const char * suffix, rows_.value(), uec_.value(), suffix); PRINTIT(f, c, space, buf, mybuf); } -// LCOV_EXCL_STOP // ----------------------------------------------------------------------- // methods on Interval "wrapper class" @@ -382,10 +374,8 @@ Interval::merge (Interval & other) // for simplicity, we only merge low-to-high if (loIndex_+1 != other.loIndex_ ) { -// LCOV_EXCL_START - rfi CCMPASSERT ( loIndex_+1 == other.loIndex_ ) ; return FALSE; -// LCOV_EXCL_STOP } CostScalar newUec = getUec() + other.getUec() ; @@ -462,26 +452,20 @@ Interval::OK () const { if (!isValid() ) { -// LCOV_EXCL_START - rfi CCMPASSERT( isValid() ) ; return FALSE; -// LCOV_EXCL_STOP } if (hist_->entries() == 1 ) { -// LCOV_EXCL_START - rfi CCMPASSERT( hist_->entries() != 1 ) ; return FALSE; -// LCOV_EXCL_STOP } if ((*hist_)[loIndex_+1].getUec().isLessThanZero() ) { -// LCOV_EXCL_START - rfi CCMPASSERT( (*hist_)[loIndex_+1].getUec().isGreaterOrEqualThanZero() ) ; // getUec() >= 0 (*hist_)[loIndex_+1].setCardAndUec(0,0); -// LCOV_EXCL_STOP } if ((*hist_)[loIndex_+1].getCardinality().isLessThanZero() ) @@ -607,11 +591,9 @@ ColStats::setNullRowsAndUec (CostScalar nulls, CostScalar nullUec) { if (!isNullInstantiated() ) { -// LCOV_EXCL_START - rfi // if the histogram does not contain a NULL Interval, nothing to do CCMPASSERT ( isNullInstantiated() ) ; return; -// LCOV_EXCL_STOP } Interval null = histogram_->getLastInterval() ; null.setRowsAndUec (nulls, nullUec) ; @@ -658,11 +640,9 @@ void ColStats::setRowcount (CostScalar row) { if (row < csZero) { -// LCOV_EXCL_START - rfi // min rowcount is zero CCMPASSERT (row >= csZero) ; row = csZero; -// LCOV_EXCL_STOP } else row.roundIfZero(); @@ -677,11 +657,9 @@ void ColStats::setTotalUec (CostScalar uec, NABoolean allowMinusOne) uec = csMinusOne; else { -// LCOV_EXCL_START - rfi // min UEC is zero CCMPASSERT (uec >= csZero) ; uec = csZero; -// LCOV_EXCL_STOP } } else @@ -693,11 +671,9 @@ void ColStats::setBaseUec (CostScalar uec) { if (uec < csZero) { -// LCOV_EXCL_START - rfi // min UEC is zero CCMPASSERT (uec >= csZero) ; uec = csZero; -// LCOV_EXCL_STOP } else uec.roundIfZero(); @@ -708,11 +684,9 @@ void ColStats::setBaseRowCount (CostScalar row) { if (row < -1) { -// LCOV_EXCL_START - rfi // reset baserowcount to -1 CCMPASSERT (row >= -1) ; return; -// LCOV_EXCL_STOP } row.roundIfZero() ; @@ -725,11 +699,9 @@ void ColStats::setSumOfMaxUec (CostScalar value) { if (value < 0) { -// LCOV_EXCL_START - rfi // min sum of max UEC is zero CCMPASSERT (value >= 0) ; value = 0; -// LCOV_EXCL_STOP } sumOfMaxUec_ = value; } @@ -743,11 +715,9 @@ void ColStats::setRedFactor (CostScalar rowred) { if (rowred < 0) { -// LCOV_EXCL_START - rfi // min row reduction is 0, resulting in 0 rows CCMPASSERT (rowred >= 0) ; rowred = 0; -// LCOV_EXCL_STOP } else rowred.roundIfExactlyZero() ; @@ -758,11 +728,9 @@ void ColStats::setUecRedFactor (CostScalar uecred) { if (uecred < 0) { -// LCOV_EXCL_START - rfi // min uec reduction is zero, resulting in 0 uec CCMPASSERT (uecred >= 0) ; uecred = 0; -// LCOV_EXCL_STOP } else uecred.roundIfExactlyZero() ; @@ -961,7 +929,6 @@ Histogram::insertZeroInterval (const EncodedValue & loBound, { // if the histogram is not valid, clear the histogram // and insert an interval with given boundaries -// LCOV_EXCL_START - rfi CCMPASSERT ( last.isValid() ) ; this->clear(); HistInt newLo (loBound, FALSE) ; @@ -969,7 +936,6 @@ Histogram::insertZeroInterval (const EncodedValue & loBound, insert (newLo) ; insert (newHi) ; return ; -// LCOV_EXCL_STOP } // otherwise, this function shouldn't have been called! @@ -983,7 +949,6 @@ Histogram::insertZeroInterval (const EncodedValue & loBound, } // CASE 3: hiBound == the first Interval's boundary value -// LCOV_EXCL_START - rfi Interval first = getFirstInterval() ; if (first.isNull()) @@ -1002,7 +967,6 @@ Histogram::insertZeroInterval (const EncodedValue & loBound, // the HistInt flag insertAt (0, newLo) ; return ; -// LCOV_EXCL_STOP } CCMPASSERT(FALSE) ; // misuse of this function! @@ -1041,11 +1005,9 @@ Histogram::condenseToSingleInterval() { if (numIntervals() == 0) { -// LCOV_EXCL_START - rfi CCMPASSERT (numIntervals() > 0) ; // makes no sense for an empty histogram insertZeroInterval (UNINIT_ENCODEDVALUE, UNINIT_ENCODEDVALUE, TRUE) ; return; -// LCOV_EXCL_STOP } if ( numIntervals() == 1 ) return ; // already a single interval @@ -1105,10 +1067,8 @@ Histogram::isNullInstantiated() const // HistInts besides the NULL interval if (entries() == 3) { -// LCOV_EXCL_START - rfi CCMPASSERT ("Illegal number of intervals in the histogram"); return FALSE; -// LCOV_EXCL_STOP } return TRUE ; @@ -2426,7 +2386,6 @@ NABoolean Interval::satisfiesCriterion2(Source invokedFrom, Interval & other) return TRUE; } -// LCOV_EXCL_START - dpm void Interval::display (FILE *f, const char * prefix, const char * suffix) const { @@ -2446,7 +2405,6 @@ Interval::display (FILE *f, const char * prefix, const char * suffix) const fprintf (f, "< "); hiBound().display(f); } -// LCOV_EXCL_STOP // ----------------------------------------------------------------------- // methods on Histogram class @@ -2522,7 +2480,6 @@ Histogram::createMergeTemplate (const HistogramSharedPtr& otherHistogram, // ----------------------------------------------------------------------------- if ( this->entries() < 2 || otherHistogram->entries() < 2 ) { -// LCOV_EXCL_START - rfi if ( equiMerge ) return histTemplate ; // no qualifying intervals else @@ -2546,7 +2503,6 @@ Histogram::createMergeTemplate (const HistogramSharedPtr& otherHistogram, return histTemplate ; } -// LCOV_EXCL_STOP } // OK, at this point we know both histograms have Intervals @@ -2756,14 +2712,12 @@ Histogram::createMergeTemplate (const HistogramSharedPtr& otherHistogram, if ( (histTemplate->entries() == 1) || !validHistTemp) { -// LCOV_EXCL_START - rfi // sanity check CCMPASSERT(histTemplate->entries() != 1); // clear whatever has been done till now histTemplate->clear(); // insert an interval with boundaries equal to overlapMin and overlapMax histTemplate->insertZeroInterval(minVal, maxVal, TRUE); -// LCOV_EXCL_STOP } return histTemplate; @@ -2983,7 +2937,6 @@ ColStats::populateTemplate (const ColStatsSharedPtr& otherStats) } else if ( newRowcount.isZero() AND requiredMinimum.isGreaterThanZero() ) { -// LCOV_EXCL_START - rfi // create a 1-interval histogram, no fuss CostScalar calculatedUec = ColStatDesc::calculateCorrectResultUec (otherStats->getRowcount(), @@ -2999,7 +2952,6 @@ ColStats::populateTemplate (const ColStatsSharedPtr& otherStats) // populate that first interval with rc/uec Interval first = histogram_->getFirstInterval() ; first.setRowsAndUec (requiredMinimum, calculatedUec) ; -// LCOV_EXCL_STOP } } @@ -3124,7 +3076,7 @@ void ColStats::insertZeroInterval() { if (histogram_ == NULL) - histogram_ = HistogramSharedPtr(new (HISTHEAP) Histogram(HISTHEAP)); // LCOV_EXCL_LINE - rfi + histogram_ = HistogramSharedPtr(new (HISTHEAP) Histogram(HISTHEAP)); histogram_->insertZeroInterval(getMinValue(), getMaxValue(), TRUE); Interval first = histogram_->getFirstInterval(); @@ -3243,7 +3195,6 @@ ColStats::removeRedundantEmpties() // ----------------------------------------------------------------------- // to be called from the debugger -// LCOV_EXCL_START - dpm void Histogram::display() const { @@ -3264,7 +3215,6 @@ Histogram::print (FILE *f, const char * prefix, const char * suffix, (*this)[i].display(f, " ", "", c, buf); } } -// LCOV_EXCL_STOP THREAD_P Int64 ColStats::fakeHistogramIDCounter_=ColStats::USTAT_HISTOGRAM_ID_THRESHOLD; @@ -3495,7 +3445,6 @@ ColStats::createFakeHist() // This method calls Histogram::condenseToSingleInterval, and also sets // the isCompressed flag to TRUE // -------------------------------------------------------------------- -// LCOV_EXCL_START - rfi void ColStats::compressToSingleInt() { @@ -3523,7 +3472,6 @@ ColStats::compressToSingleInt() this->setIsCompressed(TRUE); } -// LCOV_EXCL_STOP // ----------------------------------------------------------------------- // After we've mangled the heck out of the histogram, we've often lost @@ -3661,7 +3609,6 @@ ColStats::modifyStats (ItemExpr * pred, CostScalar *maxSelectivity) if ( histogram_ == NULL || histogram_->numIntervals() == 0 ) { -// LCOV_EXCL_START - rfi CCMPASSERT (histogram_ != NULL) ; // $$$ synthesize the effect on just the MIN and MAX values?? // $$$ Weird special case: Can we have a non-NULL min/max if the @@ -3669,7 +3616,6 @@ ColStats::modifyStats (ItemExpr * pred, CostScalar *maxSelectivity) // If there is no histogram_, create an empty histogram and return. insertZeroInterval(); return; -// LCOV_EXCL_STOP } // Begin Set-Up to perform the given Predicate........ @@ -4228,18 +4174,14 @@ void ColStats::recoverFromMergeColStats(const ColStatsSharedPtr& otherStats, { if (histogram_ == NULL) { -// LCOV_EXCL_START - rfi CCMPASSERT (histogram_ != NULL) ; insertZeroInterval(); -// LCOV_EXCL_STOP } if (otherStats->histogram_ == NULL) { -// LCOV_EXCL_START - rfi CCMPASSERT (otherStats->getHistogram() != NULL ); otherStats->insertZeroInterval(); -// LCOV_EXCL_STOP } // Can't always construct a precise result histogram, but when one // can't one sometimes *can* produce a meaningful single-interval @@ -4569,7 +4511,7 @@ Criterion ColStats::decideReductionCriterion(Source invokedFrom, { //cannot reduce multicolumn stats if(getStatColumns().entries() > 1) - return NONE; // LCOV_EXCL_LINE - rfi + return NONE; //if invoked histograms for base tables //have been obtained using FetchHistograms @@ -4663,7 +4605,7 @@ void ColStats::reduceNumHistInts(Source invokedFrom, Criterion reductionCriterio { //if there is no histogram return if(!histogram_) - return; // LCOV_EXCL_LINE - rfi + return; //dont do anything for fake histograms if(isFakeHistogram()) @@ -4820,7 +4762,7 @@ void ColStats::copyAndScaleHistogram (CostScalar scale) { if ( getHistogram() == NULL ) - return ; // LCOV_EXCL_LINE - rfi + return ; histogram_ = HistogramSharedPtr(new (heap_) Histogram(*histogram_, heap_)); @@ -4839,7 +4781,7 @@ ColStats::scaleHistogram (CostScalar scale, NABoolean scaleFreqValList) { if ( getHistogram() == NULL ) - return; // LCOV_EXCL_LINE - rfi + return; // set the scale factor of the histogram with what ever the histogram // is being scaled by. The method is called for making deep copies. We @@ -4905,10 +4847,8 @@ ColStats::scaleHistogram (CostScalar scale, { if (uecScale > csOne) { -// LCOV_EXCL_START - rfi CCMPASSERT ("UEC can never increase"); uecScale = csOne; -// LCOV_EXCL_STOP } for ( iter = hist->getFirstInterval() ; @@ -5078,7 +5018,6 @@ ColStats::scaleHistogram (CostScalar scale, // This method returns the total row count and total UEC of intervals // whose frequency is greater than or equal to the threshold value // -------------------------------------------------------------------- -// LCOV_EXCL_START - cnu void ColStats::getAccRowCountAboveOrEqThreshold ( CostScalar & accRowCnt, /* out */ CostScalar & accUec, /* out */ @@ -5128,7 +5067,6 @@ ColStats::getAccRowCountAboveOrEqThreshold ( CostScalar & accRowCnt, /* out */ return; } // ColStats::getAccRowCountAboveOrEqThreshold -// LCOV_EXCL_STOP void ColStats::setMaxFreq(CostScalar val) @@ -5245,7 +5183,6 @@ ColStats::reduceToMaxIntervalCount() if ( intervalCount < 4 || maxIntervalCount < 4 || maxIntervalCount >= intervalCount ) return ; -// LCOV_EXCL_START - cnu // otherwise, we're definitely going to be modifying this histogram getHistogramToModify() ; HistogramSharedPtr hist = histogram_ ; // convenience @@ -5301,7 +5238,6 @@ ColStats::reduceToMaxIntervalCount() numMerged = 0 ; } } -// LCOV_EXCL_STOP } // ColStats::reduceToMaxIntervalCount() // @@ -5994,7 +5930,6 @@ ColStats::makeGrouped() // ----------------------------------------------------------------------- // To be called from the debugger -// LCOV_EXCL_START - dpm void ColStats::display() const { @@ -6134,7 +6069,6 @@ void ColStats::trace(FILE* f, NATable* table) fprintf (f, "rowcount:" PF64 " ", templl); fprintf (f, "intervals:%d \n", (*histogram_).entries()); } -// LCOV_EXCL_STOP // ----------------------------------------------------------------------- // When one, or both, of the two to-be-combined column statistics has no @@ -7347,14 +7281,12 @@ ColStats::setToSingleValue (const EncodedValue & newValue, ConstValue* constExpr setMaxSetByPred (TRUE) ; if (histogram_->entries() < 2) { -// LCOV_EXCL_START - rfi // we messed up somewhere. recover by clearing the histogram and // inserting an interval with boundary equal to the new value // since we messed up somewhere, lets set the fake histogram flag to true CCMPASSERT (histogram_->entries() == 2) ; insertZeroInterval(); setFakeHistogram(TRUE); -// LCOV_EXCL_STOP } // check to make sure the results are what we wanted @@ -7717,7 +7649,6 @@ void StatsList::deepDelete() // groupUecValues_ and groupUecColumns_ do not need to be deep copied // because FetchHistograms does not return/load these two members //------------------------------------------------------------------------ -// LCOV_EXCL_START - cnu void StatsList::deepCopy(const StatsList& other, NAMemory * heap) { unsigned short members = (short)other.entries(); @@ -7729,7 +7660,6 @@ void StatsList::deepCopy(const StatsList& other, NAMemory * heap) DCMPASSERT(NOT this->groupUecColumns_.entries()) DCMPASSERT(NOT this->groupMCSkewedValueLists_.entries()) } -// LCOV_EXCL_STOP //------------------------------------------------------------------------- // StatsList::insertByPosition() @@ -7907,7 +7837,6 @@ StatsList& StatsList::operator=(const StatsList& list) return *this; } -// LCOV_EXCL_START - dpm void StatsList::display() const { @@ -7977,7 +7906,6 @@ void StatsList::trace (FILE *f, NATable* table) const (*this)[i]->trace(f, table); } } -// LCOV_EXCL_STOP // return true iff all fake histograms NABoolean StatsList::allFakeStats() const @@ -8025,7 +7953,6 @@ ColumnSet::ColumnSet(const NAColumnArray& colArray, NAMemory *heap) } } -// LCOV_EXCL_START - dpm void ColumnSet::display() const { @@ -8046,7 +7973,6 @@ void ColumnSet::print() const } printf("}"); } -// LCOV_EXCL_STOP // define "<" ordering of NAColumn names bool operator< (const NAColumn& col1, const NAColumn& col2) @@ -8095,7 +8021,6 @@ void ColumnSet::printColsFromTable(FILE *ofd, NATable *table) const fprintf(ofd," "); } -// LCOV_EXCL_START - dpm void MultiColumnHistogram::display() const { MultiColumnHistogram::print(); @@ -8111,7 +8036,6 @@ void MultiColumnHistogram::print(FILE *ofd, NATable* table) const fprintf(ofd, "rowcount:" PF64 " ", templl); fprintf(ofd, "intervals:2 \n"); } -// LCOV_EXCL_STOP MultiColumnHistogramList::~MultiColumnHistogramList() { @@ -8217,7 +8141,7 @@ void ColStats::compressColStatsForQueryPreds(ItemExpr * lowerBound, { //if there is no histogram return if(!histogram_) - return; // LCOV_EXCL_LINE - rfi + return; //dont do anything for fake histograms if(isFakeHistogram()) @@ -8225,7 +8149,7 @@ void ColStats::compressColStatsForQueryPreds(ItemExpr * lowerBound, //multicolumn stats, dont reduce if(columns_.entries() > 1) - return; // LCOV_EXCL_LINE - rfi + return; //if there are only two histints or less //we dont need to reduce @@ -8921,7 +8845,6 @@ void ColStats::addMCSkewedValue(const NAWchar * boundary, CostScalar frequency) } // to be called from the debugger -// LCOV_EXCL_START - dpm void FrequentValueList::display() const { @@ -8960,7 +8883,6 @@ void FrequentValue::print (FILE *f, snprintf(mybuf, sizeof(mybuf), "%s Probab. = %f \n", prefix, getProbability().value()); PRINTIT(f, c, space, buf, mybuf); } -// LCOV_EXCL_STOP FrequentValue::FrequentValue(UInt32 hashValue, CostScalar frequency, http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/7a95e1da/core/sql/optimizer/Stats.h ---------------------------------------------------------------------- diff --git a/core/sql/optimizer/Stats.h b/core/sql/optimizer/Stats.h index 4d3d5bd..aa424b3 100644 --- a/core/sql/optimizer/Stats.h +++ b/core/sql/optimizer/Stats.h @@ -759,10 +759,8 @@ public: // log the message to the event log // SQLMXLoggingArea::logSQLMXAssertionFailureEvent(__FILE__, __LINE__, "Histogram has just one HistInt"); -// LCOV_EXCL_START :rfi Histogram* tempHist = (Histogram *)this; tempHist->clear(); -// LCOV_EXCL_STOP } if ( entries() == 0 ) @@ -2353,9 +2351,7 @@ public: LIST(EncodedValue)(h,initLen), finalHashComputed_(TRUE) {}; -// LCOV_EXCL_START :dd ~SkewedValueList() {}; -// LCOV_EXCL_STOP // insert a skewed value in decending order. void insertInOrder(const EncodedValue&); http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/7a95e1da/core/sql/optimizer/SynthType.cpp ---------------------------------------------------------------------- diff --git a/core/sql/optimizer/SynthType.cpp b/core/sql/optimizer/SynthType.cpp index 44d6d99..73096cc 100644 --- a/core/sql/optimizer/SynthType.cpp +++ b/core/sql/optimizer/SynthType.cpp @@ -267,7 +267,6 @@ static void propagateCoAndCoToChildren(ItemExpr *parentOp, } } -// LCOV_EXCL_START - cnu static Int32 getNumCHARACTERArgs(ItemExpr *parentOp) { Int32 n = 0; @@ -279,7 +278,6 @@ static Int32 getNumCHARACTERArgs(ItemExpr *parentOp) } return n; } -// LCOV_EXCL_STOP // ----------------------------------------------------------------------- // The virtual NAType::isComparable() methods -- implemented here rather than @@ -399,7 +397,6 @@ NABoolean CharType::isComparable(const NAType &otherNA, #ifndef NDEBUG if (NCHAR_DEBUG < 0) NCHAR_DEBUG = getenv("NCHAR_DEBUG") ? +1 : 0; if (NCHAR_DEBUG > 0) { -// LCOV_EXCL_START - dpm NAString p(CmpCommon::statementHeap()); parentOp->unparse(p); NAString s(getTypeSQLname(TRUE /*terse*/)); @@ -420,7 +417,6 @@ NABoolean CharType::isComparable(const NAType &otherNA, << endl; if (!cmpOK) cerr << endl; -// LCOV_EXCL_STOP } #endif @@ -549,7 +545,7 @@ static NABoolean synthItemExprLists(ItemExprList &exprList1, if ( DoCompatibilityTest && NOT operand1->isCompatible(*operand2) ) { // 4041 comparison between these two types is not allowed - emitDyadicTypeSQLnameMsg(-4041, *operand1, *operand2); // LCOV_EXCL_LINE - cnu + emitDyadicTypeSQLnameMsg(-4041, *operand1, *operand2); return FALSE; } } @@ -962,7 +958,6 @@ Cast::pushDownType(NAType& desiredType, return (NAType *)synthesizeType(); } -// LCOV_EXCL_START - cnu void ItemExpr::coerceChildType(NAType& desiredType, enum NABuiltInTypeEnum defaultQualifier) { @@ -970,7 +965,6 @@ void ItemExpr::coerceChildType(NAType& desiredType, child(i) -> getValueId().coerceType(desiredType, defaultQualifier); } } -// LCOV_EXCL_STOP #pragma warning (default : 4018) //warning elimination #pragma warn(1506) // warning elimination @@ -1280,21 +1274,17 @@ const NAType *BuiltinFunction::synthesizeType() const CharType &typ1 = (CharType&)child(0)->getValueId().getType(); if (typ1.getTypeQualifier() != NA_CHARACTER_TYPE) { -// LCOV_EXCL_START - cnu // 4043 The operand of a $0~String0 function must be character. *CmpCommon::diags() << DgSqlCode(-4043) << DgString0(getTextUpper()); return NULL; -// LCOV_EXCL_STOP } const CharType &typ2 = (CharType&)child(1)->getValueId().getType(); if (typ2.getTypeQualifier() != NA_CHARACTER_TYPE) { -// LCOV_EXCL_START - cnu // 4043 The operand of a $0~String0 function must be character. *CmpCommon::diags() << DgSqlCode(-4043) << DgString0(getTextUpper()); return NULL; -// LCOV_EXCL_STOP } retType = new HEAP @@ -1555,7 +1545,6 @@ const NAType *CodeVal::synthesizeType() switch (getOperatorType()) { -// LCOV_EXCL_START - rfi case ITM_NCHAR_MP_CODE_VALUE: if ( CharInfo::is_NCHAR_MP(typ1.getCharSet()) != TRUE ) { @@ -1578,7 +1567,6 @@ const NAType *CodeVal::synthesizeType() return NULL; } break; -// LCOV_EXCL_STOP case ITM_ASCII: { @@ -1609,12 +1597,10 @@ const NAType *CodeVal::synthesizeType() { switch ( typ1.getCharSet() ) { -// LCOV_EXCL_START - mp case CharInfo::KANJI_MP: case CharInfo::KSC5601_MP: setOperatorType(ITM_NCHAR_MP_CODE_VALUE); break; -// LCOV_EXCL_STOP case CharInfo::UNICODE: setOperatorType(ITM_UNICODE_CODE_VALUE); @@ -1704,10 +1690,8 @@ const NAType *Aggregate::synthesizeType() if (!operand.isSupportedType()) { -// LCOV_EXCL_START - mp emitDyadicTypeSQLnameMsg(-4041, operand, operand); return NULL; -// LCOV_EXCL_STOP } if (inScalarGroupBy()) @@ -3228,12 +3212,10 @@ const NAType *DynamicParam::synthesizeType() } -// LCOV_EXCL_START - cnu const NAType *ExplodeVarchar::synthesizeType() { return getType(); } -// LCOV_EXCL_STOP const NAType *Format::synthesizeType() { @@ -3651,11 +3633,9 @@ const NAType *BitOperFunc::synthesizeType() default: { -// LCOV_EXCL_START - rfi // 4000 Internal Error. This function not supported. *CmpCommon::diags() << DgSqlCode(-4000); result = NULL; -// LCOV_EXCL_STOP } break; } @@ -3801,11 +3781,9 @@ const NAType *MathFunc::synthesizeType() default: { -// LCOV_EXCL_START - rfi // 4000 Internal Error. This function not supported. *CmpCommon::diags() << DgSqlCode(-4000); result = NULL; -// LCOV_EXCL_STOP } break; } @@ -4702,12 +4680,10 @@ const NAType *Lower::synthesizeType() CharType *ct = (CharType *)&operand; if ( CharInfo::is_NCHAR_MP(ct->getCharSet()) ) { -// LCOV_EXCL_START - mp // 3217: Character set KANJI/KSC5601 is not allowed in the LOWER function. *CmpCommon::diags() << DgSqlCode(-3217) << DgString0(CharInfo::getCharSetName(ct->getCharSet())) << DgString1("LOWER"); -// LCOV_EXCL_STOP } if ((ct->isUpshifted()) || @@ -4759,11 +4735,9 @@ const NAType *Upper::synthesizeType() CharType *ct = (CharType *)&operand; if ( CharInfo::is_NCHAR_MP(ct->getCharSet()) ) { -// LCOV_EXCL_START - mp *CmpCommon::diags() << DgSqlCode(-3217) << DgString0(CharInfo::getCharSetName(ct->getCharSet())) << DgString1("UPPER"); -// LCOV_EXCL_STOP } if (NOT ct->isUpshifted()) { http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/7a95e1da/core/sql/optimizer/TableDesc.cpp ---------------------------------------------------------------------- diff --git a/core/sql/optimizer/TableDesc.cpp b/core/sql/optimizer/TableDesc.cpp index dc9a5b3..245b720 100644 --- a/core/sql/optimizer/TableDesc.cpp +++ b/core/sql/optimizer/TableDesc.cpp @@ -564,7 +564,6 @@ TableDesc::setBaseSelectivityHintForScan(SelectivityHint *selHint, // ----------------------------------------------------------------------- #pragma nowarn(1506) // warning elimination #pragma nowarn(770) // warning elimination -// LCOV_EXCL_START - dpm void TableDesc::print(FILE* ofd, const char* indent, const char* title) { #ifndef NDEBUG @@ -602,7 +601,6 @@ void TableDescList::print(FILE* ofd, const char* indent, const char* title) } #endif } // TableDescList::print() -// LCOV_EXCL_STOP CardinalityHint::CardinalityHint(CostScalar scanCardinality) { scanCardinality_ = scanCardinality; @@ -611,7 +609,6 @@ CardinalityHint::CardinalityHint(CostScalar scanCardinality) baseSelectivity_ = -1.0; } -// LCOV_EXCL_START - cnu // constructor defined with local predicates CardinalityHint::CardinalityHint(CostScalar scanCardinality, const ValueIdSet & localPreds) @@ -621,7 +618,6 @@ CardinalityHint::CardinalityHint(CostScalar scanCardinality, localPreds_ = localPreds; baseSelectivity_ = -1.0; } -// LCOV_EXCL_STOP SelectivityHint::SelectivityHint(double selectivityFactor) { selectivityFactor_ = selectivityFactor; @@ -634,12 +630,11 @@ void SelectivityHint::setScanSelectivityFactor (double selectivityFactor) // This method is called only for selectivityFactor >= 0.0 if (selectivityFactor > 1.0) - selectivityFactor_ = 1.0; // LCOV_EXCL_LINE - rfi + selectivityFactor_ = 1.0; else selectivityFactor_ = selectivityFactor ; } -// LCOV_EXCL_START - cnu CostScalar TableDesc::getBaseRowCntIfUniqueJoinCol(const ValueIdSet &joinedCols) @@ -666,7 +661,6 @@ TableDesc::getBaseRowCntIfUniqueJoinCol(const ValueIdSet &joinedCols) return baseRowCount; } // TableDesc::getBaseRowCntIfUniqueJoinCol -// LCOV_EXCL_STOP ValueIdSet TableDesc::getComputedColumns(NAColumnBooleanFuncPtrT fptr) http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/7a95e1da/core/sql/optimizer/TableDesc.h ---------------------------------------------------------------------- diff --git a/core/sql/optimizer/TableDesc.h b/core/sql/optimizer/TableDesc.h index 321be1b..cd20a45 100644 --- a/core/sql/optimizer/TableDesc.h +++ b/core/sql/optimizer/TableDesc.h @@ -369,10 +369,8 @@ public: SelectivityHint(double selectivityFactor = -1.0); // Destructor -// LCOV_EXCL_START :dd virtual ~SelectivityHint() {} -// LCOV_EXCL_STOP inline double getScanSelectivityFactor () const { return selectivityFactor_ ; } void setScanSelectivityFactor (double selectivityFactor); @@ -404,10 +402,8 @@ public: const ValueIdSet & localPreds); // Destructor -// LCOV_EXCL_START :dd virtual ~CardinalityHint() {} -// LCOV_EXCL_STOP inline CostScalar getScanCardinality () const { return scanCardinality_ ; } void setScanCardinality (CostScalar scanCardinality) { scanCardinality_ = MIN_ONE_CS(scanCardinality); } http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/7a95e1da/core/sql/optimizer/TransRule.cpp ---------------------------------------------------------------------- diff --git a/core/sql/optimizer/TransRule.cpp b/core/sql/optimizer/TransRule.cpp index 9b55366..89881ed 100644 --- a/core/sql/optimizer/TransRule.cpp +++ b/core/sql/optimizer/TransRule.cpp @@ -1922,7 +1922,6 @@ RelExpr * OrOptimizationRule::nextSubstitute( // If a predicate contains 1=1, it is constant folded and removed // from the OR predicate. // - // LCOV_EXCL_START if( doesValueIdEvaluateToFalse(d) ) { disjunctsEvaluatingToFalse += d; @@ -1932,7 +1931,6 @@ RelExpr * OrOptimizationRule::nextSubstitute( return NULL; } break; - // LCOV_EXCL_STOP default: // leave col set to NULL @@ -6472,7 +6470,7 @@ NABoolean TSJUDRRule::isContextSensitive () const // methods for class HbaseAccessRule // ----------------------------------------------------------------------- -//HbaseScanRule::~HbaseScanRule() {} // LCOV_EXCL_LINE +//HbaseScanRule::~HbaseScanRule() {} // //NABoolean HbaseScanRule::topMatch(RelExpr * relExpr, Context *context) //{ http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/7a95e1da/core/sql/optimizer/TransRule.h ---------------------------------------------------------------------- diff --git a/core/sql/optimizer/TransRule.h b/core/sql/optimizer/TransRule.h index 1a91069..a037d85 100644 --- a/core/sql/optimizer/TransRule.h +++ b/core/sql/optimizer/TransRule.h @@ -130,7 +130,7 @@ public: // copy ctor MJExpandRule (const MJExpandRule &) ; // not written - virtual ~MJExpandRule() {} // LCOV_EXCL_LINE + virtual ~MJExpandRule() {} virtual NABoolean topMatch (RelExpr * expr, Context * context); @@ -161,7 +161,7 @@ public: // copy ctor MVQRRule (const MVQRRule &) ; - virtual ~MVQRRule() {} // LCOV_EXCL_LINE + virtual ~MVQRRule() {} virtual NABoolean topMatch (RelExpr * expr, Context * context); @@ -184,7 +184,7 @@ public: // copy ctor MVQRScanRule (const MVQRScanRule &) ; - virtual ~MVQRScanRule() {} // LCOV_EXCL_LINE + virtual ~MVQRScanRule() {} virtual NABoolean topMatch (RelExpr * expr, Context * context); @@ -207,7 +207,7 @@ public: // copy ctor GroupByMVQRRule (const GroupByMVQRRule &) ; - virtual ~GroupByMVQRRule() {} // LCOV_EXCL_LINE + virtual ~GroupByMVQRRule() {} virtual NABoolean topMatch (RelExpr * expr, Context * context); @@ -230,7 +230,7 @@ public: // copy ctor MJEnumRule (const MJEnumRule &) ; // not written - virtual ~MJEnumRule() {} // LCOV_EXCL_LINE + virtual ~MJEnumRule() {} virtual NABoolean topMatch (RelExpr * expr, Context * context); @@ -250,7 +250,6 @@ class MJStarJoinIRuleWA : public NABasicObject friend class MJStarJoinIRule; public: - // LCOV_EXCL_START // listOfEdges_ is allocated from the statement heap. It is safe to // ignore this dstr is not code coveraged. ~MJStarJoinIRuleWA() @@ -258,7 +257,6 @@ public: if(listOfEdges_) delete listOfEdges_; } - // LCOV_EXCL_STOP private: @@ -318,7 +316,7 @@ public: // copy ctor MJStarJoinRules (const MJExpandRule &) ; // not written - virtual ~MJStarJoinRules() {} // LCOV_EXCL_LINE + virtual ~MJStarJoinRules() {} /*virtual NABoolean topMatch (RelExpr * expr, Context * context); @@ -359,7 +357,7 @@ public: // copy ctor MJStarJoinIRule (const MJStarJoinIRule &) ; // not written - virtual ~MJStarJoinIRule() {} // LCOV_EXCL_LINE + virtual ~MJStarJoinIRule() {} virtual NABoolean topMatch (RelExpr * expr, Context * context); @@ -449,7 +447,7 @@ public: // copy ctor MJStarJoinIIRule (const MJExpandRule &) ; // not written - virtual ~MJStarJoinIIRule() {} // LCOV_EXCL_LINE + virtual ~MJStarJoinIIRule() {} virtual NABoolean topMatch (RelExpr * expr, Context * context); @@ -479,7 +477,7 @@ public: JoinCommutativityRule (const JoinCommutativityRule &) ; // not written // warning elimination (removed "inline") - virtual ~JoinCommutativityRule() {} // LCOV_EXCL_LINE + virtual ~JoinCommutativityRule() {} virtual NABoolean topMatch (RelExpr * expr, Context * context); @@ -502,7 +500,7 @@ public: JoinLeftShiftRule (const JoinLeftShiftRule &) ; // not written // warning elimination (removed "inline") - virtual ~JoinLeftShiftRule() {} // LCOV_EXCL_LINE + virtual ~JoinLeftShiftRule() {} virtual NABoolean topMatch (RelExpr * expr, Context * context); @@ -531,7 +529,7 @@ public: IndexJoinRule1 (const IndexJoinRule1 &) ; // not written // warning elimination (removed "inline") - virtual ~IndexJoinRule1() {} // LCOV_EXCL_LINE + virtual ~IndexJoinRule1() {} virtual NABoolean topMatch (RelExpr * expr, Context * context); virtual RelExpr * nextSubstitute(RelExpr * before, @@ -558,7 +556,7 @@ public: IndexJoinRule2 (const IndexJoinRule2 &) ; // not written // warning elimination (removed "inline") - virtual ~IndexJoinRule2() {} // LCOV_EXCL_LINE + virtual ~IndexJoinRule2() {} virtual NABoolean topMatch (RelExpr * expr, Context * context); virtual RelExpr * nextSubstitute(RelExpr * before, @@ -578,7 +576,7 @@ public: OrOptimizationRule (const OrOptimizationRule &) ; // not written // warning elimination (removed "inline") - virtual ~OrOptimizationRule() {} // LCOV_EXCL_LINE + virtual ~OrOptimizationRule() {} virtual NABoolean topMatch (RelExpr * expr, Context * context); @@ -613,7 +611,7 @@ public: TSJRule (const TSJRule &) ; // not written // warning elimination (removed "inline") - virtual ~TSJRule() {} // LCOV_EXCL_LINE + virtual ~TSJRule() {} virtual NABoolean topMatch (RelExpr * expr, Context * context); @@ -660,7 +658,7 @@ public: JoinToTSJRule (const JoinToTSJRule &) ; // not written // warning elimination (removed "inline") - virtual ~JoinToTSJRule() {} // LCOV_EXCL_LINE + virtual ~JoinToTSJRule() {} virtual NABoolean topMatch (RelExpr * expr, Context * context); @@ -686,7 +684,7 @@ public: TSJFlowRule (const TSJFlowRule &) ; // not written // warning elimination (removed "inline") - virtual ~TSJFlowRule() {} // LCOV_EXCL_LINE + virtual ~TSJFlowRule() {} virtual NABoolean topMatch (RelExpr * expr, Context * context); @@ -707,7 +705,7 @@ public: Rule(name,pattern,substitute) {} // warning elimination (removed "inline") - virtual ~TSJUDRRule() {} // LCOV_EXCL_LINE + virtual ~TSJUDRRule() {} virtual NABoolean topMatch (RelExpr * expr, Context * context); @@ -739,7 +737,7 @@ public: FilterRule (const FilterRule &) ; // not written // warning elimination (removed "inline") - virtual ~FilterRule() {} // LCOV_EXCL_LINE + virtual ~FilterRule() {} virtual Guidance * guidanceForExploringChild(Guidance * guidance, Context * context, Lng32 childIndex); @@ -976,7 +974,7 @@ public: SampleScanRule (const SampleScanRule &) ; // not written // warning elimination (removed "inline") - virtual ~SampleScanRule() {} // LCOV_EXCL_LINE + virtual ~SampleScanRule() {} virtual NABoolean topMatch (RelExpr * expr, Context * context); virtual RelExpr * nextSubstitute(RelExpr * before, @@ -999,7 +997,7 @@ public: RelExpr * substitute) : Rule(name,pattern,substitute) {} // warning elimination (removed "inline") - virtual ~JoinToBushyTreeRule() {} // LCOV_EXCL_LINE + virtual ~JoinToBushyTreeRule() {} virtual NABoolean topMatch (RelExpr * expr, Context * context); http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/7a95e1da/core/sql/optimizer/TriggerDB.cpp ---------------------------------------------------------------------- diff --git a/core/sql/optimizer/TriggerDB.cpp b/core/sql/optimizer/TriggerDB.cpp index f335829..9bf4ebb 100644 --- a/core/sql/optimizer/TriggerDB.cpp +++ b/core/sql/optimizer/TriggerDB.cpp @@ -47,7 +47,6 @@ // Debugging aid. // // For debugging only -// LCOV_EXCL_START void TableOp::print(ostream& os) const { @@ -64,7 +63,6 @@ TableOp::print(ostream& os) const os << "of Table " << subjectTable_.getQualifiedNameAsAnsiString() << " : " << endl; } -// LCOV_EXCL_STOP //----------------------------------------------------------------------------- // @@ -88,10 +86,8 @@ TriggerDB::HashFunction(const TableOp & key) return hval+2; else { - // LCOV_EXCL_START CMPASSERT(FALSE); return 0; - // LCOV_EXCL_STOP } } @@ -123,7 +119,6 @@ TriggerDB::getValidEntry(const TableOp * key, BindWA * bindWA) // only used when triggers are allocated from the cntext heap. // Currently triggers are allocated from the statement heap. // See method Trigger::Heap() in file Triggers.h for more details - // LCOV_EXCL_START // entry exist in TriggerDB and we work ACROSS statements => // validate the entry: compare the entry's subject table timestamp @@ -151,7 +146,6 @@ TriggerDB::getValidEntry(const TableOp * key, BindWA * bindWA) delete result; // destroy the entry return NULL; } - // LCOV_EXCL_STOP } // end of validation // at this point, if result != NULL, then it is valid. Otherwise it is @@ -178,7 +172,6 @@ TriggerDB::getTriggers(QualifiedName &subjectTable, // only used when triggers are allocated from the cntext heap. // Currently triggers are allocated from the statement heap. // See method Trigger::Heap() in file Triggers.h for more details -// LCOV_EXCL_START void TriggerDB::clearAndDestroy() { @@ -205,7 +198,6 @@ TriggerDB::clearAndDestroy() // now, TriggerDB should be empty CMPASSERT(this->entries() == 0); } -// LCOV_EXCL_STOP // // -- ResetRecursionCounter() @@ -217,7 +209,6 @@ TriggerDB::clearAndDestroy() // only used when triggers are allocated from the cntext heap. // Currently triggers are allocated from the statement heap. // See method Trigger::Heap() in file Triggers.h for more details -// LCOV_EXCL_START static void ResetRecursionCounter(TriggerList* triggerList) { @@ -230,7 +221,6 @@ ResetRecursionCounter(TriggerList* triggerList) trg->resetRecursionCounter(); } } -// LCOV_EXCL_STOP // // -- TriggerDB::cleanupPerStatement() @@ -244,7 +234,6 @@ ResetRecursionCounter(TriggerList* triggerList) // only used when triggers are allocated from the cntext heap. // Currently triggers are allocated from the statement heap. // See method Trigger::Heap() in file Triggers.h for more details -// LCOV_EXCL_START NABoolean TriggerDB::cleanupPerStatement() { @@ -282,7 +271,6 @@ TriggerDB::cleanupPerStatement() return FALSE; } } -// LCOV_EXCL_STOP // // -- TriggerDB::print @@ -290,7 +278,6 @@ TriggerDB::cleanupPerStatement() // Debugging aid. // // For debugging only -// LCOV_EXCL_START void TriggerDB::print(ostream& os) const { NAHashDictionaryIterator<TableOp, BeforeAndAfterTriggers> iter (*this) ; @@ -312,7 +299,6 @@ void TriggerDB::print(ostream& os) const iter.getNext(top, triggers); } } -// LCOV_EXCL_STOP NABoolean TriggerDB::isHiveTable(QualifiedName& name) { @@ -331,12 +317,10 @@ NABoolean TriggerDB::isHiveTable(QualifiedName& name) // TBD // // not implemented -// LCOV_EXCL_START RefConstraintList * SchemaDB::getRIs(QualifiedName &subjectTable, ComOperation operation) { return NULL; } -// LCOV_EXCL_STOP http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/7a95e1da/core/sql/optimizer/Triggers.cpp ---------------------------------------------------------------------- diff --git a/core/sql/optimizer/Triggers.cpp b/core/sql/optimizer/Triggers.cpp index 270aa76..0b18d9d 100644 --- a/core/sql/optimizer/Triggers.cpp +++ b/core/sql/optimizer/Triggers.cpp @@ -64,7 +64,6 @@ subjectNameToTrigTemp( const NAString & subjectTableName ) // by subjectNameToTrigTemp() ) ) // // no longer used -buggy -// LCOV_EXCL_START NAString trigTempToSubjectName( const NAString & trigTempTableName ) { @@ -86,7 +85,6 @@ trigTempToSubjectName( const NAString & trigTempTableName ) return subjectTableName; } -// LCOV_EXCL_STOP //----------------------------------------------------------------------------- // @@ -181,7 +179,6 @@ UpdateColumns::markColumnsOnBitmap(unsigned char *bitmap, CollIndex numBytes) co // Debugging aid // // used for debugging only -// LCOV_EXCL_START void UpdateColumns::print(ostream & os, const char* indent, const char* title) const { @@ -199,7 +196,6 @@ UpdateColumns::print(ostream & os, const char* indent, const char* title) const os << endl; } -// LCOV_EXCL_STOP //----------------------------------------------------------------------------- // @@ -212,7 +208,6 @@ UpdateColumns::print(ostream & os, const char* indent, const char* title) const // are trigger object's get desructed explicitly // Currently triggers are allocated from the statement heap. // See method Trigger::Heap() in file Triggers.h for more details -// LCOV_EXCL_START Trigger::~Trigger() { // only when persistence is active, trigger object's get desructed @@ -235,7 +230,6 @@ Trigger::~Trigger() if (sqlText_) delete sqlText_; } -// LCOV_EXCL_STOP // // -- Trigger:: equality @@ -390,7 +384,6 @@ Trigger::getParsedTrigger(BindWA *bindWA) #pragma nowarn(770) // warning elimination #pragma nowarn(1506) // warning elimination // used for debugging only -// LCOV_EXCL_START void Trigger::print(ostream &os, const char* indent, const char* title) const { @@ -420,7 +413,6 @@ Trigger::print(ostream &os, const char* indent, const char* title) const os << "TimeStamp: " << convertInt64ToDouble(timeStamp_) << endl; os << "Recursion Counter: " << recursionCounter_ << endl; } -// LCOV_EXCL_STOP #pragma warn(1506) // warning elimination #pragma warn(770) // warning elimination @@ -529,7 +521,6 @@ TriggerList::sortByTimeStamp() #pragma nowarn(1506) // warning elimination #pragma nowarn(770) // warning elimination // used for debugging only -// LCOV_EXCL_START void TriggerList::print(ostream & os, const char* indent, const char* title) const { @@ -541,7 +532,6 @@ TriggerList::print(ostream & os, const char* indent, const char* title) const os << ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "; } } -// LCOV_EXCL_STOP #pragma warn(770) // warning elimination #pragma warn(1506) // warning elimination @@ -555,7 +545,6 @@ TriggerList::print(ostream & os, const char* indent, const char* title) const // only used when triggers are allocated from the cntext heap. // Currently triggers are allocated from the statement heap. // See method Trigger::Heap() in file Triggers.h -// LCOV_EXCL_START void TriggerList::clearAndDestroy() { @@ -568,7 +557,6 @@ TriggerList::clearAndDestroy() } this->clear(); } -// LCOV_EXCL_STOP //------------------------------------------------------------------------------ @@ -583,7 +571,6 @@ TriggerList::clearAndDestroy() // Debugging aid. // // used for debugging only -// LCOV_EXCL_START void BeforeAndAfterTriggers::print(ostream& os, const char *indent, @@ -596,7 +583,6 @@ BeforeAndAfterTriggers::print(ostream& os, if (getAfterRowTriggers()) getAfterRowTriggers()->print(os, indent, "After Row Triggers: "); } -// LCOV_EXCL_STOP // @@ -608,7 +594,6 @@ BeforeAndAfterTriggers::print(ostream& os, // are trigger object's get desructed explicitly // Currently triggers are allocated from the statement heap. // See method Trigger::Heap() in file Triggers.h for more details -// LCOV_EXCL_START void BeforeAndAfterTriggers::clearAndDestroy() { @@ -630,7 +615,6 @@ BeforeAndAfterTriggers::clearAndDestroy() delete beforeTriggers_; } } -// LCOV_EXCL_STOP // @@ -641,13 +625,11 @@ BeforeAndAfterTriggers::clearAndDestroy() // are trigger object's get desructed explicitly // Currently triggers are allocated from the statement heap. // See method Trigger::Heap() in file Triggers.h for more details -// LCOV_EXCL_START BeforeAndAfterTriggers::~BeforeAndAfterTriggers() { // NOTE: if deep-destruction is required then // call this->clearAndDestroyAllEntries() here } -// LCOV_EXCL_STOP // // -- BeforeAndAfterTriggers::entries http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/7a95e1da/core/sql/optimizer/Triggers.h ---------------------------------------------------------------------- diff --git a/core/sql/optimizer/Triggers.h b/core/sql/optimizer/Triggers.h index 832d7bc..8e5ec11 100644 --- a/core/sql/optimizer/Triggers.h +++ b/core/sql/optimizer/Triggers.h @@ -134,7 +134,6 @@ public: // copy ctor // should not use - // LCOV_EXCL_START Trigger (const Trigger &other) : name_(other.name_), subjectTable_(other.subjectTable_), @@ -145,18 +144,15 @@ public: updateCols_(other.updateCols_) // Should never be called. Supplied only for collections. { CMPASSERT(FALSE); } - // LCOV_EXCL_STOP // dtor - virtual ~Trigger(); // LCOV_EXCL_LINE + virtual ~Trigger(); // assignment operator // should not use - // LCOV_EXCL_START Trigger& operator = (const Trigger& other) // Should never be called. Supplied only because of collections. { CMPASSERT(FALSE); return *this; } - // LCOV_EXCL_STOP // equality operator NABoolean operator ==(const Trigger &other) const; @@ -169,14 +165,12 @@ public: { return subjectTable_.getQualifiedNameAsAnsiString(); } // used for debugging only - print methods - // LCOV_EXCL_START inline ComOperation getOperation() const { return operation_; } inline NABoolean isBeforeTrigger() const { return (activation_ == COM_BEFORE); } inline NABoolean isStatementTrigger() const { return (granularity_== COM_STATEMENT); } - // LCOV_EXCL_STOP inline NABoolean isAfterTrigger() const { return (activation_ == COM_AFTER); } @@ -211,9 +205,7 @@ public: inline void decRecursionCounter() { recursionCounter_--; } // no longer used - // LCOV_EXCL_START inline void resetRecursionCounter() { recursionCounter_=0; } - // LCOV_EXCL_STOP //------------------------------------------------------------------------- // Memory Management and Trigger Persistence @@ -407,9 +399,6 @@ public: void print(ostream& os, const char* indent, const char* title) const; - - // LCOV_EXCL_STOP - }; //----------------------------------------------------------------------------- @@ -462,10 +451,8 @@ public: // NAHashBucket::contains() being called with a default NULL argument for // Values in the triggerDB hash where BeforeAndAfterTriggers are Values. // warning elimination (removed "inline") - // LCOV_EXCL_START NABoolean operator == (const BeforeAndAfterTriggers &other) const { CMPASSERT(FALSE); return FALSE; } - // LCOV_EXCL_STOP void print(ostream& os, const char* indent, const char* title) const; http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/7a95e1da/core/sql/optimizer/ValueDesc.cpp ---------------------------------------------------------------------- diff --git a/core/sql/optimizer/ValueDesc.cpp b/core/sql/optimizer/ValueDesc.cpp index 74e2db7..cf82e2f 100644 --- a/core/sql/optimizer/ValueDesc.cpp +++ b/core/sql/optimizer/ValueDesc.cpp @@ -3116,7 +3116,7 @@ ValueIdSet ValueIdSet::createMirrorPreds(ValueId &computedCol, case ITM_ASSIGN: default: // XXX Don't expect this case to ever happen - CMPASSERT(0); // LCOV_EXCL_LINE + CMPASSERT(0); break; } } http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/7a95e1da/core/sql/optimizer/costmethod.cpp ---------------------------------------------------------------------- diff --git a/core/sql/optimizer/costmethod.cpp b/core/sql/optimizer/costmethod.cpp index 83683e5..c063f1d 100644 --- a/core/sql/optimizer/costmethod.cpp +++ b/core/sql/optimizer/costmethod.cpp @@ -70,7 +70,6 @@ static THREAD_P FILE* pfp = NULL; // be called. This is a workaround for bugs/missing // functionality in ObjectCenter that cause display() to become // an undefined symbol. -// LCOV_EXCL_START :dpm void displayCostMethod(const CostMethod& pf) { pf.display(); @@ -81,7 +80,6 @@ void displayCostMethod(const CostMethod* pf) if (pf) pf->display(); } -// LCOV_EXCL_STOP //<pb> //************************************************ @@ -106,7 +104,6 @@ void displayCostMethod(const CostMethod* pf) // Rolled up cost. // //============================================================================== -// LCOV_EXCL_START :cnu -- OCM code Cost* rollUpUnaryNonBlocking(const Cost& parentOnly, const Cost& childRollUp, @@ -311,7 +308,6 @@ CostMethod::print( FILE* ofd void CostMethod::display() const { print(); } -// LCOV_EXCL_STOP // ----------------------------------------------------------------------- // CostMethod::cleanUpAllCostMethods() is used to reset the SharedPtrs in @@ -322,7 +318,6 @@ CostMethod::display() const { print(); } // function may also clean up other problems that may exist in the // CostMethod objects when a longjmp occurs. // ----------------------------------------------------------------------- -// LCOV_EXCL_START :rfi void CostMethod::cleanUpAllCostMethods() { @@ -333,13 +328,11 @@ CostMethod::cleanUpAllCostMethods() cm != NULL; cm = cm->nextCostMethod_) cm->cleanUp(); } -// LCOV_EXCL_STOP // ----------------------------------------------------------------------- // CostMethod::generateZeroCostObject() // Generate a zero cost object out of the information already cached. // ----------------------------------------------------------------------- -// LCOV_EXCL_START :cnu -- OCM code Cost* CostMethod::generateZeroCostObject() { // A zero cost vector. @@ -359,7 +352,6 @@ Cost* CostMethod::generateZeroCostObject() return new STMTHEAP Cost( &cv, &cv, NULL, cpuCount, fragmentsPerCPU ); } -// LCOV_EXCL_STOP // return true iff we are under a nested join NABoolean @@ -627,15 +619,13 @@ CostMethod::computeOperatorCost(RelExpr* op, Cost* cost; try { cost = computeOperatorCostInternal(op, myContext, countOfStreams); - } catch(...) { // LCOV_EXCL_LINE :rfi + } catch(...) { // cleanUp() must be called before this function is called again // because wrong results may occur the next time computeOperatorCost() // is called and because the SharedPtr objects must be set to zero. // Failure to call cleanUp() will very likely cause problems. - // LCOV_EXCL_START :rfi cleanUp(); throw; // rethrow the exception - // LCOV_EXCL_STOP } cleanUp(); @@ -807,7 +797,7 @@ CostMethod::computePlanCost( RelExpr* op, //------------------------------------------------------------------ if ( childContext == NULL ) { - ABORT("CostMethod::computePlanCost(): A child has a NULL context"); // LCOV_EXCL_LINE :rfi + ABORT("CostMethod::computePlanCost(): A child has a NULL context"); } // Coverity flags this dereferencing null pointer childContext. @@ -815,7 +805,7 @@ CostMethod::computePlanCost( RelExpr* op, // coverity[var_deref_model] if ( NOT childContext->hasOptimalSolution() ) { - ABORT("CostMethod::computePlanCost(): A child has no solution"); // LCOV_EXCL_LINE :rfi + ABORT("CostMethod::computePlanCost(): A child has no solution"); } //--------------------------------------------- @@ -865,7 +855,6 @@ CostMethod::computePlanCost( RelExpr* op, // none. // //============================================================================== -// LCOV_EXCL_START :cnu -- OCM code void CostMethod::getChildCostsForBinaryOp( RelExpr* op , const Context* myContext @@ -1284,7 +1273,6 @@ CostMethod::mergeBothLegsBlocking( const CostPtr leftChildCost, } // CostMethod::mergeBothLegsBlocking //<pb> -// LCOV_EXCL_STOP /**********************************************************************/ /* */ @@ -1309,7 +1297,6 @@ CostMethod::mergeBothLegsBlocking( const CostPtr leftChildCost, // Pointer to computed cost object for this exchange operator. // //============================================================================== -// LCOV_EXCL_START :cnu -- OCM code Cost* CostMethodExchange::computeOperatorCostInternal(RelExpr* op, const Context* myContext, @@ -1796,7 +1783,6 @@ CostMethodExchange::computeExchangeCostGoingDown( const ReqdPhysicalProperty* rp ); } // CostMethodExchange::computeExchangeCostGoingDown -// LCOV_EXCL_STOP //<pb> //============================================================================== // Compute default values needed for costing a specified exchange operator. @@ -1921,7 +1907,6 @@ CostMethodExchange::getDefaultValues( // Number of messages sent down to child. // //============================================================================== -// LCOV_EXCL_START :cnu -- OCM code CostScalar CostMethodExchange::computeDownMessages( const CostScalar& numOfProbes, @@ -4481,7 +4466,6 @@ CostMethodExchange::computeExchangeCost( const CostVecPtr parentFR, return exchangeCost; } // CostMethodExchange::computeExchangeCost() -// LCOV_EXCL_STOP //<pb> /**********************************************************************/ /* */ @@ -4594,24 +4578,20 @@ CostMethodFileScan::computeOperatorCostInternal(RelExpr* op, NABoolean isNestedJoin = ( myContext->getInputLogProp()->getColStats().entries() > 0 ); -// LCOV_EXCL_START // excluded for coverage because DEBUG only code if (CURRSTMT_OPTDEFAULTS->optimizerHeuristic2()) {//#ifndef NDEBUG if (isNestedJoin) (*CURRSTMT_OPTGLOBALS->nestedJoinMonitor).enter(); (*CURRSTMT_OPTGLOBALS->fileScanMonitor).enter(); }//#endif -// LCOV_EXCL_STOP costPtr = scanOptimizer->optimize(searchKeyPtr, /* out */ mdamKeyPtr /* out */); -// LCOV_EXCL_START // excluded for coverage because DEBUG only code if (CURRSTMT_OPTDEFAULTS->optimizerHeuristic2()) {//#ifndef NDEBUG (*CURRSTMT_OPTGLOBALS->fileScanMonitor).exit(); if (isNestedJoin) (*CURRSTMT_OPTGLOBALS->nestedJoinMonitor).exit(); -// LCOV_EXCL_STOP }//#endif // Set blocks per access estimate. Use value from the defaults @@ -4703,7 +4683,6 @@ if (CURRSTMT_OPTDEFAULTS->optimizerHeuristic2()) {//#ifndef NDEBUG // --------------------------------------------------------------------- // For debugging. // --------------------------------------------------------------------- -// LCOV_EXCL_START :dpm // excluded for coverage because DEBUG only code #ifndef NDEBUG if ( CmpCommon::getDefault( OPTIMIZER_PRINT_COST ) == DF_ON ) @@ -4719,7 +4698,6 @@ if (CURRSTMT_OPTDEFAULTS->optimizerHeuristic2()) {//#ifndef NDEBUG fprintf(pfp,"\n"); } #endif -// LCOV_EXCL_STOP // transfer probe counters to p (the FileScan) p->setProbes(scanOptimizer->getProbes()); @@ -4770,7 +4748,6 @@ CostMethodDP2Scan::computeOperatorCostInternal(RelExpr* op, // ----------------------------------------------------------------------- // CostMethodFixedCostPerRow::computeOperatorCostInternal(). // ----------------------------------------------------------------------- -// LCOV_EXCL_START :cnu -- OCM code Cost* CostMethodFixedCostPerRow::computeOperatorCostInternal(RelExpr* op, const Context* myContext, @@ -4887,7 +4864,6 @@ void CostMethodFixedCostPerRow::print(FILE* ofd, fprintf(ofd,"\n "); } // CostMethodFixedCostPerRow::print() -// LCOV_EXCL_STOP //<pb> // ----QUICKSEARCH FOR SORT............................................... @@ -5000,7 +4976,6 @@ void CostMethodSort::cacheParameters(RelExpr* op, // ----------------------------------------------------------------------- // CostMethodSort computeOperatorCost(). // ----------------------------------------------------------------------- -// LCOV_EXCL_START :cnu -- OCM code Cost* CostMethodSort::computeOperatorCostInternal(RelExpr* op, const Context* myContext, @@ -5318,7 +5293,6 @@ CostMethodSort::computeOperatorCostInternal(RelExpr* op, return costPtr; } // CostMethodSort::computeOperatorCostInternal() -// LCOV_EXCL_STOP //<pb> // ----QUICKSEARCH FOR GROUPBY............................................ @@ -6244,7 +6218,6 @@ void CostMethodGroupByAgg::cleanUp() // ----------------------------------------------------------------------- // CostMethodSortGroupBy::computeOperatorCostInternal(). // ----------------------------------------------------------------------- -// LCOV_EXCL_START :cnu -- OCM code Cost* CostMethodSortGroupBy::computeOperatorCostInternal(RelExpr* op, const Context* myContext, @@ -6445,7 +6418,6 @@ CostMethodSortGroupBy::computeOperatorCostInternal(RelExpr* op, return costPtr; } // CostMethodSortGroupBy::computeOperatorCostInternal(). -// LCOV_EXCL_STOP //<pb> // ----QUICKSEARCH FOR HGB................................................ @@ -6550,7 +6522,6 @@ void CostMethodHashGroupBy::cacheParameters(RelExpr* op, // noOfClusters_, which together forms an initial working set of // parameters for computePassCost(). // ----------------------------------------------------------------------- -// LCOV_EXCL_START :cnu -- OCM code void CostMethodHashGroupBy::deriveParameters() { // --------------------------------------------------------------------- @@ -7992,7 +7963,6 @@ CostMethodShortCutGroupBy::computePlanCost( RelExpr* op, return planCost; } // CostMethodShortCutGroupBy::computePlanCost() -// LCOV_EXCL_STOP //<pb> // ----QUICKSEARCH FOR JOIN............................................... @@ -8496,7 +8466,6 @@ void CostMethodJoin::estimateDegreeOfParallelism() // Try to use colstats to estimate row counts for a representative // stream. If that fails, just assume even distribution. // --------------------------------------------------------------- - // LCOV_EXCL_START :cnu // excluded for coverage because below code is disabled if(isColStatsMeaningful_) { @@ -8585,7 +8554,6 @@ void CostMethodJoin::estimateDegreeOfParallelism() // ----------------------------------------------------------- } } - // LCOV_EXCL_STOP else // --------------------------------------------------------------- // $$$ This is always the code path taken right now, since the @@ -8685,7 +8653,6 @@ void CostMethodJoin::estimateDegreeOfParallelism() // actual stream cost of the operation in the cases where there maybe an // inherent uneven distribution of workload across different streams. // ----------------------------------------------------------------------- -// LCOV_EXCL_START :cnu NABoolean CostMethodJoin::computeRepresentativeStream() { // This method needs more refinement and thoughts... @@ -9042,7 +9009,6 @@ NABoolean CostMethodJoin::mergeHistogramsOnEquiJoinPred() return TRUE; } -// LCOV_EXCL_STOP //<pb> // ----------------------------------------------------------------------- // CostMethodJoin::classifyPredicates(). @@ -9350,7 +9316,6 @@ void CostMethodHashJoin::cacheParameters(RelExpr* op, // stages of operation. It assumes both cacheParameters() as well as // estimateDegreeOfParallelism() have been called. // ----------------------------------------------------------------------- -// LCOV_EXCL_START :cnu -- OCM code void CostMethodHashJoin::deriveParameters() { // --------------------------------------------------------------------- @@ -10600,7 +10565,6 @@ CostMethodHashJoin::computeOperatorCostInternal(RelExpr* op, return costPtr; } // CostMethodHashJoin::computeOperatorCostInternal(). -// LCOV_EXCL_STOP // ----------------------------------------------------------------------- // Clean up the cost vectors at various stages. @@ -10674,7 +10638,6 @@ void CostMethodHashJoin::cleanUp() // Pointer to cumulative final cost. // //============================================================================== -// LCOV_EXCL_START :cnu -- OCM code Cost* CostMethodHashJoin::computePlanCost( RelExpr* hashJoinOp, const Context* myContext, @@ -11109,7 +11072,6 @@ SimpleCostVector CostMethodHashJoin::computeNewBlockingCost( E.setNumProbes(parentNumProbes); return E; } // CostMethodHashJoin::computeNewBlockingCost() -// LCOV_EXCL_STOP //<pb> // ----QUICKSEARCH FOR MJ................................................. @@ -11167,7 +11129,6 @@ void CostMethodMergeJoin::cacheParameters(RelExpr* op, // of possible uec's (which is the smaller of the left and right uec's). // // ----------------------------------------------------------------------- -// LCOV_EXCL_START :cnu -- OCM code CostScalar CostMethodMergeJoin::computeIntervalMergingCost( CostScalar child0RowCount, CostScalar child0Uec, @@ -12282,7 +12243,6 @@ CostMethodNestedJoin::mergeBothLegsBlocking( return mergedCost; } //CostMethodNestedJoin::mergeBothLegsBlocking -// LCOV_EXCL_STOP //<pb> // ----------------------------------------------------------------------- // CostMethodNestedJoin::cacheParameters() @@ -12332,7 +12292,6 @@ void CostMethodNestedJoin::cacheParameters(RelExpr* op, // ----------------------------------------------------------------------- // CostMethodNestedJoin::computeOperatorCostInternal() // ----------------------------------------------------------------------- -// LCOV_EXCL_START :cnu -- OCM code Cost* CostMethodNestedJoin::computeOperatorCostInternal(RelExpr* op, const Context* myContext, @@ -12770,7 +12729,6 @@ CostMethodNestedJoinFlow::computeOperatorCostInternal(RelExpr* op, return costPtr; } // CostMethodNestedJoinFlow::computeOperatorCostInternal(). -// LCOV_EXCL_STOP //<pb> // ----QUICKSEARCH FOR MU................................................. @@ -12802,7 +12760,6 @@ void CostMethodMergeUnion::cacheParameters( // ----------------------------------------------------------------------- // CostMethodMergeUnion::computeOperatorCostInternal(). // ----------------------------------------------------------------------- -// LCOV_EXCL_START :cnu -- OCM code Cost* CostMethodMergeUnion::computeOperatorCostInternal(RelExpr* op, const Context* myContext, @@ -13517,7 +13474,6 @@ CostMethodTuple::computeOperatorCostInternal(RelExpr* op, return costPtr; } // CostMethodTuple::computeOperatorCostInternal(). -// LCOV_EXCL_STOP //<pb> /**********************************************************************/ @@ -13586,7 +13542,6 @@ CostMethodTranspose::cacheParameters(RelExpr *op, // long& countOfStreams // OUT - Estimated degree of parallelism for returned preliminary cost. // -// LCOV_EXCL_START :cnu -- OCM code Cost * CostMethodTranspose::computeOperatorCostInternal(RelExpr *op, const Context *myContext, @@ -13645,7 +13600,6 @@ CostMethodTranspose::computeOperatorCostInternal(RelExpr *op, } // CostMethodTranspose::computeOperatorCostInternal() -// LCOV_EXCL_STOP /**********************************************************************/ /* */ @@ -13685,7 +13639,6 @@ CostMethodCompoundStmt::cacheParameters(RelExpr *op, // Context *myContext // IN - The optimization context within which to cost this node. //------------------------------------------------------------------------- -// LCOV_EXCL_START :cnu -- OCM code Cost * CostMethodCompoundStmt::computeOperatorCostInternal(RelExpr *op, const Context *myContext, @@ -13903,7 +13856,6 @@ CostMethodTableMappingUDF::computeOperatorCostInternal(RelExpr* op, fragmentsPerCPU ); } -// LCOV_EXCL_STOP /**********************************************************************/ /* */ @@ -14239,7 +14191,6 @@ CostMethodUnPackRows::cacheParameters(RelExpr *op, // long& countOfStreams // OUT - Estimated degree of parallelism for returned preliminary cost. // -// LCOV_EXCL_START :cnu -- OCM code Cost * CostMethodUnPackRows::computeOperatorCostInternal(RelExpr *op, const Context *myContext, @@ -14297,7 +14248,6 @@ CostMethodUnPackRows::computeOperatorCostInternal(RelExpr *op, Cost(&cvFirstRow, &cvLastRow, NULL, cpuCount, fragmentsPerCPU); } // CostMethodUnPackRows::computeOperatorCostInternal() -// LCOV_EXCL_STOP /**********************************************************************/ /* */ @@ -14363,7 +14313,6 @@ CostMethodRelSequence::cacheParameters(RelExpr *op, // long& countOfStreams // OUT - Estimated degree of parallelism for returned preliminary cost. // -// LCOV_EXCL_START :cnu -- OCM code Cost * CostMethodRelSequence::computeOperatorCostInternal(RelExpr *op, const Context *myContext, @@ -14758,7 +14707,6 @@ CostMethodIsolatedScalarUDF::computeOperatorCostInternal(RelExpr* op, return costPtr; } // CostMethodIsolatedScalarUDF::computeOperatorCostInternal(). -// LCOV_EXCL_STOP //<pb> http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/7a95e1da/core/sql/optimizer/disjunct.h ---------------------------------------------------------------------- diff --git a/core/sql/optimizer/disjunct.h b/core/sql/optimizer/disjunct.h index 48b8d8f..5df2271 100644 --- a/core/sql/optimizer/disjunct.h +++ b/core/sql/optimizer/disjunct.h @@ -69,12 +69,10 @@ public: // const functions: NABoolean isEmpty() const {return disjunct_.isEmpty(); } - // LCOV_EXCL_START :dpm virtual void print( FILE* ofd = stdout, const char* indent = DEFAULT_INDENT, const char* title = "disjunct") const { disjunct_.print(ofd,indent,title); } - // LCOV_EXCL_STOP const ValueIdSet& getAsValueIdSet() const { return disjunct_; }
