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

88
dbcon/mysql/ha_select_sub.cpp Executable file → Normal file
View File

@ -50,8 +50,8 @@ SelectSubQuery::SelectSubQuery(gp_walk_info& gwip) : SubQuery(gwip), fSelSub (NU
{}
SelectSubQuery::SelectSubQuery(gp_walk_info& gwip, Item_subselect* selSub) :
SubQuery(gwip),
fSelSub(selSub)
SubQuery(gwip),
fSelSub(selSub)
{}
SelectSubQuery::~SelectSubQuery()
@ -59,53 +59,57 @@ SelectSubQuery::~SelectSubQuery()
SCSEP SelectSubQuery::transform()
{
idbassert(fSelSub);
SCSEP csep(new CalpontSelectExecutionPlan());
csep->sessionID(fGwip.sessionid);
csep->subType (CalpontSelectExecutionPlan::SELECT_SUBS);
idbassert(fSelSub);
SCSEP csep(new CalpontSelectExecutionPlan());
csep->sessionID(fGwip.sessionid);
csep->subType (CalpontSelectExecutionPlan::SELECT_SUBS);
// gwi for the sub query
gp_walk_info gwi;
gwi.thd = fGwip.thd;
gwi.subQuery = this;
// gwi for the sub query
gp_walk_info gwi;
gwi.thd = fGwip.thd;
gwi.subQuery = this;
// @4632 merge table list to gwi in case there is FROM sub to be referenced
// in the SELECT sub
gwi.derivedTbCnt = fGwip.derivedTbList.size();
uint32_t tbCnt = fGwip.tbList.size();
// @4632 merge table list to gwi in case there is FROM sub to be referenced
// in the SELECT sub
gwi.derivedTbCnt = fGwip.derivedTbList.size();
uint32_t tbCnt = fGwip.tbList.size();
gwi.tbList.insert(gwi.tbList.begin(), fGwip.tbList.begin(), fGwip.tbList.end());
gwi.derivedTbList.insert(gwi.derivedTbList.begin(), fGwip.derivedTbList.begin(), fGwip.derivedTbList.end());
gwi.tbList.insert(gwi.tbList.begin(), fGwip.tbList.begin(), fGwip.tbList.end());
gwi.derivedTbList.insert(gwi.derivedTbList.begin(), fGwip.derivedTbList.begin(), fGwip.derivedTbList.end());
if (getSelectPlan(gwi, *(fSelSub->get_select_lex()), csep) != 0)
{
if (!gwi.fatalParseError)
{
fGwip.fatalParseError = true;
fGwip.parseErrorText = "Error occured in SelectSubQuery::transform()";
}
else
{
fGwip.fatalParseError = gwi.fatalParseError;
fGwip.parseErrorText = gwi.parseErrorText;
}
csep.reset();
return csep;
}
if (getSelectPlan(gwi, *(fSelSub->get_select_lex()), csep) != 0)
{
if (!gwi.fatalParseError)
{
fGwip.fatalParseError = true;
fGwip.parseErrorText = "Error occured in SelectSubQuery::transform()";
}
else
{
fGwip.fatalParseError = gwi.fatalParseError;
fGwip.parseErrorText = gwi.parseErrorText;
}
fGwip.subselectList.push_back(csep);
csep.reset();
return csep;
}
// remove outer query tables
CalpontSelectExecutionPlan::TableList tblist;
if (csep->tableList().size() >= tbCnt)
tblist.insert(tblist.begin(),csep->tableList().begin()+tbCnt, csep->tableList().end());
CalpontSelectExecutionPlan::SelectList derivedTbList;
fGwip.subselectList.push_back(csep);
if (csep->derivedTableList().size() >= gwi.derivedTbCnt)
derivedTbList.insert(derivedTbList.begin(), csep->derivedTableList().begin()+gwi.derivedTbCnt, csep->derivedTableList().end());
csep->tableList(tblist);
csep->derivedTableList(derivedTbList);
return csep;
// remove outer query tables
CalpontSelectExecutionPlan::TableList tblist;
if (csep->tableList().size() >= tbCnt)
tblist.insert(tblist.begin(), csep->tableList().begin() + tbCnt, csep->tableList().end());
CalpontSelectExecutionPlan::SelectList derivedTbList;
if (csep->derivedTableList().size() >= gwi.derivedTbCnt)
derivedTbList.insert(derivedTbList.begin(), csep->derivedTableList().begin() + gwi.derivedTbCnt, csep->derivedTableList().end());
csep->tableList(tblist);
csep->derivedTableList(derivedTbList);
return csep;
}
}