Page MenuHomePhabricator

Media deletion fails with database error on PostgreSQL backend
Closed, ResolvedPublic

Description

Author: gebhkla

Description:
At least on SQL query used for media deletion is incorrectly generated for PostgreSQL backends: In the FROM clause tables are missing:

SELECT rev_id,rev_page,rev_text_id,rev_timestamp,rev_comment,rev_user_text,rev_user,rev_minor_edit,rev_deleted,rev_len,rev_parent_id,rev_sha1,rev_content_format,rev_content_model,page_namespace,page_title,page_id,page_latest,page_is_redirect,page_len,user_name FROM "mwuser" WHERE page_id = '207' AND rev_id = '1239' LIMIT 1 FOR UPDATE OF page


Version: 1.22.1
Severity: normal

Details

Reference
bz60531

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.

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:50 AM
bzimport set Reference to bz60531.
bzimport created this task.Jan 28 2014, 3:30 PM

gebhkla wrote:

Patch

Renaming the $table to $table_cond to avoid naming conflicts with the argument of the function solved to problem.

Attached:

Change 109914 had a related patch set uploaded by Umherirrender:
Avoid variable naming conflicts in DatabasePostgres::selectSQLText

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

Reapply you change manually against current master (the is_array was added in the meantime). Thanks for the explanation/tip.

In future please try to commit direct to gerrit to make the review easier. You can also use the gerrit-patch-uploader[1], if no gerrit account exists.

[1] https://tools.wmflabs.org/gerrit-patch-uploader/

Fix for bug 47055 was backported to REL1_22, so this fix should also be backported.

Change 109914 merged by jenkins-bot:
Avoid variable naming conflicts in DatabasePostgres::selectSQLText

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

successfully merged

Change 110836 had a related patch set uploaded by Siebrand:
Avoid variable naming conflicts in DatabasePostgres::selectSQLText

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

Change 110836 merged by jenkins-bot:
Avoid variable naming conflicts in DatabasePostgres::selectSQLText

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

Was backported to 1.22, and will be part of 1.22.2.

Jdforrester-WMF added a subscriber: Jdforrester-WMF.

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