diff options
author | Andrey Andreev <narf@devilix.net> | 2016-01-11 10:15:27 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2016-01-11 10:16:30 +0100 |
commit | 803cc12107f687a8ff9a19427023122b2d6b7207 (patch) | |
tree | 53e66a471e4a14e1addcd70f8a102e3cb0b9886f /system/database/DB_driver.php | |
parent | 8f7cc15c8856d312c091c33cadc75db0605a2829 (diff) |
Merge pull request #4369 from galdiolo/patch-12
Optimize transactions check in CI_DB_driver::query()
Diffstat (limited to 'system/database/DB_driver.php')
-rw-r--r-- | system/database/DB_driver.php | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index bfe9dd4b0..40e40e927 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -676,19 +676,15 @@ 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. - if ($this->_trans_depth !== 0) + while ($this->_trans_depth !== 0) { - do + $trans_depth = $this->_trans_depth; + $this->trans_complete(); + if ($trans_depth === $this->_trans_depth) { - $trans_depth = $this->_trans_depth; - $this->trans_complete(); - if ($trans_depth === $this->_trans_depth) - { - log_message('error', 'Database: Failure during an automated transaction commit/rollback!'); - break; - } + log_message('error', 'Database: Failure during an automated transaction commit/rollback!'); + break; } - while ($this->_trans_depth !== 0); } // Display errors |