You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-29 08:21:15 +03:00
Merge branch 'develop-1.2' into develop-merge-up-20190514
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
/* Copyright (C) 2014 InfiniDB, Inc.
|
||||
Copyright (C) 2019 MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
@ -65,6 +66,8 @@ namespace WriteEngine
|
||||
extern int NUM_BLOCKS_PER_INITIAL_EXTENT; // defined in we_dctnry.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.
|
||||
//------------------------------------------------------------------------------
|
||||
@ -1923,10 +1926,22 @@ int ChunkManager::reallocateChunks(CompFileData* fileData)
|
||||
struct tm ltm;
|
||||
localtime_r(reinterpret_cast<time_t*>(&tv.tv_sec), <m);
|
||||
char tmText[24];
|
||||
// this snprintf call causes a compiler warning b/c buffer size is less
|
||||
// then maximum string size.
|
||||
#if defined(__GNUC__) && __GNUC__ >= 6
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wformat-truncation="
|
||||
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);
|
||||
#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
|
||||
string dbgFileName(rlcFileName + tmText);
|
||||
|
||||
ostringstream oss;
|
||||
@ -2106,10 +2121,22 @@ int ChunkManager::reallocateChunks(CompFileData* fileData)
|
||||
struct tm ltm;
|
||||
localtime_r(reinterpret_cast<time_t*>(&tv.tv_sec), <m);
|
||||
char tmText[24];
|
||||
// this snprintf call causes a compiler warning b/c buffer size is less
|
||||
// then maximum string size.
|
||||
#if defined(__GNUC__) && __GNUC__ >= 6
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wformat-truncation="
|
||||
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);
|
||||
#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
|
||||
string dbgFileName(rlcFileName + tmText);
|
||||
|
||||
ostringstream oss;
|
||||
|
@ -68,7 +68,6 @@ const int UNCOMPRESSED_CHUNK_SIZE = compress::IDBCompressInterface::UNCOMPRESSED
|
||||
const int COMPRESSED_FILE_HEADER_UNIT = compress::IDBCompressInterface::HDR_BUF_LEN;
|
||||
|
||||
// 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 MAXOFFSET_PER_CHUNK = 511 * BYTE_PER_BLOCK;
|
||||
|
@ -330,12 +330,15 @@ int FileOp::deleteFile( FID fid ) const
|
||||
std::vector<std::string> dbRootPathList;
|
||||
Config::getDBRootPathList( dbRootPathList );
|
||||
|
||||
int rc;
|
||||
|
||||
for (unsigned i = 0; i < dbRootPathList.size(); i++)
|
||||
{
|
||||
char rootOidDirName[FILE_NAME_SIZE];
|
||||
sprintf(rootOidDirName, "%s/%s", dbRootPathList[i].c_str(), oidDirName);
|
||||
rc = snprintf(rootOidDirName, FILE_NAME_SIZE, "%s/%s",
|
||||
dbRootPathList[i].c_str(), oidDirName);
|
||||
|
||||
if ( IDBPolicy::remove( rootOidDirName ) != 0 )
|
||||
if ( rc == FILE_NAME_SIZE || IDBPolicy::remove( rootOidDirName ) != 0 )
|
||||
{
|
||||
ostringstream oss;
|
||||
oss << "Unable to remove " << rootOidDirName;
|
||||
@ -363,6 +366,7 @@ int FileOp::deleteFiles( const std::vector<int32_t>& fids ) const
|
||||
char dbDir [MAX_DB_DIR_LEVEL][MAX_DB_DIR_NAME_SIZE];
|
||||
std::vector<std::string> dbRootPathList;
|
||||
Config::getDBRootPathList( dbRootPathList );
|
||||
int rc;
|
||||
|
||||
for ( unsigned n = 0; n < fids.size(); n++ )
|
||||
{
|
||||
@ -376,10 +380,10 @@ int FileOp::deleteFiles( const std::vector<int32_t>& fids ) const
|
||||
for (unsigned i = 0; i < dbRootPathList.size(); i++)
|
||||
{
|
||||
char rootOidDirName[FILE_NAME_SIZE];
|
||||
sprintf(rootOidDirName, "%s/%s", dbRootPathList[i].c_str(),
|
||||
rc = snprintf(rootOidDirName, FILE_NAME_SIZE, "%s/%s", dbRootPathList[i].c_str(),
|
||||
oidDirName);
|
||||
|
||||
if ( IDBPolicy::remove( rootOidDirName ) != 0 )
|
||||
if ( rc == FILE_NAME_SIZE || IDBPolicy::remove( rootOidDirName ) != 0 )
|
||||
{
|
||||
ostringstream oss;
|
||||
oss << "Unable to remove " << rootOidDirName;
|
||||
@ -410,6 +414,7 @@ int FileOp::deletePartitions( const std::vector<OID>& fids,
|
||||
char dbDir [MAX_DB_DIR_LEVEL][MAX_DB_DIR_NAME_SIZE];
|
||||
char rootOidDirName[FILE_NAME_SIZE];
|
||||
char partitionDirName[FILE_NAME_SIZE];
|
||||
int rcd, rcp;
|
||||
|
||||
for (uint32_t i = 0; i < partitions.size(); i++)
|
||||
{
|
||||
@ -420,12 +425,13 @@ int FileOp::deletePartitions( const std::vector<OID>& fids,
|
||||
dbDir[0], dbDir[1], dbDir[2], dbDir[3], dbDir[4]);
|
||||
// config expects dbroot starting from 0
|
||||
std::string rt( Config::getDBRootByNum(partitions[i].lp.dbroot) );
|
||||
sprintf(rootOidDirName, "%s/%s",
|
||||
rcd = snprintf(rootOidDirName, FILE_NAME_SIZE, "%s/%s",
|
||||
rt.c_str(), tempFileName);
|
||||
sprintf(partitionDirName, "%s/%s",
|
||||
rcp = snprintf(partitionDirName, FILE_NAME_SIZE, "%s/%s",
|
||||
rt.c_str(), oidDirName);
|
||||
|
||||
if ( IDBPolicy::remove( rootOidDirName ) != 0 )
|
||||
if ( rcd == FILE_NAME_SIZE || rcp == FILE_NAME_SIZE
|
||||
|| IDBPolicy::remove( rootOidDirName ) != 0 )
|
||||
{
|
||||
ostringstream oss;
|
||||
oss << "Unable to remove " << rootOidDirName;
|
||||
|
@ -393,7 +393,7 @@ struct IdxMultiColKey
|
||||
curMask.reset();
|
||||
curLevel = maxLevel = 0;
|
||||
totalBit = 0;
|
||||
memset( testbitArray, 0, IDX_MAX_MULTI_COL_IDX_LEVEL);
|
||||
memset( testbitArray, 0, IDX_MAX_MULTI_COL_IDX_LEVEL * sizeof(testbitArray[0]));
|
||||
memset( keyBuf, 0, IDX_MAX_MULTI_COL_BIT / 8 );
|
||||
curMask = 0x1F;
|
||||
curMask = curMask << (IDX_MAX_MULTI_COL_BIT - 5);
|
||||
|
@ -489,7 +489,7 @@ struct CacheControl /** @brief Cache control structure */
|
||||
int checkInterval; /** @brief A check point interval in seconds */
|
||||
CacheControl()
|
||||
{
|
||||
totalBlock = pctFree = checkInterval; /** @brief constructor */
|
||||
totalBlock = pctFree = checkInterval = 0; /** @brief constructor */
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user