From 6c85442746c46009cdf3fe517465e174a91cc4c5 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 21 Oct 2013 13:58:15 +0300 Subject: Fix #2691 --- system/database/DB_driver.php | 9 ++++++++- user_guide_src/source/changelog.rst | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index 618f3660c..9aa6c5de5 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -624,7 +624,14 @@ abstract class CI_DB_driver { // if transactions are enabled. If we don't call this here // the error message will trigger an exit, causing the // transactions to remain in limbo. - $this->_trans_depth > 0 && $this->trans_complete(); + if ($this->_trans_depth !== 0) + { + do + { + $this->trans_complete(); + } + while ($this->_trans_depth !== 0); + } // Display errors return $this->display_error(array('Error Number: '.$error['code'], $error['message'], $sql)); diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 8c992a575..9f6feb744 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -619,6 +619,7 @@ Bug fixes for 3.0 - Fixed a bug in the 'postgre' :doc:`database ` driver where the connection ID wasn't passed to ``pg_escape_string()``. - Fixed a bug (#33) - Script execution was terminated when an invalid cookie key was encountered. - Fixed a bug (#2681) - ``CI_Security::entity_decode()`` used the `PREG_REPLACE_EVAL` flag, which is deprecated since PHP 5.5. +- Fixed a bug (#2691) - nested transactions could end in a deadlock when an error is encountered with *db_debug* set to TRUE. Version 2.1.4 ============= -- cgit v1.2.3-24-g4f1b