Skip to content

Commit a1be606

Browse files
committed
Optimized error handling
1 parent 8abbdc2 commit a1be606

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ext/pdo_firebird/firebird_driver.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,7 @@ static int php_firebird_alloc_prepare_stmt(pdo_dbh_t *dbh, const zend_string *sq
845845
/* Firebird allows SQL statements up to 64k, so bail if it doesn't fit */
846846
if (ZSTR_LEN(sql) > 65536) {
847847
strcpy(dbh->error_code, "01004");
848+
php_firebird_error_with_info(dbh, "01004", strlen("01004"), NULL, 0);
848849
return 0;
849850
}
850851

@@ -869,7 +870,7 @@ static int php_firebird_alloc_prepare_stmt(pdo_dbh_t *dbh, const zend_string *sq
869870
new_sql = emalloc(ZSTR_LEN(sql)+1);
870871
new_sql[0] = '\0';
871872
if (!php_firebird_preprocess(sql, new_sql, named_params)) {
872-
strcpy(dbh->error_code, "07000");
873+
php_firebird_error_with_info(dbh, "07000", strlen("07000"), NULL, 0);
873874
efree(new_sql);
874875
return 0;
875876
}

0 commit comments

Comments
 (0)