diff --git a/system/drivers/DB_mysql.php b/system/drivers/DB_mysql.php
index 69a6db0..208f09c 100644
--- a/system/drivers/DB_mysql.php
+++ b/system/drivers/DB_mysql.php
@@ -123,7 +123,7 @@
 	 * @access	public
 	 * @return	bool		 
 	 */	
-	function trans_begin()
+	function trans_begin($test_mode = FALSE)
 	{
 		if ( ! $this->trans_enabled)
 		{
@@ -136,6 +136,11 @@
 			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;