summaryrefslogtreecommitdiff
path: root/ext/pdo_pgsql/pgsql_statement.c
diff options
context:
space:
mode:
authorMatteo Beccati <mbeccati@php.net>2020-08-31 10:45:36 +0200
committerMatteo Beccati <mbeccati@php.net>2020-08-31 11:02:34 +0200
commitee2506cc027c97c86db51173ec7019c58b161204 (patch)
treeceafe73102c7b86da0b961f8edbf13cbb2eb9387 /ext/pdo_pgsql/pgsql_statement.c
parentad97739eac2f054d4ce3c3f492fefb0daaabaa25 (diff)
downloadphp-git-ee2506cc027c97c86db51173ec7019c58b161204.tar.gz
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).
Diffstat (limited to 'ext/pdo_pgsql/pgsql_statement.c')
-rw-r--r--ext/pdo_pgsql/pgsql_statement.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c
index 0edb3d7f8e..88031622a4 100644
--- a/ext/pdo_pgsql/pgsql_statement.c
+++ b/ext/pdo_pgsql/pgsql_statement.c
@@ -397,7 +397,7 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *
}
break;
}
- } else if (param->is_param) {
+ } else if (param->is_param && event_type == PDO_PARAM_EVT_NORMALIZE) {
/* We need to manually convert to a pg native boolean value */
if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_BOOL &&
((param->param_type & PDO_PARAM_INPUT_OUTPUT) != PDO_PARAM_INPUT_OUTPUT)) {