Page MenuHomePhabricator

Special:RelatedChanges with edit filters has query error due to missing join on page table
Closed, ResolvedPublic

Description

https://fr.wikipedia.org/wiki/Sp%C3%A9cial:Suivi_des_liens/Cat%C3%A9gorie:Bon_article?userExpLevel=unregistered%3Bnewcomer%3Blearner&hidepreviousrevisions=1&hidenewpages=1&hidecategorization=1&hideWikibase=1&hidelog=1&namespace=0&limit=50&days=7&urlversion=2&action=render&enhanced=0

A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?
Query: SELECT rc_id,rc_timestamp,rc_user,rc_user_text,rc_namespace,rc_title,rc_minor,rc_bot,rc_new,rc_cur_id,rc_this_oldid,rc_last_oldid,rc_type,rc_source,rc_patrolled,rc_ip,rc_old_len,rc_new_len,rc_deleted,rc_logid,rc_log_type,rc_log_action,rc_params,rc_comment AS rc_comment_text,NULL AS rc_comment_data,NULL AS rc_comment_cid,wl_user,(SELECT GROUP_CONCAT(ct_tag SEPARATOR ',') FROM change_tag WHERE ct_rc_id=rc_id ) AS ts_tags FROM recentchanges LEFT JOIN user ON ((rc_user = user_id)) LEFT JOIN watchlist ON (wl_user = '1760684' AND (wl_title=rc_title) AND (wl_namespace=rc_namespace)) INNER JOIN categorylinks ON ((rc_cur_id = cl_from)) WHERE ((rc_user = 0) OR (NOT ( (user_editcount >= 500) AND (user_registration <= '20170820123047') ))) AND (rc_this_oldid = page_latest) AND (rc_type != '1') AND (rc_type != '3') AND (rc_type != '6') AND (rc_source != 'wb') AND (rc_namespace = '0') AND (rc_timestamp >= '20170912123047') AND cl_to = 'Bon_article' ORDER BY rc_timestamp DESC LIMIT 50
Function: SpecialRecentChangesLinked::doMainQuery
Error: 1054 Unknown column 'page_latest' in 'where clause' (10.64.16.83)

#0 /srv/mediawiki/php-1.30.0-wmf.18/includes/libs/rdbms/database/Database.php(979): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
#1 /srv/mediawiki/php-1.30.0-wmf.18/includes/specials/SpecialRecentchangeslinked.php(229): Wikimedia\Rdbms\Database->query(string, string)
#2 /srv/mediawiki/php-1.30.0-wmf.18/includes/specialpage/ChangesListSpecialPage.php(704): SpecialRecentChangesLinked->doMainQuery(array, array, array, array, array, FormOptions)
#3 /srv/mediawiki/php-1.30.0-wmf.18/includes/specialpage/ChangesListSpecialPage.php(522): ChangesListSpecialPage->getRows()
#4 /srv/mediawiki/php-1.30.0-wmf.18/includes/specials/SpecialRecentchanges.php(164): ChangesListSpecialPage->execute(string)
#5 /srv/mediawiki/php-1.30.0-wmf.18/includes/specialpage/SpecialPage.php(522): SpecialRecentChanges->execute(string)
#6 /srv/mediawiki/php-1.30.0-wmf.18/includes/specialpage/SpecialPageFactory.php(578): SpecialPage->run(string)
#7 /srv/mediawiki/php-1.30.0-wmf.18/includes/MediaWiki.php(287): SpecialPageFactory::executePath(Title, RequestContext)
#8 /srv/mediawiki/php-1.30.0-wmf.18/includes/MediaWiki.php(848): MediaWiki->performRequest()
#9 /srv/mediawiki/php-1.30.0-wmf.18/includes/MediaWiki.php(523): MediaWiki->main()
#10 /srv/mediawiki/php-1.30.0-wmf.18/index.php(43): MediaWiki->run()
#11 /srv/mediawiki/w/index.php(3): include(string)

Event Timeline

Bawolff created this task.Sep 19 2017, 4:28 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 19 2017, 4:28 PM
Restricted Application added subscribers: Liuxinyu970226, Jay8g, TerraCodes. · View Herald TranscriptSep 19 2017, 4:30 PM

Change 378968 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/core@master] SpecialRecentchangeslinked: Unconditionally join on the page table

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

Change 378968 merged by jenkins-bot:
[mediawiki/core@master] SpecialRecentchangeslinked: Unconditionally join on the page table

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

Change 378972 had a related patch set uploaded (by Jforrester; owner: Catrope):
[mediawiki/core@wmf/1.30.0-wmf.19] SpecialRecentchangeslinked: Unconditionally join on the page table

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

Change 378973 had a related patch set uploaded (by Jforrester; owner: Catrope):
[mediawiki/core@wmf/1.30.0-wmf.18] SpecialRecentchangeslinked: Unconditionally join on the page table

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

Change 378973 merged by jenkins-bot:
[mediawiki/core@wmf/1.30.0-wmf.18] SpecialRecentchangeslinked: Unconditionally join on the page table

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

Change 378972 merged by jenkins-bot:
[mediawiki/core@wmf/1.30.0-wmf.19] SpecialRecentchangeslinked: Unconditionally join on the page table

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

Mentioned in SAL (#wikimedia-operations) [2017-09-19T23:36:39Z] <thcipriani@tin> Synchronized php-1.30.0-wmf.19/includes/specials/SpecialRecentchangeslinked.php: SWAT: [[gerrit:378973|SpecialRecentchangeslinked: Unconditionally join on the page table]] T176228 (duration: 00m 49s)

Mentioned in SAL (#wikimedia-operations) [2017-09-19T23:39:25Z] <thcipriani@tin> Synchronized php-1.30.0-wmf.18/includes/specials/SpecialRecentchangeslinked.php: SWAT: [[gerrit:378973|SpecialRecentchangeslinked: Unconditionally join on the page table]] T176228 (duration: 00m 49s)

Per discussion, we should do this conditionally in queryCallable (or as needed if it's not a filter).

It's probably best to do that before this is closed.

Per discussion, we should do this conditionally in queryCallable (or as needed if it's not a filter).
It's probably best to do that before this is closed.

It needs to always be there for highlight to work. See isRowApplicableCallable of the lastRevision filter group.

Change 379343 had a related patch set uploaded (by Jforrester; owner: Catrope):
[mediawiki/core@REL1_30] SpecialRecentchangeslinked: Unconditionally join on the page table

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

It needs to always be there for highlight to work. See isRowApplicableCallable of the lastRevision filter group.

Good point. We may want to add the ability to change the DB query based on the highlight, but that's out of scope for this task: T176385: Improve New Filters performance by changing DB query based on highlights?

Checked Special:RelatedChanges for possible errors with filter combinations close to what was reported.

Note: Previously the url in the ticket gave a page with the db error, now it displays a page with missing CSS.

Etonkovidova closed this task as Resolved.Sep 21 2017, 11:23 PM

Change 379343 merged by jenkins-bot:
[mediawiki/core@REL1_30] SpecialRecentchangeslinked: Unconditionally join on the page table

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