-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Closed
Labels
Milestone
Description
Like mentioned in: #9962 there is a problem with the recognition of the end of a resultset.
Example:
There is a table with 10 entries
foreach ($query->each() as $key => $value) {
echo $key."\n";
}after it selects the 10th row it throws an exception:
Exception 'PDOException' with message 'SQLSTATE[IMSSP]:
There are no more rows in the active result set.
Since this result set is not scrollable, no more data may be retrieved.'
in vendor\yiisoft\yii2\db\DataReader.php:111
Stack trace:
#0 vendor\yiisoft\yii2\db\DataReader.php(111): PDOStatement->fetch()
#1 vendor\yiisoft\yii2\db\BatchQueryResult.php(143): yii\db\DataReader->read()
#2 vendor\yiisoft\yii2\db\BatchQueryResult.php(112): yii\db\BatchQueryResult->fetchData()
#3 commands\TestController.php(26): yii\db\BatchQueryResult->next()