Re: PDO fetch performance problems with many bindparameters
| From: | Christoph M. Becker | Date: | Mon, 31 Aug 2020 07:19:48 +0000 |
| Subject: | Re: PDO fetch performance problems with many bindparameters | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-111736@lists.php.net to get a copy of this message | ||
On 29.08.2020 at 09:30, Matteo Beccati wrote:
> Hi Christoph,
>
> On 28/08/2020 22:57, Christoph M. Becker wrote:
>> Can we be certain that the relevant bits of the formerly _reserved_flags
>> are zero-filled for all existing drivers?
>
> We can, that's basically the premise of the PR itself:
>
> 1. The flags are in the pdo_dbh_t struct which is the dbh->inner part
> 2. dbh->inner = ecalloc(1, sizeof(pdo_dbh_t)):
> 3. stmt->dbh is set as dbh->inner, in prepare and query
> 4. drivers can eventually set some bits to 1.
>
> A few quick links:
>
>
> https://github.com/php/php-src/blob/658f6ff2dae42c4f2b5c6f8d6adc8c8f09b52b47/ext/pdo/php_pdo_driver.h#L514
>
> https://github.com/php/php-src/blob/658f6ff2dae42c4f2b5c6f8d6adc8c8f09b52b47/ext/pdo/pdo_dbh.c#L562
>
> https://github.com/php/php-src/blob/658f6ff2dae42c4f2b5c6f8d6adc8c8f09b52b47/ext/pdo/pdo_dbh.c#L1085
>
> https://github.com/php/php-src/blob/658f6ff2dae42c4f2b5c6f8d6adc8c8f09b52b47/ext/pdo/pdo_dbh.c#L1481
Thanks! So there only would be a problem, if a driver modifies
_reserved_flags (what they're not supposed to do). Looks to be okay
then for the stable release branches.
--
Christoph M. Becker