From 15b51a215ac08fa72aa6ea44755f7134710f9004 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 10 Dec 2020 15:51:17 +0100 Subject: 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. --- ext/pdo_pgsql/pgsql_statement.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ext/pdo_pgsql/pgsql_statement.c') 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: -- cgit v1.2.1