You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While going through #926, I reviewed usage of the _transactionID property within PDO Firebird driver.
It is only accessed in _affectedrows() method when calling fbird_affected_rows(), but never actually set.
The native Firebird driver initializes it from fbird_trans()'s return value, when initializing the transaction in beginTrans().
AFAICT, it is not possible to retrieve the transaction ID using PDO functions - PDO::beginTransaction() just returns a boolean, so I believe the PDO driver should be modified like this.
public function _affectedrows()
{
- return fbird_affected_rows($this->_transactionID ? $this->_transactionID : $this->_connectionID);+ return fbird_affected_rows($this->_connectionID);
}
Surely this entire function is a copy/paste mistake because it's calling native mode functionality, fbird_affected_rows() from within the pdo driver and that function wouldn't exist. The entire function should be removed. (it doesnt exist in any other driver apart from the base class).
- _init() did not actually initialize anything useful, as the
$pdoDriver property was not used anywhere.
- _affectedrows() was likely introduced by mistake (copy/paste error
when the driver was refactored in 2019), as it references Firebird
native (non-PDO) function fbird_affected_rows(), as discussed in
ADOdb#935.
This fixes PHP 8.2 deprecation warnings due to undefined properties.
While going through #926, I reviewed usage of the
_transactionID
property within PDO Firebird driver.It is only accessed in _affectedrows() method when calling fbird_affected_rows(), but never actually set.
The native Firebird driver initializes it from fbird_trans()'s return value, when initializing the transaction in beginTrans().
AFAICT, it is not possible to retrieve the transaction ID using PDO functions - PDO::beginTransaction() just returns a boolean, so I believe the PDO driver should be modified like this.
@mnewnham thoughts ?
The text was updated successfully, but these errors were encountered: