From 8b180be71430efa5726389ee03107d1cadd52626 Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 24 Sep 2006 01:12:22 +0000 Subject: --- system/drivers/DB_mysqli.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'system/drivers/DB_mysqli.php') diff --git a/system/drivers/DB_mysqli.php b/system/drivers/DB_mysqli.php index a5237c832..288f552dd 100644 --- a/system/drivers/DB_mysqli.php +++ b/system/drivers/DB_mysqli.php @@ -127,7 +127,7 @@ class CI_DB_mysqli extends CI_DB { * @access public * @return bool */ - function trans_begin() + function trans_begin($test_mode = FALSE) { if ( ! $this->trans_enabled) { @@ -140,6 +140,11 @@ class CI_DB_mysqli 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; -- cgit v1.2.3-24-g4f1b