1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +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

@ -33,7 +33,7 @@ extern boost::shared_ptr<CalpontSystemCatalog> ParserCSC;
namespace
{
mutex ParserMutex;
} //anon namespace
} // namespace
namespace qfe
{
@ -41,58 +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());
yy_buffer_state* ybs = 0;
ybs = qfe_scan_string(query.c_str());
if (ybs != 0)
{
ParserCSEP = csep;
ParserCSC = csc;
if (ybs != 0)
{
ParserCSEP = csep;
ParserCSC = csc;
if (qfeparse() != 0)
throw runtime_error("syntax error");
if (qfeparse() != 0)
throw runtime_error("syntax error");
qfe_delete_buffer(ybs);
}
else
throw runtime_error("Internal parser memory error");
qfe_delete_buffer(ybs);
}
else
throw runtime_error("Internal parser memory error");
csep->data(query);
csep->data(query);
SessionManager sm;
TxnID txnID;
txnID = sm.getTxnID(sid);
SessionManager sm;
TxnID txnID;
txnID = sm.getTxnID(sid);
if (!txnID.valid)
{
txnID.id = 0;
txnID.valid = true;
}
if (!txnID.valid)
{
txnID.id = 0;
txnID.valid = true;
}
QueryContext verID;
verID = sm.verID();
QueryContext verID;
verID = sm.verID();
csep->txnID(txnID.id);
csep->verID(verID);
csep->sessionID(sid);
//cout << *csep << endl;
scsep.release();
return csep;
}
csep->txnID(txnID.id);
csep->verID(verID);
csep->sessionID(sid);
// cout << *csep << endl;
scsep.release();
return csep;
}
} // namespace qfe