From cd772bb3579ad09112d792fa35cc3a453a027e47 Mon Sep 17 00:00:00 2001 From: Domas Mituzas Date: Fri, 11 Jun 2004 14:44:13 +0000 Subject: [PATCH] * table name: use "old" instead of old for PG * use wfLimitResult for lists with offsets --- includes/PageHistory.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/includes/PageHistory.php b/includes/PageHistory.php index a657370776..56f673fa74 100644 --- a/includes/PageHistory.php +++ b/includes/PageHistory.php @@ -17,7 +17,7 @@ class PageHistory { function history() { - global $wgUser, $wgOut, $wgLang, $wgIsMySQL; + global $wgUser, $wgOut, $wgLang, $wgIsMySQL, $wgIsPg; # If page hasn't changed, client can cache this @@ -55,12 +55,13 @@ class PageHistory { $namespace = $this->mTitle->getNamespace(); $title = $this->mTitle->getText(); $use_index=$wgIsMySQL?"USE INDEX (name_title_timestamp)":""; + $oldtable=$wgIsPg?'"old"':'old'; $sql = "SELECT old_id,old_user," . "old_comment,old_user_text,old_timestamp,old_minor_edit ". - "FROM old $use_index " . + "FROM $oldtable $use_index " . "WHERE old_namespace={$namespace} AND " . "old_title='" . wfStrencode( $this->mTitle->getDBkey() ) . "' " . - "ORDER BY inverse_timestamp LIMIT $rawoffset, $limitplus"; + "ORDER BY inverse_timestamp".wfLimitResult($limitplus,$rawoffset); $res = wfQuery( $sql, DB_READ, $fname ); $revs = wfNumRows( $res ); -- 2.20.1