Page MenuHomePhabricator

Using rdnamespace parameter for prop=redirects results in database error when miser mode is not enabled
Closed, ResolvedPublic

Description

On ArchWiki, specifying rdnamespace to any value (for example this query) results in internal database query error:

{
    "error": {
        "code": "internal_api_error_DBQueryError",
        "info": "[e0c8b223] Database query error"
    }
}

I've been able to reproduce this on localhost on my testing wiki by simply upgrading from 1.22 to 1.25 (ArchWiki upgraded to 1.25 from 1.23). With $wgShowSQLErrors = true; the info is the following:

Exception Caught: A database error has occurred. Did you forget to run maintenance/update.php after upgrading?  See: https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script
Query: SELECT  rd_from,rd_namespace AS bl_namespace,rd_title AS bl_title,page_id,page_title,page_namespace  FROM `redirect`,`page`   WHERE rd_from_namespace = '0' AND (rd_from = page_id) AND (rd_interwiki = '' OR rd_interwiki IS NULL) AND ((rd_namespace = '0' AND rd_title = 'Main_page'))  ORDER BY rd_from LIMIT 11  
Function: ApiQueryBacklinksprop::run
Error: 1054 Unknown column 'rd_from_namespace' in 'where clause' (localhost)

The update script has been run after the upgrade (running it again does not help).

Event Timeline

Lahwaacz created this task.Sep 23 2015, 8:15 AM
Lahwaacz raised the priority of this task from to Needs Triage.
Lahwaacz updated the task description. (Show Details)
Lahwaacz added a subscriber: Lahwaacz.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 23 2015, 8:15 AM
Lahwaacz set Security to None.
Anomie renamed this task from Adding rdnamespace parameter to API query results in database error to Using rdnamespace parameter for prop=redirects results in database error when miser mode is not enabled.Sep 23 2015, 1:31 PM
Anomie claimed this task.

Change 240362 had a related patch set uploaded (by Anomie):
API: Correct 'from_namespace' logic in ApiQueryBacklinksprop

https://gerrit.wikimedia.org/r/240362

Anomie moved this task from Unsorted to Needs Review on the MediaWiki-API board.Sep 23 2015, 1:47 PM

Change 240362 merged by jenkins-bot:
API: Correct 'from_namespace' logic in ApiQueryBacklinksprop

https://gerrit.wikimedia.org/r/240362

Umherirrender closed this task as Resolved.Sep 26 2015, 7:08 PM