1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

Reformat all code to coding standard

This commit is contained in:
Andrew Hutchings
2017-10-26 17:18:17 +01:00
parent 4985f3456e
commit 01446d1e22
1296 changed files with 403852 additions and 353747 deletions

View File

@ -32,61 +32,67 @@ using namespace ddlpackageprocessor;
#include "we_ddlcommandclient.h"
namespace WriteEngine {
WE_DDLCommandClient::WE_DDLCommandClient()
{
fWEClient = new WEClients(WEClients::DDLPROC);
}
namespace WriteEngine
{
WE_DDLCommandClient::WE_DDLCommandClient()
{
fWEClient = new WEClients(WEClients::DDLPROC);
}
WE_DDLCommandClient::~WE_DDLCommandClient()
{
delete fWEClient;
fWEClient = NULL;
}
WE_DDLCommandClient::~WE_DDLCommandClient()
{
delete fWEClient;
fWEClient = NULL;
}
uint8_t WE_DDLCommandClient::UpdateSyscolumnNextval(uint32_t columnOid, uint64_t nextVal, uint32_t sessionID)
{
ByteStream command, response;
uint8_t err = 0;
uint64_t uniqueId = fDbrm.getUnique64();
fWEClient->addQueue(uniqueId);
command << (ByteStream::byte)WE_UPDATE_NEXTVAL;
command << uniqueId;
command << columnOid;
command << nextVal;
command << sessionID;
uint16_t dbRoot;
BRM::OID_t oid = 1021;
fDbrm.getSysCatDBRoot(oid, dbRoot);
int pmNum = 1;
boost::shared_ptr<messageqcpp::ByteStream> bsIn;
try {
fOam.getDbrootPmConfig (dbRoot, pmNum);
fWEClient->write(command, pmNum);
while (1)
{
bsIn.reset(new ByteStream());
fWEClient->read(uniqueId, bsIn);
if ( bsIn->length() == 0 ) //read error
{
err = 1;
break;
}
else {
*bsIn >> err;
break;
}
}
}
catch (...)
{
err = 1;
}
fWEClient->removeQueue(uniqueId);
return err;
}
uint8_t WE_DDLCommandClient::UpdateSyscolumnNextval(uint32_t columnOid, uint64_t nextVal, uint32_t sessionID)
{
ByteStream command, response;
uint8_t err = 0;
uint64_t uniqueId = fDbrm.getUnique64();
fWEClient->addQueue(uniqueId);
command << (ByteStream::byte)WE_UPDATE_NEXTVAL;
command << uniqueId;
command << columnOid;
command << nextVal;
command << sessionID;
uint16_t dbRoot;
BRM::OID_t oid = 1021;
fDbrm.getSysCatDBRoot(oid, dbRoot);
int pmNum = 1;
boost::shared_ptr<messageqcpp::ByteStream> bsIn;
try
{
fOam.getDbrootPmConfig (dbRoot, pmNum);
fWEClient->write(command, pmNum);
while (1)
{
bsIn.reset(new ByteStream());
fWEClient->read(uniqueId, bsIn);
if ( bsIn->length() == 0 ) //read error
{
err = 1;
break;
}
else
{
*bsIn >> err;
break;
}
}
}
catch (...)
{
err = 1;
}
fWEClient->removeQueue(uniqueId);
return err;
}
}