Merge branch 'PHP-7.0'

* PHP-7.0:
  Fixed bug #72570 Segmentation fault when binding parameters on a query without placeholders
  Fixed bug #70313 PDO statement fails to throw exception
This commit is contained in:
Matteo Beccati 2016-07-10 14:38:17 +02:00
commit 445cb529b2
4 changed files with 75 additions and 2 deletions

View file

@ -292,6 +292,9 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *
break;
case PDO_PARAM_EVT_ALLOC:
if (!stmt->bound_param_map) {
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");
return 0;
@ -304,7 +307,7 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *
case PDO_PARAM_EVT_EXEC_PRE:
if (!stmt->bound_param_map) {
return 0;
return 1;
}
if (!S->param_values) {
S->param_values = ecalloc(