Page MenuHomePhabricator

join_conds in SQL select wrapper seem broken in Postgress
Closed, ResolvedPublic

Description

Author: michaelcirello2

Description:
Special pages (BrokenRedirects, etc) are generating invalid SQL. It seems the 'from' and 'join' clauses are not being constructed correctly. This is with Postgres as the db if it matters.

Example query generated from brokenredirects below. Note FROM "p2". This obviously doesn't exist and was supposed to be part of a join that is not included at all.

SELECT /* BrokenRedirectsPage::reallyDoQuery Mike */

p1.page_namespace AS namespace,
p1.page_title AS title,
p1.page_title AS VALUE,
rd_namespace,
rd_title

FROM "p2"
WHERE (rd_namespace >= 0) AND

(rd_interwiki IS NULL OR rd_interwiki = '') AND
(p2.page_namespace IS NULL)

ORDER BY rd_namespace,rd_title,rd_from
LIMIT 51
FOR UPDATE OF p1


Version: 1.22.2
Severity: normal

Details

Reference
bz61971

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.
StatusSubtypeAssignedTask
InvalidNone
ResolvedNone

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:58 AM
bzimport set Reference to bz61971.
bzimport added a subscriber: Unknown Object (MLST).

This is with Postgres as the db if it matters.

Yep it does. (How SQL is constructed is different for every db backend)

Testing this locally on 1.22.2 and using mysql seems to work fine. Highly suspect its an issue with the postgres wrapper class

Sounds like the problem from bug 60031

Fixed in the meantime, should be part of 1.22.3 (Looks like bug 60531)

Jdforrester-WMF subscribed.

Migrating from the old tracking task to a tag for PostgreSQL-related tasks.