mirror of https://gitee.com/bigwinds/arangodb
cleanup v8 expressions in coordinator, too
This commit is contained in:
parent
ed07ba2fc0
commit
6dfe652d56
|
@ -1080,10 +1080,15 @@ AstNode* Ast::createArithmeticResultNode (double value) {
|
|||
|
||||
AstNode* Ast::executeConstExpression (AstNode const* node) {
|
||||
// must enter v8 before we can execute any expression
|
||||
v8::HandleScope scope; // do not delete this!
|
||||
_query->enterContext();
|
||||
|
||||
v8::HandleScope scope; // do not delete this!
|
||||
|
||||
TRI_json_t* result = _query->executor()->executeExpression(node);
|
||||
|
||||
// context is not left here, but later
|
||||
// this allows re-using the same context for multiple expressions
|
||||
|
||||
if (result == nullptr) {
|
||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_OUT_OF_MEMORY);
|
||||
}
|
||||
|
|
|
@ -957,7 +957,7 @@ bool IndexRangeBlock::readIndex () {
|
|||
|
||||
// must invalidate the expression now as we might be called from
|
||||
// different threads
|
||||
if (ExecutionEngine::isDBServer()) {
|
||||
if (ExecutionEngine::isDBServer() || ExecutionEngine::isCoordinator()) {
|
||||
for (auto e : _allVariableBoundExpressions) {
|
||||
e->invalidate();
|
||||
}
|
||||
|
@ -1915,7 +1915,7 @@ void CalculationBlock::doEvaluation (AqlItemBlock* result) {
|
|||
[&]() -> void {
|
||||
// must invalidate the expression now as we might be called from
|
||||
// different threads
|
||||
if (ExecutionEngine::isDBServer()) {
|
||||
if (ExecutionEngine::isDBServer() || ExecutionEngine::isCoordinator()) {
|
||||
_expression->invalidate();
|
||||
}
|
||||
engine->getQuery()->exitContext();
|
||||
|
|
|
@ -82,6 +82,7 @@ Expression::Expression (Ast* ast,
|
|||
Expression::~Expression () {
|
||||
if (_type == V8) {
|
||||
delete _func;
|
||||
_func = nullptr;
|
||||
}
|
||||
else if (_type == JSON) {
|
||||
TRI_ASSERT(_data != nullptr);
|
||||
|
|
Loading…
Reference in New Issue