r22540 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r22539‎ | r22540 | r22541 >
Date:18:18, 29 May 2007
Author:rainman
Status:old
Tags:
Comment:
Customize the reference query a bit better.
Modified paths:
  • /trunk/extensions/OAI/OAIRepo_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OAI/OAIRepo_body.php
@@ -659,18 +659,18 @@
660660 else
661661 $pages_where = " AND up_page IN (".implode(",",$page_ids).") ";
662662
663 - extract( $this->_db->tableNames( 'updates', 'page', 'revision', 'text', 'pagelinks' ) );
 663+ extract( $this->_db->tableNames( 'updates', 'page', 'pagelinks' ) );
664664 $sql = "SELECT up_page,up_sequence,
665665 r.page_namespace AS page_namespace,
666666 r.page_title AS page_title,
667667 COUNT(pl.pl_from) AS num_page_ref
668 - FROM updates
669 - LEFT JOIN page AS p ON p.page_id=up_page
670 - LEFT JOIN pagelinks AS pl ON p.page_namespace=pl.pl_namespace AND p.page_title=pl.pl_title
671 - LEFT JOIN page AS ns ON pl.pl_from=ns.page_id
672 - LEFT JOIN page AS r ON pl.pl_from=r.page_id AND r.page_is_redirect=1
673 - LEFT JOIN pagelinks AS rpl ON r.page_namespace=rpl.pl_namespace AND r.page_title=rpl.pl_title
674 - WHERE ns.page_namespace = p.page_namespace
 668+ FROM $updates
 669+ LEFT JOIN $page AS p ON p.page_id=up_page
 670+ LEFT JOIN $pagelinks AS pl ON p.page_namespace=pl.pl_namespace AND p.page_title=pl.pl_title
 671+ LEFT JOIN $page AS ns ON pl.pl_from=ns.page_id
 672+ LEFT JOIN $page AS r ON pl.pl_from=r.page_id AND r.page_is_redirect=1
 673+ LEFT JOIN $pagelinks AS rpl ON r.page_namespace=rpl.pl_namespace AND r.page_title=rpl.pl_title
 674+ WHERE p.page_namespace != 0 OR p.page_namespace = ns.page_namespace
675675 $pages_where
676676 GROUP BY up_page,r.page_id";
677677