From db22292391a4490915b0f50a27c0722537a566af Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Fri, 9 Jan 2009 03:53:28 +0000 Subject: [PATCH] * 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. --- includes/db/Database.php | 2 +- includes/db/DatabaseSqlite.php | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) 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 ); + } } /** -- 2.20.1