* In selectField(), use reset($row) instead of $row[0] for compatibility with SQLite
authorTim Starling <tstarling@users.mediawiki.org>
Fri, 9 Jan 2009 03:53:28 +0000 (03:53 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Fri, 9 Jan 2009 03:53:28 +0000 (03:53 +0000)
* Non-broken (no-op) implementation of DatabaseSqlite::deadlockLoop(). Fixes bug 16123: total breakage of Special:Import on SQLite.

includes/db/Database.php
includes/db/DatabaseSqlite.php

index e4c41a8..84b8864 100644 (file)
@@ -922,7 +922,7 @@ class Database {
                $row = $this->fetchRow( $res );
                if ( $row !== false ) {
                        $this->freeResult( $res );
-                       return $row[0];
+                       return reset( $row );
                } else {
                        return false;
                }
index 814f9bc..dfc506c 100644 (file)
@@ -410,6 +410,14 @@ class DatabaseSqlite extends Database {
                return "SearchEngineDummy";
        }
 
+       /**
+        * No-op version of deadlockLoop
+        */
+       public function deadlockLoop( /*...*/ ) {
+               $args = func_get_args();
+               $function = array_shift( $args );
+               return call_user_func_array( $function, $args );
+       }
 }
 
 /**