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

Merge branch 'develop-1.2' into develop-merge-up-20190514

This commit is contained in:
Andrew Hutchings
2019-05-14 13:58:33 +01:00
83 changed files with 469 additions and 638 deletions

View File

@ -40,7 +40,10 @@ FileBuffer::FileBuffer() : fDataLen(0), fLbid(-1), fVerid(0)
FileBuffer::FileBuffer(const FileBuffer& rhs)
{
if (this == NULL || this == &rhs)
// Removed the check for gcc 8.2. The latest gcc version we
// use ATM is 4.8.2 for centos 6 and it also doesn't need
// the check
if (this == &rhs)
return;
fLbid = rhs.fLbid;

View File

@ -283,71 +283,6 @@ FdCacheType_t fdcache;
boost::mutex fdMapMutex;
rwlock::RWLock_local localLock;
void pause_(unsigned secs)
{
struct timespec req;
struct timespec rem;
req.tv_sec = secs;
req.tv_nsec = 0;
rem.tv_sec = 0;
rem.tv_nsec = 0;
#ifdef _MSC_VER
Sleep(req.tv_sec * 1000);
#else
again:
if (nanosleep(&req, &rem) != 0)
if (rem.tv_sec > 0 || rem.tv_nsec > 0)
{
req = rem;
goto again;
}
#endif
}
const vector<pair<string, string> > getDBRootList()
{
vector<pair<string, string> > ret;
Config* config;
uint32_t dbrootCount, i;
string stmp, devname, mountpoint;
char devkey[80], mountkey[80];
config = Config::makeConfig();
stmp = config->getConfig("SystemConfig", "DBRootCount");
if (stmp.empty())
{
Message::Args args;
args.add("getDBRootList: Configuration error. No DBRootCount");
primitiveprocessor::mlp->logMessage(logging::M0006, args, true);
throw runtime_error("getDBRootList: Configuration error. No DBRootCount");
}
dbrootCount = config->uFromText(stmp);
for (i = 1; i <= dbrootCount; i++)
{
snprintf(mountkey, 80, "DBRoot%d", i);
snprintf(devkey, 80, "DBRootStorageLoc%d", i);
mountpoint = config->getConfig("SystemConfig", string(mountkey));
devname = config->getConfig("Installation", string(devkey));
if (mountpoint == "" || devname == "")
throw runtime_error("getDBRootList: Configuration error. Don't know where DBRoots are mounted");
ret.push_back(pair<string, string>(devname, mountpoint));
// cout << "I see " << devname << " should be mounted at " << mountpoint << endl;
}
return ret;
}
char* alignTo(const char* in, int av)
{
ptrdiff_t inx = reinterpret_cast<ptrdiff_t>(in);
@ -769,7 +704,7 @@ void* thr_popper(ioManager* arg)
int opts = primitiveprocessor::directIOFlag ? IDBDataFile::USE_ODIRECT : 0;
fp = NULL;
uint32_t openRetries = 0;
int saveErrno;
int saveErrno = 0;
while (fp == NULL && openRetries++ < 5)
{

View File

@ -1425,7 +1425,8 @@ namespace primitives
void PrimitiveProcessor::p_Col(NewColRequestHeader* in, NewColResultHeader* out,
unsigned outSize, unsigned* written)
{
memcpy(out, in, sizeof(ISMPacketHeader) + sizeof(PrimitiveHeader));
void *outp = static_cast<void*>(out);
memcpy(outp, in, sizeof(ISMPacketHeader) + sizeof(PrimitiveHeader));
out->NVALS = 0;
out->LBID = in->LBID;
out->ism.Command = COL_RESULTS;

View File

@ -127,7 +127,11 @@ void PrimitiveProcessor::p_TokenByScan(const TokenByScanRequestHeader* h,
retTokens = reinterpret_cast<PrimToken*>(&niceRet[rdvOffset]);
retDataValues = reinterpret_cast<DataValue*>(&niceRet[rdvOffset]);
memcpy(ret, h, sizeof(PrimitiveHeader) + sizeof(ISMPacketHeader));
{
void *retp = static_cast<void*>(ret);
memcpy(retp, h, sizeof(PrimitiveHeader) + sizeof(ISMPacketHeader));
}
ret->NVALS = 0;
ret->NBYTES = sizeof(TokenByScanResultHeader);
ret->ism.Command = DICT_SCAN_COMPARE_RESULTS;
@ -575,7 +579,10 @@ void PrimitiveProcessor::p_AggregateSignature(const AggregateSignatureRequestHea
DataValue* min;
DataValue* max;
memcpy(out, in, sizeof(ISMPacketHeader) + sizeof(PrimitiveHeader));
{
void *outp = static_cast<void*>(out);
memcpy(outp, in, sizeof(ISMPacketHeader) + sizeof(PrimitiveHeader));
}
out->ism.Command = DICT_AGGREGATE_RESULTS;
niceOutput = reinterpret_cast<uint8_t*>(out);
@ -824,7 +831,10 @@ void PrimitiveProcessor::p_Dictionary(const DictInput* in, vector<uint8_t>* out,
in8 = reinterpret_cast<const uint8_t*>(in);
memcpy(&header, in, sizeof(ISMPacketHeader) + sizeof(PrimitiveHeader));
{
void *hp = static_cast<void*>(&header);
memcpy(hp, in, sizeof(ISMPacketHeader) + sizeof(PrimitiveHeader));
}
header.ism.Command = DICT_RESULTS;
header.NVALS = 0;
header.LBID = in->LBID;

View File

@ -1774,8 +1774,10 @@ void BatchPrimitiveProcessor::writeErrorMsg(const string& error, uint16_t errCod
// we don't need every field of these headers. Init'ing them anyway
// makes memory checkers happy.
memset(&ism, 0, sizeof(ISMPacketHeader));
memset(&ph, 0, sizeof(PrimitiveHeader));
void *ismp = static_cast<void*>(&ism);
void *php = static_cast<void*>(&ph);
memset(ismp, 0, sizeof(ISMPacketHeader));
memset(php, 0, sizeof(PrimitiveHeader));
ph.SessionID = sessionID;
ph.StepID = stepID;
ph.UniqueID = uniqueID;
@ -1800,8 +1802,10 @@ void BatchPrimitiveProcessor::writeProjectionPreamble()
// we don't need every field of these headers. Init'ing them anyway
// makes memory checkers happy.
memset(&ism, 0, sizeof(ISMPacketHeader));
memset(&ph, 0, sizeof(PrimitiveHeader));
void *ismp = static_cast<void*>(&ism);
void *php = static_cast<void*>(&ph);
memset(ismp, 0, sizeof(ISMPacketHeader));
memset(php, 0, sizeof(PrimitiveHeader));
ph.SessionID = sessionID;
ph.StepID = stepID;
ph.UniqueID = uniqueID;
@ -1899,8 +1903,10 @@ void BatchPrimitiveProcessor::makeResponse()
// we don't need every field of these headers. Init'ing them anyway
// makes memory checkers happy.
memset(&ism, 0, sizeof(ISMPacketHeader));
memset(&ph, 0, sizeof(PrimitiveHeader));
void *ismp = static_cast<void*>(&ism);
void *php = static_cast<void*>(&ph);
memset(ismp, 0, sizeof(ISMPacketHeader));
memset(php, 0, sizeof(PrimitiveHeader));
ph.SessionID = sessionID;
ph.StepID = stepID;
ph.UniqueID = uniqueID;

View File

@ -51,17 +51,6 @@ using namespace logging;
#define llabs labs
#endif
namespace
{
using namespace primitiveprocessor;
double cotangent(double in)
{
return (1.0 / tan(in));
}
}
namespace primitiveprocessor
{

View File

@ -1097,33 +1097,6 @@ namespace
{
using namespace primitiveprocessor;
void pause_(unsigned delay)
{
struct timespec req;
struct timespec rem;
req.tv_sec = delay;
req.tv_nsec = 0;
rem.tv_sec = 0;
rem.tv_nsec = 0;
#ifdef _MSC_VER
Sleep(req.tv_sec * 1000);
#else
again:
if (nanosleep(&req, &rem) != 0)
{
if (rem.tv_sec > 0 || rem.tv_nsec > 0)
{
req = rem;
goto again;
}
}
#endif
}
/** @brief The job type to process a dictionary scan (pDictionaryScan class on the UM)
* TODO: Move this & the impl into different files
*/

View File

@ -148,17 +148,19 @@ void setupSignalHandlers()
#endif
}
void setupCwd(Config* cf)
int8_t setupCwd(Config* cf)
{
string workdir = startup::StartUp::tmpDir();
if (workdir.length() == 0)
workdir = ".";
(void)chdir(workdir.c_str());
int8_t rc = chdir(workdir.c_str());
if (access(".", W_OK) != 0)
(void)chdir("/tmp");
if (rc < 0 || access(".", W_OK) != 0)
rc = chdir("/tmp");
return rc;
}
int setupResources()
@ -344,11 +346,11 @@ int main(int argc, char* argv[])
setupSignalHandlers();
setupCwd(cf);
int err = 0;
err = setupCwd(cf);
mlp = new primitiveprocessor::Logger();
int err = 0;
if (!gDebug)
err = setupResources();
string errMsg;
@ -368,6 +370,10 @@ int main(int argc, char* argv[])
errMsg = "Could not install file limits to required value, please see non-root install documentation";
break;
case -5:
errMsg = "Could not change into working directory";
break;
default:
break;
}