summaryrefslogtreecommitdiff
path: root/ext/pdo_pgsql/pgsql_statement.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-12-10 15:51:17 +0100
committerNikita Popov <nikita.ppv@gmail.com>2020-12-10 15:53:23 +0100
commit15b51a215ac08fa72aa6ea44755f7134710f9004 (patch)
tree3d0889e9df957283e4d4d785a68505243f73a3c9 /ext/pdo_pgsql/pgsql_statement.c
parentdde5572937e8165abac5fbaa2c4fbb85d7e391b2 (diff)
downloadphp-git-15b51a215ac08fa72aa6ea44755f7134710f9004.tar.gz
Fixed bug #79131
When a driver reports an error during EVT_ALLOC (and some over EVTs), make sure we handle it as usual, i.e. warn or throw. This requires some adjustments in PDO PgSQL to stop manually doing this through an impl error. Unfortunately the PDO PgSQL error messages regress because of this, as they now include a completely arbitrary error code. There doesn't seem to be an ability to skip it right now.
Diffstat (limited to 'ext/pdo_pgsql/pgsql_statement.c')
-rw-r--r--ext/pdo_pgsql/pgsql_statement.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c
index 88031622a4..149e1e6b51 100644
--- a/ext/pdo_pgsql/pgsql_statement.c
+++ b/ext/pdo_pgsql/pgsql_statement.c
@@ -282,7 +282,8 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *
ZEND_ATOL(param->paramno, namevar + 1);
param->paramno--;
} else {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY093", ZSTR_VAL(param->name));
+ pdo_pgsql_error_stmt_msg(
+ stmt, PGRES_FATAL_ERROR, "HY093", ZSTR_VAL(param->name));
return 0;
}
}
@@ -294,7 +295,8 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *
return 1;
}
if (!zend_hash_index_exists(stmt->bound_param_map, param->paramno)) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "parameter was not defined");
+ pdo_pgsql_error_stmt_msg(
+ stmt, PGRES_FATAL_ERROR, "HY093", "parameter was not defined");
return 0;
}
case PDO_PARAM_EVT_EXEC_POST: