From: Domas Mituzas Date: Fri, 11 Jun 2004 14:44:13 +0000 (+0000) Subject: * table name: use "old" instead of old for PG X-Git-Tag: 1.5.0alpha1~2921 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=cd772bb3579ad09112d792fa35cc3a453a027e47;p=lhc%2Fweb%2Fwiklou.git * table name: use "old" instead of old for PG * use wfLimitResult for lists with offsets --- 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 );