1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Optimized error handling

This commit is contained in:
SakiTakamachi
2023-11-22 19:48:10 +09:00
committed by Gina Peter Banyard
parent 54b12bcdb4
commit 04f8c1bda8

View File

@@ -844,7 +844,7 @@ static int php_firebird_alloc_prepare_stmt(pdo_dbh_t *dbh, const zend_string *sq
/* Firebird allows SQL statements up to 64k, so bail if it doesn't fit */
if (ZSTR_LEN(sql) > 65536) {
strcpy(dbh->error_code, "01004");
php_firebird_error_with_info(dbh, "01004", strlen("01004"), NULL, 0);
return 0;
}
@@ -869,7 +869,7 @@ static int php_firebird_alloc_prepare_stmt(pdo_dbh_t *dbh, const zend_string *sq
new_sql = emalloc(ZSTR_LEN(sql)+1);
new_sql[0] = '\0';
if (!php_firebird_preprocess(sql, new_sql, named_params)) {
strcpy(dbh->error_code, "07000");
php_firebird_error_with_info(dbh, "07000", strlen("07000"), NULL, 0);
efree(new_sql);
return 0;
}