Welcome Guest, Not a member yet? Register   Sign In
CI 2.0 transaction testmode bug
#1

[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.


Messages In This Thread
CI 2.0 transaction testmode bug - by El Forum - 07-28-2010, 02:30 PM
CI 2.0 transaction testmode bug - by El Forum - 08-02-2010, 01:51 PM



Theme © iAndrew 2016 - Forum software by © MyBB