mirror of https://gitee.com/bigwinds/arangodb
Fixed issue where ExecutionBlockImpl returns DONE, although there are still rows in the DataRange
This commit is contained in:
parent
8307d15ed6
commit
c973149078
|
@ -124,20 +124,6 @@ std::pair<ExecutorState, ShadowAqlItemRow> AqlItemBlockInputRange::nextShadowRow
|
||||||
}
|
}
|
||||||
// Advance the current row.
|
// Advance the current row.
|
||||||
_rowIndex++;
|
_rowIndex++;
|
||||||
/*
|
|
||||||
{
|
|
||||||
std::string out = "Depths: [";
|
|
||||||
for (auto const& it : shadowRowIndexes) {
|
|
||||||
ShadowAqlItemRow sr(_block, it);
|
|
||||||
out += std::to_string(sr.getDepth()) + ", ";
|
|
||||||
}
|
|
||||||
LOG_DEVEL << out << "]";
|
|
||||||
|
|
||||||
VPackBuilder hund;
|
|
||||||
_block->toSimpleVPack(nullptr, hund);
|
|
||||||
LOG_DEVEL << hund.toJson();
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@ -174,4 +160,4 @@ ExecutorState AqlItemBlockInputRange::nextState() const noexcept {
|
||||||
}
|
}
|
||||||
return ExecutorState::DONE;
|
return ExecutorState::DONE;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1009,6 +1009,12 @@ ExecutionBlockImpl<FilterExecutor>::executeWithoutTrace(AqlCallStack stack) {
|
||||||
// TODO: Need to make this member variable for waiting?
|
// TODO: Need to make this member variable for waiting?
|
||||||
AqlCall myCall = stack.popCall();
|
AqlCall myCall = stack.popCall();
|
||||||
ExecState execState = ::NextState(myCall);
|
ExecState execState = ::NextState(myCall);
|
||||||
|
if (_lastRange.hasShadowRow()) {
|
||||||
|
// We have not been able to move all shadowRows into the output last time.
|
||||||
|
// Continue from there.
|
||||||
|
// TODO test if this works with COUNT COLLECT
|
||||||
|
execState = ExecState::SHADOWROWS;
|
||||||
|
}
|
||||||
AqlCall executorRequest;
|
AqlCall executorRequest;
|
||||||
|
|
||||||
while (execState != ExecState::DONE) {
|
while (execState != ExecState::DONE) {
|
||||||
|
@ -1088,17 +1094,20 @@ ExecutionBlockImpl<FilterExecutor>::executeWithoutTrace(AqlCallStack stack) {
|
||||||
TRI_ASSERT(_outputItemRow->produced());
|
TRI_ASSERT(_outputItemRow->produced());
|
||||||
_outputItemRow->advanceRow();
|
_outputItemRow->advanceRow();
|
||||||
if (state == ExecutorState::DONE) {
|
if (state == ExecutorState::DONE) {
|
||||||
// Right now we cannot support to have more than one set of
|
if (_lastRange.hasMore()) {
|
||||||
// ShadowRows inside of a Range.
|
// TODO this state is invalid, and can just show up now if we exclude SKIP
|
||||||
// We do not know how to continue with the above executor after a shadowrow.
|
execState = ExecState::PRODUCE;
|
||||||
execState = ExecState::DONE;
|
} else {
|
||||||
|
// Right now we cannot support to have more than one set of
|
||||||
|
// ShadowRows inside of a Range.
|
||||||
|
// We do not know how to continue with the above executor after a shadowrow.
|
||||||
|
TRI_ASSERT(!_lastRange.hasMore());
|
||||||
|
execState = ExecState::DONE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
execState = ExecState::DONE;
|
execState = ExecState::DONE;
|
||||||
}
|
}
|
||||||
// TRI_ASSERT(false);
|
|
||||||
// execState = ::NextState(myCall);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@ -1111,7 +1120,7 @@ ExecutionBlockImpl<FilterExecutor>::executeWithoutTrace(AqlCallStack stack) {
|
||||||
// This is not strictly necessary here, as we shouldn't be called again
|
// This is not strictly necessary here, as we shouldn't be called again
|
||||||
// after DONE.
|
// after DONE.
|
||||||
_outputItemRow.reset();
|
_outputItemRow.reset();
|
||||||
if (_lastRange.hasMore()) {
|
if (_lastRange.hasMore() || _lastRange.hasShadowRow()) {
|
||||||
return {ExecutionState::HASMORE, skipped, std::move(outputBlock)};
|
return {ExecutionState::HASMORE, skipped, std::move(outputBlock)};
|
||||||
}
|
}
|
||||||
return {_upstreamState, skipped, std::move(outputBlock)};
|
return {_upstreamState, skipped, std::move(outputBlock)};
|
||||||
|
|
|
@ -101,10 +101,10 @@ class SingleRowFetcher {
|
||||||
template <BlockPassthrough allowPass = blockPassthrough, typename = std::enable_if_t<allowPass == BlockPassthrough::Enable>>
|
template <BlockPassthrough allowPass = blockPassthrough, typename = std::enable_if_t<allowPass == BlockPassthrough::Enable>>
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
#else
|
#else
|
||||||
[[nodiscard]]
|
[[nodiscard]] TEST_VIRTUAL
|
||||||
TEST_VIRTUAL
|
|
||||||
#endif
|
#endif
|
||||||
std::pair<ExecutionState, SharedAqlItemBlockPtr> fetchBlockForPassthrough(size_t atMost);
|
std::pair<ExecutionState, SharedAqlItemBlockPtr>
|
||||||
|
fetchBlockForPassthrough(size_t atMost);
|
||||||
|
|
||||||
[[nodiscard]] std::pair<ExecutionState, size_t> preFetchNumberOfRows(size_t atMost);
|
[[nodiscard]] std::pair<ExecutionState, size_t> preFetchNumberOfRows(size_t atMost);
|
||||||
|
|
||||||
|
@ -172,6 +172,6 @@ class SingleRowFetcher {
|
||||||
|
|
||||||
[[nodiscard]] ExecutionState returnState(bool isShadowRow) const;
|
[[nodiscard]] ExecutionState returnState(bool isShadowRow) const;
|
||||||
};
|
};
|
||||||
} // namespace arangodb
|
} // namespace arangodb::aql
|
||||||
|
|
||||||
#endif // ARANGOD_AQL_SINGLE_ROW_FETCHER_H
|
#endif // ARANGOD_AQL_SINGLE_ROW_FETCHER_H
|
||||||
|
|
Loading…
Reference in New Issue