summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-04-06 21:19:26 +0200
committerAndrey Andreev <narf@bofh.bg>2012-04-06 21:19:26 +0200
commit80144bf2badfa992eaef71337e1557209817027c (patch)
tree52709f93819fb29b17b4cf4a3e3523e0ad6b0bc5 /system
parentea09a8a5552f2aacdeab0c88a605fe44047ebd0a (diff)
Fix a CI_DB_pdo_driver::trans_commit() bug
Diffstat (limited to 'system')
-rw-r--r--system/database/drivers/pdo/pdo_driver.php29
1 files changed, 5 insertions, 24 deletions
diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php
index 919bb9c00..13ecb24a1 100644
--- a/system/database/drivers/pdo/pdo_driver.php
+++ b/system/database/drivers/pdo/pdo_driver.php
@@ -290,13 +290,8 @@ class CI_DB_pdo_driver extends CI_DB {
*/
public function trans_begin($test_mode = FALSE)
{
- if ( ! $this->trans_enabled)
- {
- return TRUE;
- }
-
// When transactions are nested we only begin/commit/rollback the outermost ones
- if ($this->_trans_depth > 0)
+ if ( ! $this->trans_enabled OR $this->_trans_depth > 0)
{
return TRUE;
}
@@ -318,20 +313,13 @@ class CI_DB_pdo_driver extends CI_DB {
*/
public function trans_commit()
{
- if ( ! $this->trans_enabled)
- {
- return TRUE;
- }
-
// When transactions are nested we only begin/commit/rollback the outermost ones
- if ($this->_trans_depth > 0)
+ if ( ! $this->trans_enabled OR $this->_trans_depth > 0)
{
return TRUE;
}
- $ret = $this->conn->commit();
-
- return $ret;
+ return $this->conn_id->commit();
}
// --------------------------------------------------------------------
@@ -343,20 +331,13 @@ class CI_DB_pdo_driver extends CI_DB {
*/
public function trans_rollback()
{
- if ( ! $this->trans_enabled)
- {
- return TRUE;
- }
-
// When transactions are nested we only begin/commit/rollback the outermost ones
- if ($this->_trans_depth > 0)
+ if ( ! $this->trans_enabled OR $this->_trans_depth > 0)
{
return TRUE;
}
- $ret = $this->conn_id->rollBack();
-
- return $ret;
+ return $this->conn_id->rollBack();
}
// --------------------------------------------------------------------