You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
MCOL-537 Preprocessor if blocks with pragmas now have else branch.
DMLProc exits on setupCwd failure.
This commit is contained in:
@ -492,17 +492,19 @@ void rollbackAll(DBRM* dbrm)
|
|||||||
dbrm->setSystemReady(true);
|
dbrm->setSystemReady(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setupCwd()
|
int8_t setupCwd()
|
||||||
{
|
{
|
||||||
string workdir = startup::StartUp::tmpDir();
|
string workdir = startup::StartUp::tmpDir();
|
||||||
|
|
||||||
if (workdir.length() == 0)
|
if (workdir.length() == 0)
|
||||||
workdir = ".";
|
workdir = ".";
|
||||||
|
|
||||||
(void)chdir(workdir.c_str());
|
int8_t rc = chdir(workdir.c_str());
|
||||||
|
|
||||||
if (access(".", W_OK) != 0)
|
if (rc < 0 || access(".", W_OK) != 0)
|
||||||
(void)chdir("/tmp");
|
rc = chdir("/tmp");
|
||||||
|
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
} // Namewspace
|
} // Namewspace
|
||||||
|
|
||||||
@ -521,7 +523,18 @@ int main(int argc, char* argv[])
|
|||||||
|
|
||||||
Config* cf = Config::makeConfig();
|
Config* cf = Config::makeConfig();
|
||||||
|
|
||||||
setupCwd();
|
if ( setupCwd() )
|
||||||
|
{
|
||||||
|
LoggingID logid(21, 0, 0);
|
||||||
|
logging::Message::Args args1;
|
||||||
|
logging::Message msg(1);
|
||||||
|
args1.add("DMLProc couldn't cwd.");
|
||||||
|
msg.format( args1 );
|
||||||
|
logging::Logger logger(logid.fSubsysID);
|
||||||
|
logger.logMessage(LOG_TYPE_CRITICAL, msg, logid);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
WriteEngine::WriteEngineWrapper::init( WriteEngine::SUBSYSTEM_ID_DMLPROC );
|
WriteEngine::WriteEngineWrapper::init( WriteEngine::SUBSYSTEM_ID_DMLPROC );
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
@ -610,9 +623,20 @@ int main(int argc, char* argv[])
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
string port = cf->getConfig(DMLProc, "Port");
|
string port = cf->getConfig(DMLProc, "Port");
|
||||||
string cmd = "fuser -k " + port + "/tcp >/dev/null 2>&1";
|
string cmd = "fuser -k " + port + "/tcp >/dev/null 2>&1";
|
||||||
|
|
||||||
|
// Couldn't check the return code b/c
|
||||||
|
// fuser returns 1 for unused port.
|
||||||
|
#if defined(__GNUC__) && __GNUC__ >= 5
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wunused-result"
|
||||||
(void)::system(cmd.c_str());
|
(void)::system(cmd.c_str());
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#else
|
||||||
|
(void)::system(cmd.c_str());
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
|
@ -8,6 +8,8 @@ set(alarmmanager_LIB_SRCS alarmmanager.cpp alarm.cpp)
|
|||||||
|
|
||||||
add_library(alarmmanager SHARED ${alarmmanager_LIB_SRCS})
|
add_library(alarmmanager SHARED ${alarmmanager_LIB_SRCS})
|
||||||
|
|
||||||
|
target_compile_options(alarmmanager PRIVATE -Wno-unused-result)
|
||||||
|
|
||||||
set_target_properties(alarmmanager PROPERTIES VERSION 1.0.0 SOVERSION 1)
|
set_target_properties(alarmmanager PROPERTIES VERSION 1.0.0 SOVERSION 1)
|
||||||
|
|
||||||
install(TARGETS alarmmanager DESTINATION ${ENGINE_LIBDIR} COMPONENT libs)
|
install(TARGETS alarmmanager DESTINATION ${ENGINE_LIBDIR} COMPONENT libs)
|
||||||
|
@ -3348,15 +3348,14 @@ int processCommand(string* arguments)
|
|||||||
|
|
||||||
for (i = alarmList.begin(); i != alarmList.end(); ++i)
|
for (i = alarmList.begin(); i != alarmList.end(); ++i)
|
||||||
{
|
{
|
||||||
switch (i->second.getState())
|
// SET = 1, CLEAR = 0
|
||||||
|
if (i->second.getState() == true)
|
||||||
{
|
{
|
||||||
case SET:
|
cout << "SET" << endl;
|
||||||
cout << "SET" << endl;
|
}
|
||||||
break;
|
else
|
||||||
|
{
|
||||||
case CLEAR:
|
cout << "CLEAR" << endl;
|
||||||
cout << "CLEAR" << endl;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cout << "AlarmID = " << i->second.getAlarmID() << endl;
|
cout << "AlarmID = " << i->second.getAlarmID() << endl;
|
||||||
|
@ -2429,11 +2429,13 @@ int64_t DataConvert::intToDate(int64_t data)
|
|||||||
|
|
||||||
// this snprintf call causes a compiler warning b/c we're potentially copying a 20-digit #
|
// this snprintf call causes a compiler warning b/c we're potentially copying a 20-digit #
|
||||||
// into 15 bytes, however, that appears to be intentional.
|
// into 15 bytes, however, that appears to be intentional.
|
||||||
#if defined(__GNUC__) && __GNUC__ >= 5
|
#if defined(__GNUC__) && __GNUC__ >= 6
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wformat-truncation="
|
#pragma GCC diagnostic ignored "-Wformat-truncation="
|
||||||
snprintf( buf, 15, "%llu", (long long unsigned int)data);
|
snprintf( buf, 15, "%llu", (long long unsigned int)data);
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
|
#else
|
||||||
|
snprintf( buf, 15, "%llu", (long long unsigned int)data);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
string year, month, day, hour, min, sec, msec;
|
string year, month, day, hour, min, sec, msec;
|
||||||
@ -2563,11 +2565,13 @@ int64_t DataConvert::intToDatetime(int64_t data, bool* date)
|
|||||||
|
|
||||||
// this snprintf call causes a compiler warning b/c we're potentially copying a 20-digit #
|
// this snprintf call causes a compiler warning b/c we're potentially copying a 20-digit #
|
||||||
// into 15 bytes, however, that appears to be intentional.
|
// into 15 bytes, however, that appears to be intentional.
|
||||||
#if defined(__GNUC__) && __GNUC__ >= 5
|
#if defined(__GNUC__) && __GNUC__ >= 6
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wformat-truncation="
|
#pragma GCC diagnostic ignored "-Wformat-truncation="
|
||||||
snprintf( buf, 15, "%llu", (long long unsigned int)data);
|
snprintf( buf, 15, "%llu", (long long unsigned int)data);
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
|
#else
|
||||||
|
snprintf( buf, 15, "%llu", (long long unsigned int)data);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//string date = buf;
|
//string date = buf;
|
||||||
@ -2699,11 +2703,13 @@ int64_t DataConvert::intToTime(int64_t data, bool fromString)
|
|||||||
|
|
||||||
// this snprintf call causes a compiler warning b/c we're potentially copying a 20-digit #
|
// this snprintf call causes a compiler warning b/c we're potentially copying a 20-digit #
|
||||||
// into 15 bytes, however, that appears to be intentional.
|
// into 15 bytes, however, that appears to be intentional.
|
||||||
#if defined(__GNUC__) && __GNUC__ >= 5
|
#if defined(__GNUC__) && __GNUC__ >= 6
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wformat-truncation="
|
#pragma GCC diagnostic ignored "-Wformat-truncation="
|
||||||
snprintf( buf, 15, "%llu", (long long unsigned int)data);
|
snprintf( buf, 15, "%llu", (long long unsigned int)data);
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
|
#else
|
||||||
|
snprintf( buf, 15, "%llu", (long long unsigned int)data);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//string date = buf;
|
//string date = buf;
|
||||||
|
@ -675,7 +675,7 @@ inline void DataConvert::timeToString1( long long timevalue, char* buf, unsigned
|
|||||||
}
|
}
|
||||||
// this snprintf call causes a compiler warning b/c buffer size is less
|
// this snprintf call causes a compiler warning b/c buffer size is less
|
||||||
// then maximum string size.
|
// then maximum string size.
|
||||||
#if defined(__GNUC__) && __GNUC__ >= 5
|
#if defined(__GNUC__) && __GNUC__ >= 6
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wformat-truncation="
|
#pragma GCC diagnostic ignored "-Wformat-truncation="
|
||||||
snprintf( buf, buflen, "%02d%02d%02d",
|
snprintf( buf, buflen, "%02d%02d%02d",
|
||||||
@ -684,6 +684,12 @@ inline void DataConvert::timeToString1( long long timevalue, char* buf, unsigned
|
|||||||
(unsigned)((timevalue >> 14) & 0xff)
|
(unsigned)((timevalue >> 14) & 0xff)
|
||||||
);
|
);
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
|
#else
|
||||||
|
snprintf( buf, buflen, "%02d%02d%02d",
|
||||||
|
hour,
|
||||||
|
(unsigned)((timevalue >> 32) & 0xff),
|
||||||
|
(unsigned)((timevalue >> 14) & 0xff)
|
||||||
|
);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -966,12 +966,15 @@ void InetStreamSocket::connect(const sockaddr* serv_addr)
|
|||||||
char buf = '\0';
|
char buf = '\0';
|
||||||
(void)::recv(socketParms().sd(), &buf, 1, 0);
|
(void)::recv(socketParms().sd(), &buf, 1, 0);
|
||||||
#else
|
#else
|
||||||
#if defined(__GNUC__) && __GNUC__ >= 5
|
#if defined(__GNUC__) && __GNUC__ >= 6
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wunused-result"
|
#pragma GCC diagnostic ignored "-Wunused-result"
|
||||||
char buf = '\0';
|
char buf = '\0';
|
||||||
ssize_t bytes = ::read(socketParms().sd(), &buf, 1); // we know 1 byte is in the recv buffer
|
::read(socketParms().sd(), &buf, 1); // we know 1 byte is in the recv buffer
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
|
#else
|
||||||
|
char buf = '\0';
|
||||||
|
::read(socketParms().sd(), &buf, 1); // we know 1 byte is in the recv buffer
|
||||||
#endif // pragma
|
#endif // pragma
|
||||||
#endif
|
#endif
|
||||||
return;
|
return;
|
||||||
|
@ -77,7 +77,7 @@ public:
|
|||||||
boost::thread* create_thread(F threadfunc)
|
boost::thread* create_thread(F threadfunc)
|
||||||
{
|
{
|
||||||
boost::lock_guard<boost::shared_mutex> guard(m);
|
boost::lock_guard<boost::shared_mutex> guard(m);
|
||||||
#if defined(__GNUC__) && __GNUC__ >= 5
|
#if defined(__GNUC__) && __GNUC__ >= 7
|
||||||
std::unique_ptr<boost::thread> new_thread(new boost::thread(threadfunc));
|
std::unique_ptr<boost::thread> new_thread(new boost::thread(threadfunc));
|
||||||
#else
|
#else
|
||||||
std::auto_ptr<boost::thread> new_thread(new boost::thread(threadfunc));
|
std::auto_ptr<boost::thread> new_thread(new boost::thread(threadfunc));
|
||||||
|
@ -66,6 +66,8 @@ namespace WriteEngine
|
|||||||
extern int NUM_BLOCKS_PER_INITIAL_EXTENT; // defined in we_dctnry.cpp
|
extern int NUM_BLOCKS_PER_INITIAL_EXTENT; // defined in we_dctnry.cpp
|
||||||
extern WErrorCodes ec; // defined in we_log.cpp
|
extern WErrorCodes ec; // defined in we_log.cpp
|
||||||
|
|
||||||
|
const int COMPRESSED_CHUNK_SIZE = compress::IDBCompressInterface::maxCompressedSize(UNCOMPRESSED_CHUNK_SIZE) + 64 + 3 + 8 * 1024;
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Search for the specified chunk in fChunkList.
|
// Search for the specified chunk in fChunkList.
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
@ -1926,7 +1928,7 @@ int ChunkManager::reallocateChunks(CompFileData* fileData)
|
|||||||
char tmText[24];
|
char tmText[24];
|
||||||
// this snprintf call causes a compiler warning b/c buffer size is less
|
// this snprintf call causes a compiler warning b/c buffer size is less
|
||||||
// then maximum string size.
|
// then maximum string size.
|
||||||
#if defined(__GNUC__) && __GNUC__ >= 5
|
#if defined(__GNUC__) && __GNUC__ >= 6
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wformat-truncation="
|
#pragma GCC diagnostic ignored "-Wformat-truncation="
|
||||||
snprintf(tmText, sizeof(tmText), ".%04d%02d%02d%02d%02d%02d%06ld",
|
snprintf(tmText, sizeof(tmText), ".%04d%02d%02d%02d%02d%02d%06ld",
|
||||||
@ -1934,6 +1936,11 @@ int ChunkManager::reallocateChunks(CompFileData* fileData)
|
|||||||
ltm.tm_mday, ltm.tm_hour, ltm.tm_min,
|
ltm.tm_mday, ltm.tm_hour, ltm.tm_min,
|
||||||
ltm.tm_sec, tv.tv_usec);
|
ltm.tm_sec, tv.tv_usec);
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
|
#else
|
||||||
|
snprintf(tmText, sizeof(tmText), ".%04d%02d%02d%02d%02d%02d%06ld",
|
||||||
|
ltm.tm_year + 1900, ltm.tm_mon + 1,
|
||||||
|
ltm.tm_mday, ltm.tm_hour, ltm.tm_min,
|
||||||
|
ltm.tm_sec, tv.tv_usec);
|
||||||
#endif
|
#endif
|
||||||
string dbgFileName(rlcFileName + tmText);
|
string dbgFileName(rlcFileName + tmText);
|
||||||
|
|
||||||
@ -2116,7 +2123,7 @@ int ChunkManager::reallocateChunks(CompFileData* fileData)
|
|||||||
char tmText[24];
|
char tmText[24];
|
||||||
// this snprintf call causes a compiler warning b/c buffer size is less
|
// this snprintf call causes a compiler warning b/c buffer size is less
|
||||||
// then maximum string size.
|
// then maximum string size.
|
||||||
#if defined(__GNUC__) && __GNUC__ >= 5
|
#if defined(__GNUC__) && __GNUC__ >= 6
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wformat-truncation="
|
#pragma GCC diagnostic ignored "-Wformat-truncation="
|
||||||
snprintf(tmText, sizeof(tmText), ".%04d%02d%02d%02d%02d%02d%06ld",
|
snprintf(tmText, sizeof(tmText), ".%04d%02d%02d%02d%02d%02d%06ld",
|
||||||
@ -2124,6 +2131,11 @@ int ChunkManager::reallocateChunks(CompFileData* fileData)
|
|||||||
ltm.tm_mday, ltm.tm_hour, ltm.tm_min,
|
ltm.tm_mday, ltm.tm_hour, ltm.tm_min,
|
||||||
ltm.tm_sec, tv.tv_usec);
|
ltm.tm_sec, tv.tv_usec);
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
|
#else
|
||||||
|
snprintf(tmText, sizeof(tmText), ".%04d%02d%02d%02d%02d%02d%06ld",
|
||||||
|
ltm.tm_year + 1900, ltm.tm_mon + 1,
|
||||||
|
ltm.tm_mday, ltm.tm_hour, ltm.tm_min,
|
||||||
|
ltm.tm_sec, tv.tv_usec);
|
||||||
#endif
|
#endif
|
||||||
string dbgFileName(rlcFileName + tmText);
|
string dbgFileName(rlcFileName + tmText);
|
||||||
|
|
||||||
|
@ -68,7 +68,6 @@ const int UNCOMPRESSED_CHUNK_SIZE = compress::IDBCompressInterface::UNCOMPRESSED
|
|||||||
const int COMPRESSED_FILE_HEADER_UNIT = compress::IDBCompressInterface::HDR_BUF_LEN;
|
const int COMPRESSED_FILE_HEADER_UNIT = compress::IDBCompressInterface::HDR_BUF_LEN;
|
||||||
|
|
||||||
// assume UNCOMPRESSED_CHUNK_SIZE > 0xBFFF (49151), 8 * 1024 bytes padding
|
// assume UNCOMPRESSED_CHUNK_SIZE > 0xBFFF (49151), 8 * 1024 bytes padding
|
||||||
const int COMPRESSED_CHUNK_SIZE = compress::IDBCompressInterface::maxCompressedSize(UNCOMPRESSED_CHUNK_SIZE) + 64 + 3 + 8 * 1024;
|
|
||||||
|
|
||||||
const int BLOCKS_IN_CHUNK = UNCOMPRESSED_CHUNK_SIZE / BYTE_PER_BLOCK;
|
const int BLOCKS_IN_CHUNK = UNCOMPRESSED_CHUNK_SIZE / BYTE_PER_BLOCK;
|
||||||
const int MAXOFFSET_PER_CHUNK = 511 * BYTE_PER_BLOCK;
|
const int MAXOFFSET_PER_CHUNK = 511 * BYTE_PER_BLOCK;
|
||||||
|
Reference in New Issue
Block a user