summaryrefslogtreecommitdiff
path: root/ext/pdo_pgsql/pgsql_statement.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-12-10 16:03:22 +0100
committerNikita Popov <nikita.ppv@gmail.com>2020-12-10 16:04:33 +0100
commita5527577e7e80dbaf4e0313c1bfc890b2cc5f3b7 (patch)
treee0fc36e2b30144e04794d53c95300709dc35a47f /ext/pdo_pgsql/pgsql_statement.c
parent15b51a215ac08fa72aa6ea44755f7134710f9004 (diff)
downloadphp-git-a5527577e7e80dbaf4e0313c1bfc890b2cc5f3b7.tar.gz
Allow drivers to omit error code
And thus generate error messages that match what PDO emulation would generate. This fixes the error message regression from the previous commit.
Diffstat (limited to 'ext/pdo_pgsql/pgsql_statement.c')
-rw-r--r--ext/pdo_pgsql/pgsql_statement.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c
index 149e1e6b51..21f4c83807 100644
--- a/ext/pdo_pgsql/pgsql_statement.c
+++ b/ext/pdo_pgsql/pgsql_statement.c
@@ -282,8 +282,7 @@ 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_pgsql_error_stmt_msg(
- stmt, PGRES_FATAL_ERROR, "HY093", ZSTR_VAL(param->name));
+ pdo_pgsql_error_stmt_msg(stmt, 0, "HY093", ZSTR_VAL(param->name));
return 0;
}
}
@@ -295,8 +294,7 @@ 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_pgsql_error_stmt_msg(
- stmt, PGRES_FATAL_ERROR, "HY093", "parameter was not defined");
+ pdo_pgsql_error_stmt_msg(stmt, 0, "HY093", "parameter was not defined");
return 0;
}
case PDO_PARAM_EVT_EXEC_POST: