1
0
Fork 0

Implement the option to enter Subqueries first in the ExecutionBlock Walker too

(as in #d2a15253b0805ce2624eac4a44bb66b15c34a21e for the ExecutionNode)
This commit is contained in:
Willi Goesgens 2014-10-17 13:36:40 +02:00
parent d508812ec3
commit 1a80e19702
2 changed files with 17 additions and 3 deletions

View File

@ -179,6 +179,19 @@ bool ExecutionBlock::walk (WalkerWorker<ExecutionBlock>* worker) {
return true;
}
// Now handle a subquery:
if ((_exeNode->getType() == ExecutionNode::SUBQUERY) &&
worker->EnterSubQueryFirst()) {
auto p = static_cast<SubqueryBlock*>(this);
if (worker->enterSubquery(this, p->getSubquery())) {
bool abort = p->getSubquery()->walk(worker);
worker->leaveSubquery(this, p->getSubquery());
if (abort) {
return true;
}
}
}
// Now the children in their natural order:
for (auto c : _dependencies) {
if (c->walk(worker)) {
@ -186,7 +199,8 @@ bool ExecutionBlock::walk (WalkerWorker<ExecutionBlock>* worker) {
}
}
// Now handle a subquery:
if (_exeNode->getType() == ExecutionNode::SUBQUERY) {
if ((_exeNode->getType() == ExecutionNode::SUBQUERY) &&
! worker->EnterSubQueryFirst()) {
auto p = static_cast<SubqueryBlock*>(this);
if (worker->enterSubquery(this, p->getSubquery())) {
bool abort = p->getSubquery()->walk(worker);

View File

@ -529,7 +529,7 @@ bool ExecutionNode::walk (WalkerWorker<ExecutionNode>* worker) {
}
// Now handle a subquery:
if ((getType() == SUBQUERY) && worker->EnterSubQueryFirst()){
if ((getType() == SUBQUERY) && worker->EnterSubQueryFirst()) {
auto p = static_cast<SubqueryNode*>(this);
if (worker->enterSubquery(this, p->getSubquery())) {
bool abort = p->getSubquery()->walk(worker);
@ -550,7 +550,7 @@ bool ExecutionNode::walk (WalkerWorker<ExecutionNode>* worker) {
}
// Now handle a subquery:
if ((getType() == SUBQUERY) && ! worker->EnterSubQueryFirst()){
if ((getType() == SUBQUERY) && ! worker->EnterSubQueryFirst()) {
auto p = static_cast<SubqueryNode*>(this);
if (worker->enterSubquery(this, p->getSubquery())) {
bool abort = p->getSubquery()->walk(worker);