1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

Fully resolve potentially ambiguous symbols by removing using namespace statements from headers which have a cascading effect. This causes potential behavior changes when switching to c++11 since symbols can be exported from std and boost while both have been imported into the global namespace.

This commit is contained in:
David Mott
2019-04-26 08:21:47 -05:00
parent 1813add162
commit 4b9d046c6e
131 changed files with 600 additions and 630 deletions

View File

@ -321,7 +321,7 @@ void BRMReporter::sendCPToFile( )
void BRMReporter::reportTotals(
uint64_t totalReadRows,
uint64_t totalInsertedRows,
const std::vector<boost::tuple<CalpontSystemCatalog::ColDataType, uint64_t, uint64_t> >& satCounts)
const std::vector<boost::tuple<execplan::CalpontSystemCatalog::ColDataType, uint64_t, uint64_t> >& satCounts)
{
if (fRptFile.is_open())
{

View File

@ -28,7 +28,6 @@
#include "brmtypes.h"
#include "calpontsystemcatalog.h"
using namespace execplan;
/** @file
* class BRMReporter
*/
@ -107,7 +106,7 @@ public:
*/
void reportTotals(uint64_t totalReadRows,
uint64_t totalInsertedRows,
const std::vector<boost::tuple<CalpontSystemCatalog::ColDataType,
const std::vector<boost::tuple<execplan::CalpontSystemCatalog::ColDataType,
uint64_t, uint64_t> >& satCounts);
/** @brief Generate report for job that exceeds error limit

View File

@ -473,7 +473,7 @@ int BulkLoad::preProcess( Job& job, int tableNo,
int rc = NO_ERROR, minWidth = 9999; // give a big number
HWM minHWM = 999999; // rp 9/25/07 Bug 473
ColStruct curColStruct;
CalpontSystemCatalog::ColDataType colDataType;
execplan::CalpontSystemCatalog::ColDataType colDataType;
// Initialize portions of TableInfo object
tableInfo->setBufferSize(fBufferSize);

View File

@ -957,7 +957,7 @@ void TableInfo::reportTotals(double elapsedTime)
fLog->logMsg(oss2.str(), MSGLVL_INFO2);
// @bug 3504: Loop through columns to print saturation counts
std::vector<boost::tuple<CalpontSystemCatalog::ColDataType, uint64_t, uint64_t> > satCounts;
std::vector<boost::tuple<execplan::CalpontSystemCatalog::ColDataType, uint64_t, uint64_t> > satCounts;
for (unsigned i = 0; i < fColumns.size(); ++i)
{
@ -977,30 +977,28 @@ void TableInfo::reportTotals(double elapsedTime)
ossSatCnt << "Column " << fTableName << '.' <<
fColumns[i].column.colName << "; Number of ";
if (fColumns[i].column.dataType == CalpontSystemCatalog::DATE)
if (fColumns[i].column.dataType == execplan::CalpontSystemCatalog::DATE)
{
ossSatCnt <<
"invalid dates replaced with zero value : ";
}
else if (fColumns[i].column.dataType ==
CalpontSystemCatalog::DATETIME)
execplan::CalpontSystemCatalog::DATETIME)
{
//bug5383
ossSatCnt <<
"invalid date/times replaced with zero value : ";
}
else if (fColumns[i].column.dataType == CalpontSystemCatalog::TIME)
else if (fColumns[i].column.dataType == execplan::CalpontSystemCatalog::TIME)
{
ossSatCnt <<
"invalid times replaced with zero value : ";
}
else if (fColumns[i].column.dataType == CalpontSystemCatalog::CHAR)
ossSatCnt <<
"character strings truncated: ";
else if (fColumns[i].column.dataType ==
CalpontSystemCatalog::VARCHAR)
else if (fColumns[i].column.dataType == execplan::CalpontSystemCatalog::CHAR)
ossSatCnt <<
"character strings truncated: ";
else if (fColumns[i].column.dataType == execplan::CalpontSystemCatalog::VARCHAR)
ossSatCnt << "character strings truncated: ";
else
ossSatCnt <<
"rows inserted with saturated values: ";

View File

@ -31,11 +31,9 @@
#include <fstream>
#include <iostream>
using namespace std;
#include "bytestream.h"
#include "messagequeue.h"
using namespace messageqcpp;
/*
*

View File

@ -67,7 +67,7 @@ public:
void str2Argv(std::string CmdLine, std::vector<char*>& V);
std::string getCalpontHome();
std::string getPrgmPath(std::string& PrgmName);
void updateCmdLineWithPath(string& CmdLine);
void updateCmdLineWithPath(std::string& CmdLine);
public:
@ -179,8 +179,8 @@ private:
SplitterReadThread& fRef;
int fMode;
ofstream fDataDumpFile;
ofstream fJobFile;
std::ofstream fDataDumpFile;
std::ofstream fJobFile;
unsigned int fTxBytes;
unsigned int fRxBytes;
char fPmId;

View File

@ -51,11 +51,7 @@
#define EXPORT
#endif
using namespace std;
using namespace execplan;
#include <boost/algorithm/string/case_conv.hpp>
using namespace boost::algorithm;
template <class T>
bool from_string(T& t,
@ -72,7 +68,7 @@ struct DDLColumn
{
execplan::CalpontSystemCatalog::OID oid;
execplan::CalpontSystemCatalog::ColType colType;
execplan:: CalpontSystemCatalog::TableColName tableColName;
execplan::CalpontSystemCatalog::TableColName tableColName;
};
typedef std::vector<DDLColumn> ColumnList;
@ -104,23 +100,23 @@ inline void getColumnsForTable(uint32_t sessionID, std::string schema, std::str
ColumnList& colList)
{
CalpontSystemCatalog::TableName tableName;
execplan::CalpontSystemCatalog::TableName tableName;
tableName.schema = schema;
tableName.table = table;
std::string err;
try
{
boost::shared_ptr<CalpontSystemCatalog> systemCatalogPtr = CalpontSystemCatalog::makeCalpontSystemCatalog(sessionID);
systemCatalogPtr->identity(CalpontSystemCatalog::EC);
boost::shared_ptr<execplan::CalpontSystemCatalog> systemCatalogPtr = execplan::CalpontSystemCatalog::makeCalpontSystemCatalog(sessionID);
systemCatalogPtr->identity(execplan::CalpontSystemCatalog::EC);
const CalpontSystemCatalog::RIDList ridList = systemCatalogPtr->columnRIDs(tableName);
const execplan::CalpontSystemCatalog::RIDList ridList = systemCatalogPtr->columnRIDs(tableName);
CalpontSystemCatalog::RIDList::const_iterator rid_iterator = ridList.begin();
execplan::CalpontSystemCatalog::RIDList::const_iterator rid_iterator = ridList.begin();
while (rid_iterator != ridList.end())
{
CalpontSystemCatalog::ROPair roPair = *rid_iterator;
execplan::CalpontSystemCatalog::ROPair roPair = *rid_iterator;
DDLColumn column;
column.oid = roPair.objnum;
@ -381,112 +377,112 @@ inline int convertDataType(int dataType)
switch (dataType)
{
case ddlpackage::DDL_CHAR:
calpontDataType = CalpontSystemCatalog::CHAR;
calpontDataType = execplan::CalpontSystemCatalog::CHAR;
break;
case ddlpackage::DDL_VARCHAR:
calpontDataType = CalpontSystemCatalog::VARCHAR;
calpontDataType = execplan::CalpontSystemCatalog::VARCHAR;
break;
case ddlpackage::DDL_VARBINARY:
calpontDataType = CalpontSystemCatalog::VARBINARY;
calpontDataType = execplan::CalpontSystemCatalog::VARBINARY;
break;
case ddlpackage::DDL_BIT:
calpontDataType = CalpontSystemCatalog::BIT;
calpontDataType = execplan::CalpontSystemCatalog::BIT;
break;
case ddlpackage::DDL_REAL:
case ddlpackage::DDL_DECIMAL:
case ddlpackage::DDL_NUMERIC:
case ddlpackage::DDL_NUMBER:
calpontDataType = CalpontSystemCatalog::DECIMAL;
calpontDataType = execplan::CalpontSystemCatalog::DECIMAL;
break;
case ddlpackage::DDL_FLOAT:
calpontDataType = CalpontSystemCatalog::FLOAT;
calpontDataType = execplan::CalpontSystemCatalog::FLOAT;
break;
case ddlpackage::DDL_DOUBLE:
calpontDataType = CalpontSystemCatalog::DOUBLE;
calpontDataType = execplan::CalpontSystemCatalog::DOUBLE;
break;
case ddlpackage::DDL_INT:
case ddlpackage::DDL_INTEGER:
calpontDataType = CalpontSystemCatalog::INT;
calpontDataType = execplan::CalpontSystemCatalog::INT;
break;
case ddlpackage::DDL_BIGINT:
calpontDataType = CalpontSystemCatalog::BIGINT;
calpontDataType = execplan::CalpontSystemCatalog::BIGINT;
break;
case ddlpackage::DDL_MEDINT:
calpontDataType = CalpontSystemCatalog::MEDINT;
calpontDataType = execplan::CalpontSystemCatalog::MEDINT;
break;
case ddlpackage::DDL_SMALLINT:
calpontDataType = CalpontSystemCatalog::SMALLINT;
calpontDataType = execplan::CalpontSystemCatalog::SMALLINT;
break;
case ddlpackage::DDL_TINYINT:
calpontDataType = CalpontSystemCatalog::TINYINT;
calpontDataType = execplan::CalpontSystemCatalog::TINYINT;
break;
case ddlpackage::DDL_DATE:
calpontDataType = CalpontSystemCatalog::DATE;
calpontDataType = execplan::CalpontSystemCatalog::DATE;
break;
case ddlpackage::DDL_DATETIME:
calpontDataType = CalpontSystemCatalog::DATETIME;
calpontDataType = execplan::CalpontSystemCatalog::DATETIME;
break;
case ddlpackage::DDL_TIME:
calpontDataType = CalpontSystemCatalog::TIME;
calpontDataType = execplan::CalpontSystemCatalog::TIME;
break;
case ddlpackage::DDL_CLOB:
calpontDataType = CalpontSystemCatalog::CLOB;
calpontDataType = execplan::CalpontSystemCatalog::CLOB;
break;
case ddlpackage::DDL_BLOB:
calpontDataType = CalpontSystemCatalog::BLOB;
calpontDataType = execplan::CalpontSystemCatalog::BLOB;
break;
case ddlpackage::DDL_TEXT:
calpontDataType = CalpontSystemCatalog::TEXT;
calpontDataType = execplan::CalpontSystemCatalog::TEXT;
break;
case ddlpackage::DDL_UNSIGNED_TINYINT:
calpontDataType = CalpontSystemCatalog::UTINYINT;
calpontDataType = execplan::CalpontSystemCatalog::UTINYINT;
break;
case ddlpackage::DDL_UNSIGNED_SMALLINT:
calpontDataType = CalpontSystemCatalog::USMALLINT;
calpontDataType = execplan::CalpontSystemCatalog::USMALLINT;
break;
case ddlpackage::DDL_UNSIGNED_MEDINT:
calpontDataType = CalpontSystemCatalog::UMEDINT;
calpontDataType = execplan::CalpontSystemCatalog::UMEDINT;
break;
case ddlpackage::DDL_UNSIGNED_INT:
calpontDataType = CalpontSystemCatalog::UINT;
calpontDataType = execplan::CalpontSystemCatalog::UINT;
break;
case ddlpackage::DDL_UNSIGNED_BIGINT:
calpontDataType = CalpontSystemCatalog::UBIGINT;
calpontDataType = execplan::CalpontSystemCatalog::UBIGINT;
break;
case ddlpackage::DDL_UNSIGNED_DECIMAL:
case ddlpackage::DDL_UNSIGNED_NUMERIC:
calpontDataType = CalpontSystemCatalog::UDECIMAL;
calpontDataType = execplan::CalpontSystemCatalog::UDECIMAL;
break;
case ddlpackage::DDL_UNSIGNED_FLOAT:
calpontDataType = CalpontSystemCatalog::UFLOAT;
calpontDataType = execplan::CalpontSystemCatalog::UFLOAT;
break;
case ddlpackage::DDL_UNSIGNED_DOUBLE:
calpontDataType = CalpontSystemCatalog::UDOUBLE;
calpontDataType = execplan::CalpontSystemCatalog::UDOUBLE;
break;
default:

View File

@ -31,7 +31,6 @@
#define OBSERVER_H_
#include <list>
using namespace std;
namespace WriteEngine

View File

@ -651,7 +651,7 @@ void SplitterReadThread::operator()()
catch (...)
{
fIbs.restart(); //setting length=0, get out of loop
cout << "Broken Pipe" << endl;
std::cout << "Broken Pipe" << std::endl;
logging::LoggingID logid(19, 0, 0);
logging::Message::Args args;
@ -889,7 +889,7 @@ void ReadThreadFactory::CreateReadThread(ThreadPool& Tp, IOSocket& Ios, BRM::DBR
}
catch (std::exception& ex)
{
cout << "Handled : " << ex.what() << endl;
std::cout << "Handled : " << ex.what() << std::endl;
logging::LoggingID logid(19, 0, 0);
logging::Message::Args args;
logging::Message msg(1);

View File

@ -27,7 +27,6 @@
#include "messagequeue.h"
#include "threadpool.h"
#include "we_ddlcommandproc.h"
using namespace threadpool;
#include "we_ddlcommandproc.h"
#include "we_dmlcommandproc.h"
@ -149,7 +148,7 @@ public:
virtual ~ReadThreadFactory() {}
public:
static void CreateReadThread(ThreadPool& Tp, IOSocket& ios, BRM::DBRM& dbrm);
static void CreateReadThread(threadpool::ThreadPool& Tp, IOSocket& ios, BRM::DBRM& dbrm);
};

View File

@ -512,13 +512,13 @@ bool WEBrmUpdater::prepareRowsInsertedInfo(std::string Entry,
bool WEBrmUpdater::prepareColumnOutOfRangeInfo(std::string Entry,
int& ColNum,
CalpontSystemCatalog::ColDataType& ColType,
execplan::CalpontSystemCatalog::ColDataType& ColType,
std::string& ColName,
int& OorValues)
{
bool aFound = false;
boost::shared_ptr<CalpontSystemCatalog> systemCatalogPtr =
CalpontSystemCatalog::makeCalpontSystemCatalog();
boost::shared_ptr<execplan::CalpontSystemCatalog> systemCatalogPtr =
execplan::CalpontSystemCatalog::makeCalpontSystemCatalog();
//DATA: 3 1
if ((!Entry.empty()) && (Entry.at(0) == 'D'))
@ -553,7 +553,7 @@ bool WEBrmUpdater::prepareColumnOutOfRangeInfo(std::string Entry,
if (pTok)
{
ColType = (CalpontSystemCatalog::ColDataType)atoi(pTok);
ColType = (execplan::CalpontSystemCatalog::ColDataType)atoi(pTok);
}
else
{
@ -566,7 +566,7 @@ bool WEBrmUpdater::prepareColumnOutOfRangeInfo(std::string Entry,
if (pTok)
{
uint64_t columnOid = strtol(pTok, NULL, 10);
CalpontSystemCatalog::TableColName colname = systemCatalogPtr->colName(columnOid);
execplan::CalpontSystemCatalog::TableColName colname = systemCatalogPtr->colName(columnOid);
ColName = colname.schema + "." + colname.table + "." + colname.column;
}
else

View File

@ -68,7 +68,7 @@ public:
static bool prepareRowsInsertedInfo(std::string Entry, int64_t& TotRows,
int64_t& InsRows);
static bool prepareColumnOutOfRangeInfo(std::string Entry, int& ColNum,
CalpontSystemCatalog::ColDataType& ColType,
execplan::CalpontSystemCatalog::ColDataType& ColType,
std::string& ColName, int& OorValues);
static bool prepareErrorFileInfo(std::string Entry, std::string& ErrFileName);
static bool prepareBadDataFileInfo(std::string Entry, std::string& BadFileName);

View File

@ -233,7 +233,7 @@ public:
fWeSplClients[PmId]->setRowsUploadInfo(RowsRead, RowsInserted);
}
void add2ColOutOfRangeInfo(int PmId, int ColNum,
CalpontSystemCatalog::ColDataType ColType,
execplan::CalpontSystemCatalog::ColDataType ColType,
std::string& ColName, int NoOfOors)
{
fWeSplClients[PmId]->add2ColOutOfRangeInfo(ColNum, ColType, ColName, NoOfOors);
@ -326,7 +326,7 @@ private:
{
fRowsIns += Rows;
}
void updateColOutOfRangeInfo(int aColNum, CalpontSystemCatalog::ColDataType aColType,
void updateColOutOfRangeInfo(int aColNum, execplan::CalpontSystemCatalog::ColDataType aColType,
std::string aColName, int aNoOfOors)
{
WEColOorVec::iterator aIt = fColOorVec.begin();

View File

@ -453,7 +453,7 @@ void WESplClient::setRowsUploadInfo(int64_t RowsRead, int64_t RowsInserted)
//------------------------------------------------------------------------------
void WESplClient::add2ColOutOfRangeInfo(int ColNum,
CalpontSystemCatalog::ColDataType ColType,
execplan::CalpontSystemCatalog::ColDataType ColType,
std::string& ColName, int NoOfOors)
{
WEColOORInfo aColOorInfo;

View File

@ -35,7 +35,6 @@
#include "we_messages.h"
#include "calpontsystemcatalog.h"
using namespace execplan;
namespace WriteEngine
{
@ -47,11 +46,11 @@ class WESplClient; //forward decleration
class WEColOORInfo // Column Out-Of-Range Info
{
public:
WEColOORInfo(): fColNum(0), fColType(CalpontSystemCatalog::INT), fNoOfOORs(0) {}
WEColOORInfo(): fColNum(0), fColType(execplan::CalpontSystemCatalog::INT), fNoOfOORs(0) {}
~WEColOORInfo() {}
public:
int fColNum;
CalpontSystemCatalog::ColDataType fColType;
execplan::CalpontSystemCatalog::ColDataType fColType;
std::string fColName;
int fNoOfOORs;
};
@ -390,8 +389,7 @@ private:
std::string fErrInfoFile;
void setRowsUploadInfo(int64_t RowsRead, int64_t RowsInserted);
void add2ColOutOfRangeInfo(int ColNum,
CalpontSystemCatalog::ColDataType ColType,
void add2ColOutOfRangeInfo(int ColNum, execplan::CalpontSystemCatalog::ColDataType ColType,
std::string& ColName, int NoOfOors);
void setBadDataFile(const std::string& BadDataFile);
void setErrInfoFile(const std::string& ErrInfoFile);

View File

@ -249,8 +249,8 @@ void WESplitterApp::processMessages()
{
try
{
aBs << (ByteStream::byte) WE_CLT_SRV_MODE;
aBs << (ByteStream::quadbyte) fCmdArgs.getMode();
aBs << (messageqcpp::ByteStream::byte) WE_CLT_SRV_MODE;
aBs << (messageqcpp::ByteStream::quadbyte) fCmdArgs.getMode();
fDh.send2Pm(aBs);
std::string aJobId = fCmdArgs.getJobId();
@ -268,7 +268,7 @@ void WESplitterApp::processMessages()
if (fDh.getDebugLvl())
cout << "CPImport cmd line - " << aCpImpCmd << endl;
aBs << (ByteStream::byte) WE_CLT_SRV_CMDLINEARGS;
aBs << (messageqcpp::ByteStream::byte) WE_CLT_SRV_CMDLINEARGS;
aBs << aCpImpCmd;
fDh.send2Pm(aBs);
@ -278,7 +278,7 @@ void WESplitterApp::processMessages()
if (fDh.getDebugLvl())
cout << "BrmReport FileName - " << aBrmRpt << endl;
aBs << (ByteStream::byte) WE_CLT_SRV_BRMRPT;
aBs << (messageqcpp::ByteStream::byte) WE_CLT_SRV_BRMRPT;
aBs << aBrmRpt;
fDh.send2Pm(aBs);
@ -297,8 +297,8 @@ void WESplitterApp::processMessages()
{
// In this mode we ignore almost all cmd lines args which
// are usually send to cpimport
aBs << (ByteStream::byte) WE_CLT_SRV_MODE;
aBs << (ByteStream::quadbyte) fCmdArgs.getMode();
aBs << (messageqcpp::ByteStream::byte) WE_CLT_SRV_MODE;
aBs << (messageqcpp::ByteStream::quadbyte) fCmdArgs.getMode();
fDh.send2Pm(aBs);
std::string aJobId = fCmdArgs.getJobId();
@ -323,7 +323,7 @@ void WESplitterApp::processMessages()
if (fDh.getDebugLvl())
cout << "CPImport cmd line - " << aCpImpCmd << endl;
aBs << (ByteStream::byte) WE_CLT_SRV_CMDLINEARGS;
aBs << (messageqcpp::ByteStream::byte) WE_CLT_SRV_CMDLINEARGS;
aBs << aCpImpCmd;
fDh.send2Pm(aBs);
@ -333,7 +333,7 @@ void WESplitterApp::processMessages()
if (fDh.getDebugLvl())
cout << "BrmReport FileName - " << aBrmRpt << endl;
aBs << (ByteStream::byte) WE_CLT_SRV_BRMRPT;
aBs << (messageqcpp::ByteStream::byte) WE_CLT_SRV_BRMRPT;
aBs << aBrmRpt;
fDh.send2Pm(aBs);
@ -352,8 +352,8 @@ void WESplitterApp::processMessages()
{
// In this mode we ignore almost all cmd lines args which
// are usually send to cpimport
aBs << (ByteStream::byte) WE_CLT_SRV_MODE;
aBs << (ByteStream::quadbyte) fCmdArgs.getMode();
aBs << (messageqcpp::ByteStream::byte) WE_CLT_SRV_MODE;
aBs << (messageqcpp::ByteStream::quadbyte) fCmdArgs.getMode();
fDh.send2Pm(aBs);
aBs.restart();
@ -373,7 +373,7 @@ void WESplitterApp::processMessages()
if (fDh.getDebugLvl())
cout << "CPImport FileName - " << aCpImpFileName << endl;
aBs << (ByteStream::byte) WE_CLT_SRV_IMPFILENAME;
aBs << (messageqcpp::ByteStream::byte) WE_CLT_SRV_IMPFILENAME;
aBs << aCpImpFileName;
fDh.send2Pm(aBs);
}
@ -450,8 +450,8 @@ void WESplitterApp::processMessages()
if (aNoSec < 10) aNoSec++; //progressively go up to 10Sec interval
aBs.restart();
aBs << (ByteStream::byte) WE_CLT_SRV_KEEPALIVE;
mutex::scoped_lock aLock(fDh.fSendMutex);
aBs << (messageqcpp::ByteStream::byte) WE_CLT_SRV_KEEPALIVE;
boost::mutex::scoped_lock aLock(fDh.fSendMutex);
fDh.send2Pm(aBs);
aLock.unlock();
//fDh.sendHeartbeats();
@ -633,7 +633,7 @@ int main(int argc, char** argv)
errMsgArgs.add(err);
aWESplitterApp.fpSysLog->logMsg(errMsgArgs, logging::LOG_TYPE_ERROR, logging::M0000);
SPLTR_EXIT_STATUS = 1;
aWESplitterApp.fDh.fLog.logMsg( err, MSGLVL_ERROR );
aWESplitterApp.fDh.fLog.logMsg( err, WriteEngine::MSGLVL_ERROR );
aWESplitterApp.fContinue = false;
//throw runtime_error(err); BUG 4298
}

View File

@ -32,15 +32,12 @@
#include <boost/thread/condition.hpp>
#include <boost/scoped_array.hpp>
#include <boost/thread.hpp>
using namespace boost;
#include "bytestream.h"
using namespace messageqcpp;
#include "we_cmdargs.h"
#include "we_sdhandler.h"
#include "we_simplesyslog.h"
using namespace WriteEngine;
namespace WriteEngine
{