[TRAFODION-2768] Make Trafodion code base to compile in RH7 The earlier commit ec9ec17 was used to build Trafodion in RH7 system. This change fixes the compilation errors seen in such a build. But, there are still some unresoled references in RH7 that need to be addressed.
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/cd3f2303 Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/cd3f2303 Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/cd3f2303 Branch: refs/heads/master Commit: cd3f230300e4b5e44e65cd437c225d8a555ea9c5 Parents: ec9ec17 Author: selvaganesang <[email protected]> Authored: Tue Oct 10 05:50:24 2017 +0000 Committer: selvaganesang <[email protected]> Committed: Tue Oct 10 05:50:24 2017 +0000 ---------------------------------------------------------------------- core/sqf/src/tm/tm.cpp | 6 +++++- core/sql/common/Collections.h | 6 +++--- core/sql/executor/ExExeUtilLoad.cpp | 14 +++++++------- core/sql/exp/exp_expr.h | 2 +- core/sql/optimizer/BindRelExpr.cpp | 2 +- core/sql/optimizer/ClusteredBitmap.cpp | 2 +- core/sql/sqlcomp/CmpSeabaseDDLtable.cpp | 4 ++-- core/sql/ustat/hs_faststats.h | 6 +++++- core/sql/ustat/hs_globals.cpp | 6 +++++- 9 files changed, 30 insertions(+), 18 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd3f2303/core/sqf/src/tm/tm.cpp ---------------------------------------------------------------------- diff --git a/core/sqf/src/tm/tm.cpp b/core/sqf/src/tm/tm.cpp index a168db5..e812cab 100644 --- a/core/sqf/src/tm/tm.cpp +++ b/core/sqf/src/tm/tm.cpp @@ -460,9 +460,13 @@ void tm_process_req_requestregioninfo(CTmTxMessage * pp_msg) TM_Txid_legacy lv_transid; } u; - char tname[2000], ername[50], rname[100], offline[20], regid[200], hostname[200], port[100]; + char tname[2000]; + tname[299] = '\0'; +/* + char ername[50], rname[100], offline[20], regid[200], hostname[200], port[100]; tname[299] = '\0', ername[49] = '\0', rname[99] = '\0', offline[19] = '\0'; regid[199]= '\0', hostname[199]='\0', port[99]='\0'; +*/ TMTrace(2, ("tm_process_req_requestregioninfo ENTRY.\n")); HashMapArray* map = HbaseTM_process_request_regions_info(); http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd3f2303/core/sql/common/Collections.h ---------------------------------------------------------------------- diff --git a/core/sql/common/Collections.h b/core/sql/common/Collections.h index a11edb2..c8f6f1b 100644 --- a/core/sql/common/Collections.h +++ b/core/sql/common/Collections.h @@ -1953,7 +1953,7 @@ public: NABoolean operator ==(const NAList<T> &other) const; // insert a new entry - inline void insert(const T &elem) { insertAt(this->entries(),elem); } + inline void insert(const T &elem) { this->insertAt(this->entries(),elem); } // insert a set, array, or list // void insert(const SET(T) &other); @@ -2341,7 +2341,7 @@ public: void append( T newItem) { - insertAt( entries(), newItem); + this->insertAt( entries(), newItem); } CollIndex entries() const @@ -2907,7 +2907,7 @@ public: inline V* get(const K* kk) const // retrieve a tuple { - return getFirstValue(kk); + return this->getFirstValue(kk); } inline void insert(const V* vv) // insert a tuple http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd3f2303/core/sql/executor/ExExeUtilLoad.cpp ---------------------------------------------------------------------- diff --git a/core/sql/executor/ExExeUtilLoad.cpp b/core/sql/executor/ExExeUtilLoad.cpp index cef633e..581fda4 100644 --- a/core/sql/executor/ExExeUtilLoad.cpp +++ b/core/sql/executor/ExExeUtilLoad.cpp @@ -2130,7 +2130,7 @@ short ExExeUtilHBaseBulkUnLoadTcb::getTrafodionScanTables() } tbls->position(); - for (int idx = 0; idx < tbls->numEntries(); idx++) + for (int ii = 0; ii < tbls->numEntries(); ii++) { OutputInfo * idx = (OutputInfo*) tbls->getNext(); snapshotStruct * snap = new (getMyHeap()) snapshotStruct(); @@ -2715,14 +2715,14 @@ ExExeUtilLobExtractTcb::ExExeUtilLobExtractTcb getGlobals()->castToExExeStmtGlobals()->castToExMasterStmtGlobals()-> getStatement()->getContext(); lobHandleLen_ = 2050; - lobHandle_ = {0}; + lobHandle_[0] = '\0'; - lobInputHandleBuf_={0}; + lobInputHandleBuf_[0] = '\0'; - lobNameBuf_= {0}; + lobNameBuf_[0] = '\0'; lobNameLen_ =1024; lobName_ = NULL; - statusString_ = {0}; + statusString_[0] = '\0'; lobType_ = 0; lobData_= NULL; @@ -2737,7 +2737,7 @@ ExExeUtilLobExtractTcb::ExExeUtilLobExtractTcb numChildRows_ = 0; requestTag_ = -1; - lobLoc_ = {0}; + lobLoc_[0] = '\0'; lobGlobals_ = new(currContext->exHeap()) LOBglobals(currContext->exHeap()); @@ -3483,7 +3483,7 @@ ExExeUtilLobUpdateTcb::ExExeUtilLobUpdateTcb getGlobals()->castToExExeStmtGlobals()->castToExMasterStmtGlobals()-> getStatement()->getContext(); lobHandleLen_ = 2050; - lobHandle_ = {0}; + lobHandle_[0] = '\0'; lobGlobals_ = new(currContext->exHeap()) LOBglobals(currContext->exHeap()); ExpLOBoper::initLOBglobal http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd3f2303/core/sql/exp/exp_expr.h ---------------------------------------------------------------------- diff --git a/core/sql/exp/exp_expr.h b/core/sql/exp/exp_expr.h index 72af3a1..6bbd6b0 100644 --- a/core/sql/exp/exp_expr.h +++ b/core/sql/exp/exp_expr.h @@ -919,7 +919,7 @@ public: ComSpace * space = 0, CollHeap * exHeap = 0, NABoolean computeSpaceOnly = FALSE, - ex_globals * glob = FALSE); + ex_globals * glob = NULL); virtual void displayContents(ComSpace * space, short mode, const char * displayStr, ULng32 flag); http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd3f2303/core/sql/optimizer/BindRelExpr.cpp ---------------------------------------------------------------------- diff --git a/core/sql/optimizer/BindRelExpr.cpp b/core/sql/optimizer/BindRelExpr.cpp index 68415d3..bb40e55 100644 --- a/core/sql/optimizer/BindRelExpr.cpp +++ b/core/sql/optimizer/BindRelExpr.cpp @@ -10647,7 +10647,7 @@ RelExpr *Insert::bindNode(BindWA *bindWA) const NATable* naTable = getTableDesc()->getNATable(); if (naTable->hasLobColumn()) { - NAColumn *nac; + NAColumn *nac = NULL; for (CollIndex c = 0; c < naTable->getColumnCount(); c++) { nac = naTable->getNAColumnArray()[c]; http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd3f2303/core/sql/optimizer/ClusteredBitmap.cpp ---------------------------------------------------------------------- diff --git a/core/sql/optimizer/ClusteredBitmap.cpp b/core/sql/optimizer/ClusteredBitmap.cpp index 8c75b3f..2a58060 100644 --- a/core/sql/optimizer/ClusteredBitmap.cpp +++ b/core/sql/optimizer/ClusteredBitmap.cpp @@ -408,7 +408,7 @@ ClusteredBitmap::findEqualOrGreaterBitmapMap(UInt32 sigBits) const Int32 low = 0; Int32 high = numBitmaps_ - 1; Int32 middle; - bitsToBitmap *map; + bitsToBitmap *map = NULL; while (low <= high) { http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd3f2303/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp ---------------------------------------------------------------------- diff --git a/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp b/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp index c456b01..cef2fa1 100644 --- a/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp +++ b/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp @@ -10637,10 +10637,10 @@ short CmpSeabaseDDL::unregisterHiveViewUsage(StmtDDLCreateView * createViewParse } // save the current parserflags setting - ULng32 savedCliParserFlags; + ULng32 savedCliParserFlags = 0;; SQL_EXEC_GetParserFlagsForExSqlComp_Internal(savedCliParserFlags_); SQL_EXEC_SetParserFlagsForExSqlComp_Internal(INTERNAL_QUERY_FROM_EXEUTIL); - + usedObjUID = naTable->objectUid().get_value(); str_sprintf(query, "delete from %s.\"%s\".%s where using_view_uid = %ld and used_object_uid = %ld", getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_VIEWS_USAGE, http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd3f2303/core/sql/ustat/hs_faststats.h ---------------------------------------------------------------------- diff --git a/core/sql/ustat/hs_faststats.h b/core/sql/ustat/hs_faststats.h index 6634b82..1ecea81 100644 --- a/core/sql/ustat/hs_faststats.h +++ b/core/sql/ustat/hs_faststats.h @@ -112,7 +112,11 @@ public: // @ZXbl -- temporary value used for sample rate (needed to estimate uec/rc). // This needs to be changed to come from the sample rate used when // the sample table is created during bulk load. +#if __GNUC_MINOR__ == 8 + static constexpr double SAMPLE_RATE = .01; +#else static const double SAMPLE_RATE = .01; +#endif void addRowset(Lng32 numRows); void actuate(Lng32 numIntervals); @@ -173,7 +177,7 @@ public: void append(KeyFreqPair<T>& x) { - insertAt(this->entries(), x); + this->insertAt(this->entries(), x); freqCount_ += x.freq; } http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd3f2303/core/sql/ustat/hs_globals.cpp ---------------------------------------------------------------------- diff --git a/core/sql/ustat/hs_globals.cpp b/core/sql/ustat/hs_globals.cpp index 58d2af1..ed833fd 100644 --- a/core/sql/ustat/hs_globals.cpp +++ b/core/sql/ustat/hs_globals.cpp @@ -13565,8 +13565,12 @@ Int32 HSGlobalsClass::estimateAndTestIUSStats(HSColGroupStruct* group, // Use the oldUec if estimatedUec is nan. This is to work around // the nan value produced by lwcUecEstimate() above. - + +#if __GNUC_MINOR__ == 8 + if ( std::isnan(estIntvlUEC) ) +#else if ( isnan(estIntvlUEC) ) +#endif estIntvlUEC = oldUec; // cap the new UEC with the RC
