Bug #80871 [NEW]: PDO::inTransactional() always return false (Yii2)
| From: | sevak754 at gmail dot com | Date: | Tue, 16 Mar 2021 08:39:41 +0000 |
| Subject: | Bug #80871 [NEW]: PDO::inTransactional() always return false (Yii2) | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-232763@lists.php.net to get a copy of this message | ||
From: sevak754 at gmail dot com
Operating system: Linux
PHP version: 8.0.3
Package: PDO related
Bug Type: Bug
Bug description:PDO::inTransactional() always return false (Yii2)
Description:
------------
I've tried to begin transaction with Yii2, but it didn't commit. It
happened because here yiisoft/yii2/db/Transaction.php:168 is
PDO::inTransactional() check and he always return false. This problem
appeared after update to php 8.
I use MSSQL and I think there is a problem with driver.
Test script:
---------------
if ($this->_level === 0) {
Yii::debug('Commit transaction', __METHOD__);
// make sure the transaction wasn't autocommitted
if ($this->db->pdo->inTransaction()) { // always false
$this->db->pdo->commit();
}
$this->db->trigger(Connection::EVENT_COMMIT_TRANSACTION);
return;
}
Expected result:
----------------
Transaction has been commited
Actual result:
--------------
Transaction has been rollbacked
--
Edit bug report at https://bugs.php.net/bug.php?id=80871&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80871&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80871&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80871&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80871&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80871&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80871&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80871&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80871&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80871&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80871&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80871&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80871&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80871&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80871&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80871&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80871&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80871&r=mysqlcfg