Page MenuHomePhabricator

Add options parameter to Database::delete()
Open, MediumPublic


Per the other queries, it'd be nice to be able to do options on delete.

For the resource loader maintenance script to do cleanupRemovedModules, there is a "LIMIT $limit", which can't be accommodated via $db->delete()

You need to do db->$query() etc.

Not a big deal, just not got time/inclination to look at/do this now for all databases etc

Version: unspecified
Severity: enhancement



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:19 PM
bzimport added a project: Wikimedia-Rdbms.
bzimport set Reference to bz26682.
bzimport added a subscriber: Unknown Object (MLST).
Reedy created this task.Jan 12 2011, 2:29 AM
Reedy added a comment.Jan 12 2011, 2:48 AM

// $dbw->delete() doesn't support LIMIT :(

  • Bug 52868 has been marked as a duplicate of this bug. ***

In Postgres you'll have to do the trick with DELETE FROM table WHERE ctid IN (SELECT ctid FROM table WHERE ... LIMIT n) - ewwww.

SQLite and Oracle support LIMIT in DELETE.

Related: bug 52777 and bug 52778.

Change 131890 had a related patch set uploaded by Withoutaname:
Expand Database.php delete() function parameter list

Change 131890 abandoned by Withoutaname:
Expand Database.php delete() function parameter list

Krinkle renamed this task from Add options parameter to delete() to Add options parameter to Database::delete().Dec 10 2014, 2:11 PM
Krinkle added a project: Technical-Debt.
Krinkle set Security to None.
Krinkle removed a subscriber: Unknown Object (MLST).
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 23 2016, 12:29 AM
Restricted Application added a project: Core Platform Team. · View Herald TranscriptJul 23 2019, 5:43 PM