mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'aql2' of ssh://github.com/triAGENS/ArangoDB into aql2
Conflicts: arangod/Aql/Query.cpp
This commit is contained in:
commit
aa48d48755
|
@ -96,7 +96,13 @@ struct Instanciator : public ExecutionNode::WalkerWorker {
|
|||
THROW_ARANGO_EXCEPTION(TRI_ERROR_NOT_IMPLEMENTED);
|
||||
}
|
||||
}
|
||||
engine->addBlock(eb);
|
||||
try {
|
||||
engine->addBlock(eb);
|
||||
}
|
||||
catch (...) {
|
||||
delete eb;
|
||||
throw;
|
||||
}
|
||||
|
||||
// Now add dependencies:
|
||||
std::vector<ExecutionNode*> deps = en->getDependencies();
|
||||
|
@ -128,7 +134,11 @@ ExecutionEngine* ExecutionEngine::instanciateFromPlan (ExecutionNode* plan) {
|
|||
auto root = inst->root;
|
||||
delete inst;
|
||||
|
||||
root->staticAnalysis();
|
||||
root->initialize();
|
||||
|
||||
engine->_root = root;
|
||||
|
||||
}
|
||||
catch (...) {
|
||||
delete engine;
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
|
||||
#include "Aql/Query.h"
|
||||
#include "Aql/ExecutionBlock.h"
|
||||
#include "Aql/ExecutionEngine.h"
|
||||
#include "Aql/ExecutionPlan.h"
|
||||
#include "Aql/Parser.h"
|
||||
#include "Aql/V8Executor.h"
|
||||
|
@ -176,25 +177,22 @@ QueryResult Query::execute () {
|
|||
auto plan = ExecutionPlan::instanciateFromAst(parser.ast());
|
||||
|
||||
try {
|
||||
auto exec = ExecutionEngine::instanciateFromPlan(plan);
|
||||
auto engine = ExecutionEngine::instanciateFromPlan(plan->root());
|
||||
|
||||
try {
|
||||
exec->root()->staticAnalysis();
|
||||
|
||||
exec->root()->initialize();
|
||||
exec->root()->execute();
|
||||
auto root = engine->root();
|
||||
root->execute();
|
||||
|
||||
AqlItemBlock* value;
|
||||
while (nullptr != (value = exec->root()->getOne())) {
|
||||
while (nullptr != (value = root->getOne())) {
|
||||
std::cout << value->getValue(0, 0)->toString() << std::endl;
|
||||
delete value;
|
||||
}
|
||||
|
||||
exec->root()->shutdown();
|
||||
delete exec;
|
||||
delete engine;
|
||||
}
|
||||
catch (...) {
|
||||
delete exec;
|
||||
delete engine;
|
||||
delete plan;
|
||||
// TODO: convert exception code
|
||||
return QueryResult(TRI_ERROR_INTERNAL);
|
||||
|
|
Loading…
Reference in New Issue