1
0
Fork 0
This commit is contained in:
Jan Steemann 2014-08-01 11:57:19 +02:00
parent 2881409527
commit 0ec4e7f73e
1 changed files with 7 additions and 9 deletions

View File

@ -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"
@ -175,25 +176,22 @@ QueryResult Query::execute () {
auto plan = ExecutionPlan::instanciateFromAst(parser.ast());
try {
auto exec = ExecutionBlock::instanciatePlan(plan);
auto engine = ExecutionEngine::instanciateFromPlan(plan->root());
try {
exec->staticAnalysis();
exec->initialize();
exec->execute();
auto root = engine->root();
root->execute();
AqlItemBlock* value;
while (nullptr != (value = exec->getOne())) {
while (nullptr != (value = root->getOne())) {
std::cout << value->getValue(0, 0)->toString() << std::endl;
delete value;
}
exec->shutdown();
delete exec;
delete engine;
}
catch (...) {
delete exec;
delete engine;
delete plan;
// TODO: convert exception code
return QueryResult(TRI_ERROR_INTERNAL);