New Drupal\Core\Database\StatementWrapperIterator and Drupal\Core\Database\StatementPrefetchIterator classes are introduced, implementing \Iterator (instead of \IteratorAggregate) so that iteration on the statement object is kept in sync with the underlying client statement resultset cursor (net of the usage of \PDO::MYSQL_ATTR_USE_BUFFERED_QUERY which is a PDO-only feature, other drivers do not necessarily have that).
The implementation of \Iterator methods (valid(), next(), current(), rewind(), etc) is concentrated in a self-contained trait used by both new classes. It's recommended not to use \Iterator methods directly in consuming code.
Core MySql, PostgreSql and SQLite database drivers implement the new classes.
Drupal\Core\Database\StatementWrapper and Drupal\Core\Database\StatementPrefetch have been deprecated for removal in D11.