[GIT-PULLS] [php-src] PR #23065: ext/pdo_pgsql: Drain the connection when a lazy fetch ends
[email protected] (KentarouTakeda)
| Newsgroups | php.git-pulls |
|---|---|
| Message-ID | <[email protected]> |
Pull Request: https://github.com/php/php-src/pull/23065 Author: KentarouTakeda With the lazy fetch added in 8.5 (`PDO::ATTR_PREFETCH => 0`), the next lazy fetch on the same connection can fail with `SQLSTATE[HY000]: another command is already in progress`, whether the previous one was read to the end or discarded halfway. It only happens with `ATTR_EMULATE_PREPARES` or `ATTR_DISABLE_PREPARES`. Both endings go through the same cleanup, which reads the rest of the result set only while the statement is flagged as streaming. Both cleared that flag first, so the cleanup did nothing. With a prepared statement, closing it afterwards clears the state. Remove the two assignments and let the cleanup clear the flag once it has read the rest.