From: Domas Mituzas Date: Fri, 11 Jun 2004 14:46:25 +0000 (+0000) Subject: table name old->"old" for PG X-Git-Tag: 1.5.0alpha1~2919 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=c0e96b915273d1796a1b5180d23fa83b0739f08d;p=lhc%2Fweb%2Fwiklou.git table name old->"old" for PG --- diff --git a/includes/DifferenceEngine.php b/includes/DifferenceEngine.php index 1890ae489f..ffe3b6f472 100644 --- a/includes/DifferenceEngine.php +++ b/includes/DifferenceEngine.php @@ -118,9 +118,10 @@ cellpadding='0' cellspacing='4px' class='diff'> # function loadText() { - global $wgTitle, $wgOut, $wgLang, $wgIsMySQL; + global $wgTitle, $wgOut, $wgLang, $wgIsMySQL, $wgIsPg; $fname = "DifferenceEngine::loadText"; + $oldtable=wgIsPg?'"old"':'old'; if ( 0 == $this->mNewid || 0 == $this->mOldid ) { $wgOut->setArticleFlag( true ); $this->mNewtitle = wfMsg( "currentrev" ); @@ -136,7 +137,7 @@ cellpadding='0' cellspacing='4px' class='diff'> $this->mNewUser = $s->cur_user_text; $this->mNewComment = $s->cur_comment; } else { - $sql = "SELECT old_namespace,old_title,old_timestamp,old_text,old_flags,old_user_text,old_comment FROM old WHERE " . + $sql = "SELECT old_namespace,old_title,old_timestamp,old_text,old_flags,old_user_text,old_comment FROM $oldtable WHERE " . "old_id={$this->mNewid}"; $res = wfQuery( $sql, DB_READ, $fname ); @@ -154,13 +155,13 @@ cellpadding='0' cellspacing='4px' class='diff'> if ( 0 == $this->mOldid ) { $use_index=$wgIsMySQL?"USE INDEX (name_title_timestamp)":""; $sql = "SELECT old_namespace,old_title,old_timestamp,old_text,old_flags,old_user_text,old_comment " . - "FROM old $use_index WHERE " . + "FROM $oldtable $use_index WHERE " . "old_namespace=" . $this->mNewPage->getNamespace() . " AND " . "old_title='" . wfStrencode( $this->mNewPage->getDBkey() ) . "' ORDER BY inverse_timestamp LIMIT 1"; $res = wfQuery( $sql, DB_READ, $fname ); } else { - $sql = "SELECT old_namespace,old_title,old_timestamp,old_text,old_flags,old_user_text,old_comment FROM old WHERE " . + $sql = "SELECT old_namespace,old_title,old_timestamp,old_text,old_flags,old_user_text,old_comment FROM $oldtable WHERE " . "old_id={$this->mOldid}"; $res = wfQuery( $sql, DB_READ, $fname ); }