diff --git a/arangod/RocksDBEngine/RocksDBIterators.cpp b/arangod/RocksDBEngine/RocksDBIterators.cpp index ab202fe96f..19c48d922a 100644 --- a/arangod/RocksDBEngine/RocksDBIterators.cpp +++ b/arangod/RocksDBEngine/RocksDBIterators.cpp @@ -102,7 +102,7 @@ bool RocksDBAllIndexIterator::nextDocument( IndexIterator::DocumentCallback const& cb, size_t limit) { TRI_ASSERT(_trx->state()->isRunning()); - if (limit == 0 || !_iterator->Valid()) { + if (limit == 0 || !_iterator->Valid() || outOfRange()) { // No limit no data, or we are actually done. The last call should have // returned false TRI_ASSERT(limit > 0); // Someone called with limit == 0. Api broken @@ -115,7 +115,7 @@ bool RocksDBAllIndexIterator::nextDocument( --limit; _iterator->Next(); - if (!_iterator->Valid()) { + if (!_iterator->Valid() || outOfRange()) { return false; } }