diff options
author | admin <devnull@localhost> | 2006-09-24 03:12:22 +0200 |
---|---|---|
committer | admin <devnull@localhost> | 2006-09-24 03:12:22 +0200 |
commit | 8b180be71430efa5726389ee03107d1cadd52626 (patch) | |
tree | 8391c99bf8afdf1e57871766cd50cdfd6ee684e2 /system/drivers/DB_mysql.php | |
parent | 7d8a3c7a5de132cd540b637753f10333694b9420 (diff) |
Diffstat (limited to 'system/drivers/DB_mysql.php')
-rw-r--r-- | system/drivers/DB_mysql.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/system/drivers/DB_mysql.php b/system/drivers/DB_mysql.php index 69a6db0eb..208f09c25 100644 --- a/system/drivers/DB_mysql.php +++ b/system/drivers/DB_mysql.php @@ -123,7 +123,7 @@ class CI_DB_mysql extends CI_DB { * @access public * @return bool */ - function trans_begin() + function trans_begin($test_mode = FALSE) { if ( ! $this->trans_enabled) { @@ -136,6 +136,11 @@ class CI_DB_mysql extends CI_DB { return TRUE; } + // Reset the transaction failure flag. + // If the $test_mode flag is set to TRUE transactions will be rolled back + // even if the queries produce a successful result. + $this->_trans_failure = ($test_mode === TRUE) ? TRUE : FALSE; + $this->simple_query('SET AUTOCOMMIT=0'); $this->simple_query('START TRANSACTION'); // can also be BEGIN or BEGIN WORK return TRUE; |