Fix #80027 Terrible performance using $query->fetch on queries with many bind parameters

Added new flags that allow skipping param_evt(s) that are not used by drivers,
in a backwards and forward compatible manner. Updated the pgsql, mysql, sqlite
and oci drivers to properly use the new flags. I've left out pdo_dblib, which
doesn't have a param_hook, and pdo_firebird, which seems to be using
PARAM_EVT_NORMALIZE in a wrong context (param type vs event type).
This commit is contained in:
Matteo Beccati 2020-08-31 10:45:36 +02:00
parent ad97739eac
commit ee2506cc02
7 changed files with 29 additions and 2 deletions

View file

@ -617,6 +617,13 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options)
dbh->driver_data = H;
dbh->skip_param_evt =
1 << PDO_PARAM_EVT_FREE |
1 << PDO_PARAM_EVT_EXEC_POST |
1 << PDO_PARAM_EVT_FETCH_PRE |
1 << PDO_PARAM_EVT_FETCH_POST |
1 << PDO_PARAM_EVT_NORMALIZE;
#ifndef PDO_USE_MYSQLND
H->max_buffer_size = 1024*1024;
#endif