1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +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

@ -41,52 +41,57 @@ extern string DefaultSchema;
CalpontSelectExecutionPlan* parseQuery(const string& query, const uint32_t sid)
{
//We're going to make parsing the query single-threaded for now. This makes it a lot
// easier to interface with the parser and doesn;t materially affect overall query
// performance (I think)
mutex::scoped_lock lk(ParserMutex);
//We're going to make parsing the query single-threaded for now. This makes it a lot
// easier to interface with the parser and doesn;t materially affect overall query
// performance (I think)
mutex::scoped_lock lk(ParserMutex);
boost::shared_ptr<CalpontSystemCatalog> csc = CalpontSystemCatalog::makeCalpontSystemCatalog(sid);
CalpontSelectExecutionPlan* csep=0;
csep = new CalpontSelectExecutionPlan();
//we use an auto_ptr here with some trepidation. We only want auto delete on an execption.
//If the parseing and plan build succeed, we want the ptr to stay around. boost::scoped_ptr<>
//doesn't have an API to release ownership, so we use auto_ptr...
auto_ptr<CalpontSelectExecutionPlan> scsep(csep);
boost::shared_ptr<CalpontSystemCatalog> csc = CalpontSystemCatalog::makeCalpontSystemCatalog(sid);
CalpontSelectExecutionPlan* csep = 0;
csep = new CalpontSelectExecutionPlan();
//we use an auto_ptr here with some trepidation. We only want auto delete on an execption.
//If the parseing and plan build succeed, we want the ptr to stay around. boost::scoped_ptr<>
//doesn't have an API to release ownership, so we use auto_ptr...
auto_ptr<CalpontSelectExecutionPlan> scsep(csep);
yy_buffer_state* ybs=0;
ybs = qfe_scan_string(query.c_str());
if (ybs != 0)
{
ParserCSEP = csep;
ParserCSC = csc;
if (qfeparse() != 0)
throw runtime_error("syntax error");
qfe_delete_buffer(ybs);
}
else
throw runtime_error("Internal parser memory error");
yy_buffer_state* ybs = 0;
ybs = qfe_scan_string(query.c_str());
csep->data(query);
if (ybs != 0)
{
ParserCSEP = csep;
ParserCSC = csc;
SessionManager sm;
TxnID txnID;
txnID = sm.getTxnID(sid);
if (!txnID.valid)
{
txnID.id = 0;
txnID.valid = true;
}
QueryContext verID;
verID = sm.verID();
if (qfeparse() != 0)
throw runtime_error("syntax error");
csep->txnID(txnID.id);
csep->verID(verID);
csep->sessionID(sid);
qfe_delete_buffer(ybs);
}
else
throw runtime_error("Internal parser memory error");
//cout << *csep << endl;
scsep.release();
return csep;
csep->data(query);
SessionManager sm;
TxnID txnID;
txnID = sm.getTxnID(sid);
if (!txnID.valid)
{
txnID.id = 0;
txnID.valid = true;
}
QueryContext verID;
verID = sm.verID();
csep->txnID(txnID.id);
csep->verID(verID);
csep->sessionID(sid);
//cout << *csep << endl;
scsep.release();
return csep;
}
}