Remove DB2 support
[lhc/web/wiklou.git] / includes / db / Database.php
index 7e865c1..ff2f7f7 100644 (file)
@@ -62,9 +62,10 @@ interface DatabaseType {
         * Fetch the next row from the given result object, in object form.
         * Fields can be retrieved with $row->fieldname, with fields acting like
         * member variables.
+        * If no more rows are available, false is returned.
         *
         * @param $res ResultWrapper|object as returned from DatabaseBase::query(), etc.
-        * @return Row object
+        * @return object|bool
         * @throws DBUnexpectedError Thrown if the database returns an error
         */
        function fetchObject( $res );
@@ -72,9 +73,10 @@ interface DatabaseType {
        /**
         * Fetch the next row from the given result object, in associative array
         * form.  Fields are retrieved with $row['fieldname'].
+        * If no more rows are available, false is returned.
         *
         * @param $res ResultWrapper result object as returned from DatabaseBase::query(), etc.
-        * @return Row object
+        * @return array|bool
         * @throws DBUnexpectedError Thrown if the database returns an error
         */
        function fetchRow( $res );
@@ -726,7 +728,7 @@ abstract class DatabaseBase implements DatabaseType {
         */
        final public static function factory( $dbType, $p = array() ) {
                $canonicalDBTypes = array(
-                       'mysql', 'postgres', 'sqlite', 'oracle', 'mssql', 'ibm_db2'
+                       'mysql', 'postgres', 'sqlite', 'oracle', 'mssql'
                );
                $dbType = strtolower( $dbType );
                $class = 'Database' . ucfirst( $dbType );
@@ -3013,18 +3015,18 @@ abstract class DatabaseBase implements DatabaseType {
 
                if ( $this->mTrxLevel ) { // implicit commit
                        if ( !$this->mTrxAutomatic ) {
-                               // We want to warn about inadvertently nested begin/commit pairs, but not about auto-committing
-                               // implicit transactions that were started by query() because DBO_TRX was set.
-
-                               wfWarn( "$fname: Transaction already in progress (from {$this->mTrxFname}), " .
-                                       " performing implicit commit!" );
+                               // We want to warn about inadvertently nested begin/commit pairs, but not about
+                               // auto-committing implicit transactions that were started by query() via DBO_TRX
+                               $msg = "$fname: Transaction already in progress (from {$this->mTrxFname}), " .
+                                       " performing implicit commit!";
+                               wfWarn( $msg );
+                               wfLogDBError( $msg );
                        } else {
                                // if the transaction was automatic and has done write operations,
                                // log it if $wgDebugDBTransactions is enabled.
-
                                if ( $this->mTrxDoneWrites && $wgDebugDBTransactions ) {
-                                       wfDebug( "$fname: Automatic transaction with writes in progress (from {$this->mTrxFname}), " .
-                                               " performing implicit commit!\n" );
+                                       wfDebug( "$fname: Automatic transaction with writes in progress" .
+                                               " (from {$this->mTrxFname}), performing implicit commit!\n" );
                                }
                        }