![]() |
CI 2.0 transaction testmode bug - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: CI 2.0 transaction testmode bug (/showthread.php?tid=32612) |
CI 2.0 transaction testmode bug - El Forum - 07-28-2010 [eluser]diostm[/eluser] Hello! I don't now, is it bug or not, but anyway, I decide to report it: When I execute code: Code: <?php Query have to be rolled back automatically, when I pass TRUE, but it don't I watch several time the sources of CodeIgniter and find out, that in file system/database/drivers/mysql/mysql_driver.php Line #216 of mysql_driver.php, contains Code: $this->_trans_failure = ($test_mode === TRUE) ? TRUE : FALSE; I replaced it with a line: Code: $this->_trans_status = ($test_mode === FALSE) ? $this->_trans_status : FALSE; Now all seems to be OK. I hope you'll find this information useful. CI 2.0 transaction testmode bug - El Forum - 08-02-2010 [eluser]WanWizard[/eluser] That is not the issue. In the drivers, $this->_trans_failure is used to force a failure of the transaction, and therefore a rollback. This rollback is performed in DB_driver.php: Code: // The query() function will set this flag to FALSE in the event that a query failed This should be: Code: // The query() function will set this flag to FALSE in the event that a query failed |