[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
$this->db->trans_start(TRUE); // Query will be rolled back
$this->db->query("INSERT INTO menus VALUES(NULL,'Yahoo!','http://yahoo.com',NULL)");
# $this->db->query("INSERT INTO menus VALUES(NULL,NULL,NULL,NULL)");//this string is commented out
$this->db->trans_complete();
?>
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.