mirror of https://gitee.com/bigwinds/arangodb
Fixed bad access bugs from last commit.
This commit is contained in:
parent
64d7f690da
commit
b388fc3e87
|
@ -444,9 +444,10 @@ QueryResult Query::prepare(QueryRegistry* registry) {
|
||||||
_isModificationQuery = parser->isModificationQuery();
|
_isModificationQuery = parser->isModificationQuery();
|
||||||
|
|
||||||
// create the transaction object, but do not start it yet
|
// create the transaction object, but do not start it yet
|
||||||
auto trx = std::make_unique<arangodb::AqlTransaction>(
|
arangodb::AqlTransaction* trx = new arangodb::AqlTransaction(
|
||||||
createTransactionContext(), _collections.collections(),
|
createTransactionContext(), _collections.collections(),
|
||||||
_part == PART_MAIN);
|
_part == PART_MAIN);
|
||||||
|
_trx = trx;
|
||||||
|
|
||||||
bool planRegisters;
|
bool planRegisters;
|
||||||
|
|
||||||
|
@ -455,7 +456,6 @@ QueryResult Query::prepare(QueryRegistry* registry) {
|
||||||
int res = trx->begin();
|
int res = trx->begin();
|
||||||
|
|
||||||
if (res != TRI_ERROR_NO_ERROR) {
|
if (res != TRI_ERROR_NO_ERROR) {
|
||||||
_trx = trx.release(); // Probably not needed here
|
|
||||||
return transactionError(res);
|
return transactionError(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -469,7 +469,6 @@ QueryResult Query::prepare(QueryRegistry* registry) {
|
||||||
|
|
||||||
if (plan.get() == nullptr) {
|
if (plan.get() == nullptr) {
|
||||||
// oops
|
// oops
|
||||||
_trx = trx.release(); // Probably not needed here
|
|
||||||
return QueryResult(TRI_ERROR_INTERNAL,
|
return QueryResult(TRI_ERROR_INTERNAL,
|
||||||
"failed to create query execution engine");
|
"failed to create query execution engine");
|
||||||
}
|
}
|
||||||
|
@ -501,7 +500,6 @@ QueryResult Query::prepare(QueryRegistry* registry) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res != TRI_ERROR_NO_ERROR) {
|
if (res != TRI_ERROR_NO_ERROR) {
|
||||||
_trx = trx.release(); // Probably not needed here
|
|
||||||
return transactionError(res);
|
return transactionError(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -509,7 +507,6 @@ QueryResult Query::prepare(QueryRegistry* registry) {
|
||||||
plan.reset(ExecutionPlan::instantiateFromVelocyPack(parser->ast(), _queryBuilder->slice()));
|
plan.reset(ExecutionPlan::instantiateFromVelocyPack(parser->ast(), _queryBuilder->slice()));
|
||||||
if (plan.get() == nullptr) {
|
if (plan.get() == nullptr) {
|
||||||
// oops
|
// oops
|
||||||
_trx = trx.release(); // Probably not needed here
|
|
||||||
return QueryResult(TRI_ERROR_INTERNAL);
|
return QueryResult(TRI_ERROR_INTERNAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -533,7 +530,6 @@ QueryResult Query::prepare(QueryRegistry* registry) {
|
||||||
_plan = plan.release();
|
_plan = plan.release();
|
||||||
_parser = parser.release();
|
_parser = parser.release();
|
||||||
_engine = engine;
|
_engine = engine;
|
||||||
_trx = trx.release();
|
|
||||||
return QueryResult();
|
return QueryResult();
|
||||||
} catch (arangodb::basics::Exception const& ex) {
|
} catch (arangodb::basics::Exception const& ex) {
|
||||||
cleanupPlanAndEngine(ex.code());
|
cleanupPlanAndEngine(ex.code());
|
||||||
|
|
|
@ -74,6 +74,12 @@ void arangodb::traverser::ShortestPath::vertexToVelocyPack(Transaction* trx, siz
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
arangodb::traverser::TraverserOptions::LookupInfo::LookupInfo()
|
||||||
|
: expression(nullptr), indexCondition(nullptr) {
|
||||||
|
// NOTE: We need exactly one in this case for the optimizer to update
|
||||||
|
idxHandles.resize(1);
|
||||||
|
};
|
||||||
|
|
||||||
arangodb::traverser::TraverserOptions::LookupInfo::~LookupInfo() {
|
arangodb::traverser::TraverserOptions::LookupInfo::~LookupInfo() {
|
||||||
if (expression != nullptr) {
|
if (expression != nullptr) {
|
||||||
delete expression;
|
delete expression;
|
||||||
|
|
|
@ -234,7 +234,7 @@ struct TraverserOptions {
|
||||||
aql::Expression* expression;
|
aql::Expression* expression;
|
||||||
aql::AstNode* indexCondition;
|
aql::AstNode* indexCondition;
|
||||||
|
|
||||||
LookupInfo() : expression(nullptr), indexCondition(nullptr){};
|
LookupInfo();
|
||||||
~LookupInfo();
|
~LookupInfo();
|
||||||
|
|
||||||
LookupInfo(LookupInfo const&);
|
LookupInfo(LookupInfo const&);
|
||||||
|
|
Loading…
Reference in New Issue