From: Tim Starling Date: Fri, 9 Jan 2009 03:53:28 +0000 (+0000) Subject: * In selectField(), use reset($row) instead of $row[0] for compatibility with SQLite X-Git-Tag: 1.31.0-rc.0~43489 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=db22292391a4490915b0f50a27c0722537a566af;p=lhc%2Fweb%2Fwiklou.git * In selectField(), use reset($row) instead of $row[0] for compatibility with SQLite * Non-broken (no-op) implementation of DatabaseSqlite::deadlockLoop(). Fixes bug 16123: total breakage of Special:Import on SQLite. --- diff --git a/includes/db/Database.php b/includes/db/Database.php index e4c41a8951..84b886435a 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -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; } diff --git a/includes/db/DatabaseSqlite.php b/includes/db/DatabaseSqlite.php index 814f9bc2c4..dfc506ccd1 100644 --- a/includes/db/DatabaseSqlite.php +++ b/includes/db/DatabaseSqlite.php @@ -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 ); + } } /**