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