Skip to content

Commit e96a35b

Browse files
committed
Fixed pdo_firebird_handle_factory to check ret when starting a transaction (#17632)
Changed to not execute php_firebird_begin_transaction if transaction cannot be started successfully Closes #17632
1 parent 6717947 commit e96a35b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/pdo_firebird/firebird_driver.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ static bool firebird_handle_preparer(pdo_dbh_t *dbh, zend_string *sql, /* {{{ */
684684

685685
/* make all parameters nullable */
686686
unsigned int i;
687-
XSQLVAR* var;
687+
XSQLVAR* var;
688688
for (i = 0, var = S->in_sqlda->sqlvar; i < S->in_sqlda->sqld; i++, var++) {
689689
/* The low bit of sqltype indicates that the parameter can take a NULL value */
690690
var->sqltype |= 1;
@@ -1431,7 +1431,7 @@ static int pdo_firebird_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /*
14311431
"HY000", H->isc_status[1], errmsg);
14321432
}
14331433

1434-
if (dbh->auto_commit && !H->tr) {
1434+
if (ret && dbh->auto_commit && !H->tr) {
14351435
ret = php_firebird_begin_transaction(dbh, /* auto commit mode */ true);
14361436
}
14371437

0 commit comments

Comments
 (0)