8000 Added helper shadow row function for SideEffect executors · arangodb/arangodb@5659bc2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5659bc2

Browse files
committed
Added helper shadow row function for SideEffect executors
1 parent e6a8dcb commit 5659bc2

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

arangod/Aql/ExecutionBlockImpl.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1449,6 +1449,18 @@ auto ExecutionBlockImpl<SubqueryEndExecutor>::shadowRowForwarding() -> ExecState
14491449
}
14501450
}
14511451

1452+
template<class Executor>
1453+
auto ExecutionBlockImpl<Executor>::sideEffectShadowRowForwarding(AqlCallStack& stack) -> ExecState {
1454+
static_assert(executorHasSideEffects<Executor>);
1455+
if (!stack.needToSkipSubquery()) {
1456+
// We need to really produce things here
1457+
// fall back to original version as any other executor.
1458+
return shadowRowForwarding();
1459+
}
1460+
// TODO implemenet ShadowRowHandling
1461+
return shadowRowForwarding();
1462+
}
1463+
14521464
template <class Executor>
14531465
auto ExecutionBlockImpl<Executor>::shadowRowForwarding() -> ExecState {
14541466
TRI_ASSERT(_outputItemRow);
@@ -1999,7 +2011,9 @@ ExecutionBlockImpl<Executor>::executeWithoutTrace(AqlCallStack stack) {
19992011
}
20002012

20012013
TRI_ASSERT(!_outputItemRow->allRowsUsed());
2002-
2014+
if constexpr (executorHasSideEffects<Executor>) {
2015+
_execState = sideEffectShadowRowForwarding(stack);
2016+
}
20032017
// This may write one or more rows.
20042018
_execState = shadowRowForwarding();
20052019
if constexpr (!std::is_same_v<Executor, SubqueryEndExecutor>) {

arangod/Aql/ExecutionBlockImpl.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,14 @@ class ExecutionBlockImpl final : public ExecutionBlock {
308308

309309
void resetExecutor();
310310

311+
// Forwarding of ShadowRows if the executor has SideEffects.
312+
// This skips over ShadowRows, and counts them in the correct
313+
// position of the callStack as "skipped".
314+
// as soon as we reach a place where there is no skip
315+
// ordered in the outer shadow rows, this call
316+
// will fall back to shadowRowForwardning.
317+
[[nodiscard]] auto sideEffectShadowRowForwarding(AqlCallStack& stack) -> ExecState;
318+
311319
private:
312320
/**
313321
* @brief Used to allow the row Fetcher to access selected methods of this

0 commit comments

Comments
 (0)
0