From 07fcedf8b990633179a62ce105d84a045dacada9 Mon Sep 17 00:00:00 2001 From: Jacob Terry Date: Tue, 22 Nov 2011 11:21:36 -0500 Subject: Updated trans_start() and trans_complete() so that _trans_depth increments correctly Fix for issue #159 and #163. --- system/database/DB_driver.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index dd1b5677a..cc40ba48a 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -522,6 +522,7 @@ class CI_DB_driver { } $this->trans_begin($test_mode); + $this->_trans_depth += 1; } // -------------------------------------------------------------------- @@ -545,6 +546,10 @@ class CI_DB_driver { $this->_trans_depth -= 1; return TRUE; } + else + { + $this->_trans_depth = 0; + } // The query() function will set this flag to FALSE in the event that a query failed if ($this->_trans_status === FALSE) -- cgit v1.2.3-24-g4f1b From 66970cbc04f46072452b60a375c17610ae62b599 Mon Sep 17 00:00:00 2001 From: Jacob Terry Date: Tue, 22 Nov 2011 13:12:30 -0500 Subject: Updated changelog with _trans_depth fix. --- user_guide_src/source/changelog.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index de2b3664b..b9ca39cee 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -57,6 +57,7 @@ Bug fixes for 3.0 - Unlink raised an error if cache file did not exist when you try to delete it. - Fixed a bug (#181) where a mis-spelling was in the form validation language file. +- Fixed a bug (#159, #163) that mishandled Active Record nested transactions because _trans_depth was not getting incremented. Version 2.1.0 -- cgit v1.2.3-24-g4f1b