diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-12-10 15:51:17 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-12-10 15:53:23 +0100 |
commit | 15b51a215ac08fa72aa6ea44755f7134710f9004 (patch) | |
tree | 3d0889e9df957283e4d4d785a68505243f73a3c9 /ext/pdo/pdo_stmt.c | |
parent | dde5572937e8165abac5fbaa2c4fbb85d7e391b2 (diff) | |
download | php-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/pdo_stmt.c')
-rw-r--r-- | ext/pdo/pdo_stmt.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index d4c6086690..68ec99160a 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -341,8 +341,8 @@ static bool really_register_bound_param(struct pdo_bound_param_data *param, pdo_ * a reference to param, as it resides in transient storage only * at this time. */ if (stmt->methods->param_hook) { - if (!stmt->methods->param_hook(stmt, param, PDO_PARAM_EVT_NORMALIZE - )) { + if (!stmt->methods->param_hook(stmt, param, PDO_PARAM_EVT_NORMALIZE)) { + PDO_HANDLE_STMT_ERR(); if (param->name) { zend_string_release_ex(param->name, 0); param->name = NULL; @@ -367,8 +367,8 @@ static bool really_register_bound_param(struct pdo_bound_param_data *param, pdo_ /* tell the driver we just created a parameter */ if (stmt->methods->param_hook) { - if (!stmt->methods->param_hook(stmt, pparam, PDO_PARAM_EVT_ALLOC - )) { + if (!stmt->methods->param_hook(stmt, pparam, PDO_PARAM_EVT_ALLOC)) { + PDO_HANDLE_STMT_ERR(); /* undo storage allocation; the hash will free the parameter * name if required */ if (pparam->name) { @@ -479,6 +479,7 @@ PHP_METHOD(PDOStatement, execute) } if (ret && !dispatch_param_event(stmt, PDO_PARAM_EVT_EXEC_POST)) { + PDO_HANDLE_STMT_ERR(); RETURN_FALSE; } |