Merge "Revert "(bug 260) Handle <pre> overflow automatically with a scroll bar""
[lhc/web/wiklou.git] / includes / db / DatabaseIbm_db2.php
index e524752..1fdcd5c 100644 (file)
@@ -2,7 +2,22 @@
 /**
  * This is the IBM DB2 database abstraction layer.
  * See maintenance/ibm_db2/README for development notes
- * and other specific information
+ * and other specific information.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
  *
  * @file
  * @ingroup Database
@@ -557,16 +572,8 @@ class DatabaseIbm_db2 extends DatabaseBase {
         * Returns success, true if already closed
         * @return bool
         */
-       public function close() {
-               $this->mOpened = false;
-               if ( $this->mConn ) {
-                       if ( $this->trxLevel() > 0 ) {
-                               $this->commit();
-                       }
-                       return db2_close( $this->mConn );
-               } else {
-                       return true;
-               }
+       protected function closeConnection() {
+               return db2_close( $this->mConn );
        }
 
        /**
@@ -577,12 +584,12 @@ class DatabaseIbm_db2 extends DatabaseBase {
        public function lastError() {
                $connerr = db2_conn_errormsg();
                if ( $connerr ) {
-                       //$this->rollback();
+                       //$this->rollback( __METHOD__ );
                        return $connerr;
                }
                $stmterr = db2_stmt_errormsg();
                if ( $stmterr ) {
-                       //$this->rollback();
+                       //$this->rollback( __METHOD__ );
                        return $stmterr;
                }
 
@@ -791,9 +798,9 @@ class DatabaseIbm_db2 extends DatabaseBase {
        protected function applySchema() {
                if ( !( $this->mSchemaSet ) ) {
                        $this->mSchemaSet = true;
-                       $this->begin();
+                       $this->begin( __METHOD__ );
                        $this->doQuery( "SET SCHEMA = $this->mSchema" );
-                       $this->commit();
+                       $this->commit( __METHOD__ );
                }
        }
 
@@ -1016,7 +1023,7 @@ class DatabaseIbm_db2 extends DatabaseBase {
                $res = true;
                // If we are not in a transaction, we need to be for savepoint trickery
                if ( !$this->mTrxLevel ) {
-                       $this->begin();
+                       $this->begin( __METHOD__ );
                }
 
                $sql = "INSERT INTO $table ( " . implode( ',', $keys ) . ' ) VALUES ';
@@ -1031,7 +1038,7 @@ class DatabaseIbm_db2 extends DatabaseBase {
                $stmt = $this->prepare( $sql );
 
                // start a transaction/enter transaction mode
-               $this->begin();
+               $this->begin( __METHOD__ );
 
                if ( !$ignore ) {
                        //$first = true;
@@ -1084,7 +1091,7 @@ class DatabaseIbm_db2 extends DatabaseBase {
                        $this->mAffectedRows = $numrowsinserted;
                }
                // commit either way
-               $this->commit();
+               $this->commit( __METHOD__ );
                $this->freePrepared( $stmt );
 
                return $res;
@@ -1426,7 +1433,7 @@ class DatabaseIbm_db2 extends DatabaseBase {
                // db2_ping() doesn't exist
                // Emulate
                $this->close();
-               $this->mConn = $this->openUncataloged( $this->mDBName, $this->mUser,
+               $this->openUncataloged( $this->mDBName, $this->mUser,
                        $this->mPassword, $this->mServer, $this->mPort );
 
                return false;