1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

clang format apply

This commit is contained in:
Leonid Fedorov
2022-01-21 16:43:49 +00:00
parent 6b6411229f
commit 04752ec546
1376 changed files with 393460 additions and 412662 deletions

View File

@ -16,10 +16,10 @@
MA 02110-1301, USA. */
/***********************************************************************
* $Id: dmlcolumn.cpp 9210 2013-01-21 14:10:42Z rdempsey $
*
*
***********************************************************************/
* $Id: dmlcolumn.cpp 9210 2013-01-21 14:10:42Z rdempsey $
*
*
***********************************************************************/
#define DMLPKGCOLUMN_DLLEXPORT
#include "dmlcolumn.h"
@ -31,95 +31,93 @@
namespace dmlpackage
{
DMLColumn::DMLColumn()
{}
DMLColumn::DMLColumn(std::string name, std::string value, bool isFromCol, uint32_t funcScale, bool isNULL)
{
fName = name;
fData = value;
if (( strcasecmp(value.c_str(), "NULL") == 0) || (value.length() == 0) )
{
isNULL = true;
}
fisNULL = isNULL;
fIsFromCol = isFromCol;
fFuncScale = funcScale;
}
DMLColumn::DMLColumn(std::string name, std::vector<std::string>& valueList, bool isFromCol, uint32_t funcScale, bool isNULL)
DMLColumn::DMLColumn(std::string name, std::string value, bool isFromCol, uint32_t funcScale, bool isNULL)
{
fName = name;
fColValuesList = valueList;
fisNULL = isNULL;
fIsFromCol = isFromCol;
fFuncScale = funcScale;
fName = name;
fData = value;
if ((strcasecmp(value.c_str(), "NULL") == 0) || (value.length() == 0))
{
isNULL = true;
}
fisNULL = isNULL;
fIsFromCol = isFromCol;
fFuncScale = funcScale;
}
DMLColumn::DMLColumn(std::string name, std::vector<std::string>& valueList, bool isFromCol,
uint32_t funcScale, bool isNULL)
{
fName = name;
fColValuesList = valueList;
fisNULL = isNULL;
fIsFromCol = isFromCol;
fFuncScale = funcScale;
}
DMLColumn::~DMLColumn()
{}
{
}
int DMLColumn::read(messageqcpp::ByteStream& bytestream)
{
int retval = 1;
bytestream >> fName;
bytestream >> reinterpret_cast<messageqcpp::ByteStream::byte&>(fisNULL);
uint32_t vectorSize;
bytestream >> vectorSize;
int retval = 1;
bytestream >> fName;
bytestream >> reinterpret_cast<messageqcpp::ByteStream::byte&>(fisNULL);
uint32_t vectorSize;
bytestream >> vectorSize;
if (vectorSize > 0 )
if (vectorSize > 0)
{
for (uint32_t i = 0; i < vectorSize; i++)
{
for ( uint32_t i = 0; i < vectorSize; i++ )
{
std::string dataStr;
bytestream >> dataStr;
// if ( !fisNULL && (dataStr.length() == 0 ))
// dataStr = (char) 0;
fColValuesList.push_back( dataStr);
}
std::string dataStr;
bytestream >> dataStr;
// if ( !fisNULL && (dataStr.length() == 0 ))
// dataStr = (char) 0;
fColValuesList.push_back(dataStr);
}
else
bytestream >> fData; //deprecated.
}
else
bytestream >> fData; // deprecated.
if ( (fColValuesList.size() < 1) && (fColValuesList.size() > 0) ) //deprecated.
fData = fColValuesList[0] ; //deprecated.
if ((fColValuesList.size() < 1) && (fColValuesList.size() > 0)) // deprecated.
fData = fColValuesList[0]; // deprecated.
//bytestream >> reinterpret_cast<messageqcpp::ByteStream::byte&>(fisNULL);
bytestream >> reinterpret_cast<messageqcpp::ByteStream::byte&>(fIsFromCol);
bytestream >> (uint32_t&) fFuncScale;
return retval;
// bytestream >> reinterpret_cast<messageqcpp::ByteStream::byte&>(fisNULL);
bytestream >> reinterpret_cast<messageqcpp::ByteStream::byte&>(fIsFromCol);
bytestream >> (uint32_t&)fFuncScale;
return retval;
}
int DMLColumn::write(messageqcpp::ByteStream& bytestream)
{
int retval = 1;
bytestream << fName;
bytestream << static_cast<uint8_t>(fisNULL);
uint32_t vectorSize = fColValuesList.size();
bytestream << vectorSize;
int retval = 1;
bytestream << fName;
bytestream << static_cast<uint8_t>(fisNULL);
uint32_t vectorSize = fColValuesList.size();
bytestream << vectorSize;
if (vectorSize > 0 )
if (vectorSize > 0)
{
for (uint32_t i = 0; i < vectorSize; i++)
{
for ( uint32_t i = 0; i < vectorSize; i++ )
{
bytestream << fColValuesList[i];
}
bytestream << fColValuesList[i];
}
else
bytestream << fData; //deprecated.
}
else
bytestream << fData; // deprecated.
//bytestream << static_cast<uint8_t>(fisNULL);
bytestream << static_cast<uint8_t>(fIsFromCol);
bytestream << (uint32_t)fFuncScale;
return retval;
// bytestream << static_cast<uint8_t>(fisNULL);
bytestream << static_cast<uint8_t>(fIsFromCol);
bytestream << (uint32_t)fFuncScale;
return retval;
}
} //namespace dmlpackage
} // namespace dmlpackage