From 4e5ff1f7f8c1897526e9362fdcf7b574c1b3cdf9 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 5 Aug 2015 14:32:03 +0300 Subject: Fix #4026 --- system/database/DB_driver.php | 5 ++++- user_guide_src/source/changelog.rst | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index e58496de9..659664db9 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -647,7 +647,10 @@ abstract class CI_DB_driver { } // This will trigger a rollback if transactions are being used - $this->_trans_status = FALSE; + if ($this->_trans_depth !== 0) + { + $this->_trans_status = FALSE; + } // Grab the error now, as we might run some additional queries before displaying the error $error = $this->error(); diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 1b044cc5f..cfa0f69a5 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -77,6 +77,7 @@ Bug fixes for 3.0.1 - Fixed a bug (#4012) - :doc:`Query Builder ` methods ``where_in()``, ``or_where_in()``, ``where_not_in()``, ``or_where_not_in()`` didn't take into account previously cached WHERE conditions when query cache is in use. - Fixed a bug (#4015) - :doc:`Email Library ` method ``set_header()`` didn't support method chaining, although it was advertised. - Fixed a bug (#4027) - :doc:`Routing ` with HTTP verbs only worked if the route request method was declared in all-lowercase letters. +- Fixed a bug (#4026) - :doc:`Database Transactions ` always rollback if any previous ``query()`` call fails. Version 3.0.0 ============= -- cgit v1.2.3-24-g4f1b