https://bugzilla.wikimedia.org/show_bug.cgi?id=61166

       Web browser: ---
            Bug ID: 61166
           Summary: WikiPage::newFromId( $id=0 ) needlessly queries the
                    database
           Product: MediaWiki
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Keywords: performance
          Severity: normal
          Priority: Unprioritized
         Component: General/Unknown
          Assignee: wikibugs-l@lists.wikimedia.org
          Reporter: sp...@wikimedia.org
    Classification: Unclassified
   Mobile Platform: ---

WikiPage::newFromID( 0 ) actually queries the 'page' DB table to look up
article ID 0. But MW code assumes that page_id == 0 means the page does not
exist, e.g. Title sets mArticleId to 0 if article not found. So newFromID()
could return null early if ( $id == 0 ).

One caller of this is ApiBase::getTitleOrPageId() , as a result API clients
that pass pageid=0 hit the database, some even querying 'fromdbmaster'.  AFTv5
is one example (bug 61164).

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to