Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix a CI_DB_pdo_driver::trans_commit() bug

  • Loading branch information...
commit 80144bf2badfa992eaef71337e1557209817027c 1 parent ea09a8a
@narfbg narfbg authored
View
29 system/database/drivers/pdo/pdo_driver.php
@@ -290,13 +290,8 @@ protected function _execute($sql)
*/
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 @@ public function trans_begin($test_mode = FALSE)
*/
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 @@ public function trans_commit()
*/
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();
}
// --------------------------------------------------------------------
View
1  user_guide_src/source/changelog.rst
@@ -199,6 +199,7 @@ Bug fixes for 3.0
- Fixed a bug (#1242) - read_dir() in the :doc:`Zip Library <libraries/zip>` wasn't compatible with Windows.
- Fixed a bug (#306) - ODBC driver didn't have an _insert_batch() method, which resulted in fatal error being triggered when insert_batch() is used with it.
- Fixed a bug in MSSQL and SQLSrv's _truncate() where the TABLE keyword was missing.
+- Fixed a bug in PDO's trans_commit() method where it failed due to an erroneous property name.
Version 2.1.1
=============
Please sign in to comment.
Something went wrong with that request. Please try again.