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

@ -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;
}