1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-12-24 14:20:59 +03:00

Another try to cope with warnings under gcc 8.2.

This commit is contained in:
Roman Nozdrin
2018-11-30 13:24:58 +03:00
parent cbbf267e88
commit 9dc33c4e82
37 changed files with 145 additions and 100 deletions

View File

@@ -332,12 +332,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;
@@ -365,6 +368,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++ )
{
@@ -378,10 +382,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;
@@ -412,6 +416,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++)
{
@@ -422,12 +427,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;

View File

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

View File

@@ -487,7 +487,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 */
}
};