[php-src] PR #16249: Fix getColumnMeta() for GH-15287 Pdo\Pgsql::setAttribute(PDO::ATTR_PREFETCH, 0)
| From: | outtersg | Date: | Sat, 05 Oct 2024 14:23:35 +0000 |
| Subject: | [php-src] PR #16249: Fix getColumnMeta() for GH-15287 Pdo\Pgsql::setAttribute(PDO::ATTR_PREFETCH, 0) | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-29032@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/16249
Author: outtersg
As stated in the UPGRADING, using the passthrough ("single-row") mode of libpq forbids
passing a new query while the current one's results have not been entirely consumed.
… But I didn't notice that ext/pdo_pgsql _internally_ used new queries to fetch metadata.
This PR makes those internal calls return NULL for non-essential metadata, instead of letting libpq
abort the user-called query.
It moreover includes a small tweak to table oid-to-name translation, with a 1-slot cache.
This may by chance allow the internal call to return something instead of NULL,
but it will nonetheless avoid 30 server calls to get the table name of 30 columns of the same table.