LuciferYang opened a new pull request, #37471: URL: https://github.com/apache/spark/pull/37471
### What changes were proposed in this pull request? This pr add `next = null` in `LevelDBIterator.close` method to ensure `haxNext` return false and `next` throw `NoSuchElementException` after db or iterator is closed. `RocksDBIterator` has the same issue, so also fix in this pr. ### Why are the changes needed? Bug fix. Before this pr, `LevelDB/RocksDBIterator.haxNext` may return true and `LevelDB/RocksDBIterator.next` may get the value not obtained before `db/iterator` close. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? - Pass GitHub Actions - Add new test case -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
