1
0
Fork 0

Fix SubqueryStartExecutor (#10488)

fetchRow must not be called with `atMost == 0`, which can happen if
output.numRowsLeft() == 1.
This commit is contained in:
Markus Pfeiffer 2019-11-21 08:04:33 +00:00 committed by Michael Hackstein
parent f42dd86b25
commit 688a680023
1 changed files with 2 additions and 1 deletions

View File

@ -60,7 +60,8 @@ std::pair<ExecutionState, NoStats> SubqueryStartExecutor::produceRows(OutputAqlI
output.createShadowRow(_input);
_input = InputAqlItemRow(CreateInvalidInputRowHint{});
} else {
std::tie(_state, _input) = _fetcher.fetchRow(output.numRowsLeft() / 2);
// We need to round the number of rows, otherwise this might be called with atMost == 0
std::tie(_state, _input) = _fetcher.fetchRow((output.numRowsLeft() + 1) / 2);
if (!_input.isInitialized()) {
TRI_ASSERT(_state == ExecutionState::WAITING || _state == ExecutionState::DONE);
return {_state, NoStats{}};