Page MenuHomePhabricator

Add support for SQLite and postgre when searching patterns
Closed, ResolvedPublic

Description

Currently we use RLIKE to allow users search with regular expressions. However, nor SQLite nor Postgre support RLIKE operator. Although we have bigger problems with those 2, we still need to make some changes to the search with regexps.

Details

Related Gerrit Patches:

Event Timeline

Daimona created this task.Apr 25 2018, 6:26 PM
Restricted Application added subscribers: Scoopfinder, Aklapper. · View Herald TranscriptApr 25 2018, 6:26 PM
Daimona triaged this task as Normal priority.Apr 26 2018, 11:20 AM

As I was saying, we have T62639 and T42757 which should be addressed first since they provide bigger unusability.

Vvjjkkii renamed this task from Add support for SQLite and postgre when searching patterns to b8daaaaaaa.Jul 1 2018, 1:13 AM
Vvjjkkii raised the priority of this task from Normal to High.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
Mainframe98 renamed this task from b8daaaaaaa to Add support for SQLite and postgre when searching patterns.Jul 1 2018, 10:04 AM
Mainframe98 lowered the priority of this task from High to Normal.
Mainframe98 updated the task description. (Show Details)
Mainframe98 added a subscriber: Aklapper.

I'm also wondering whether the cast to char needs to be rewritten to be DBMS-independent.

Daimona added a comment.EditedNov 16 2018, 1:11 PM

I'm also wondering whether the cast to char needs to be rewritten to be DBMS-independent.

Yes, it does (for instance, on Postgres the CAST only returns the first character of the string). https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/474172/ for that part.

Change 503562 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] Make patterns searching compatible with Postgres and SQLite

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

Daimona claimed this task.Apr 13 2019, 9:36 AM

Patch above + its dependencies and that's it.

CCicalese_WMF added a subscriber: CCicalese_WMF.

Adding to Core Platform Team for review of patches in clinic duty.

Change 538026 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] Use PHP regexps instead of SQL to filter results on Special:AbuseFilter

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

Change 538026 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] Use PHP regexps instead of SQL to filter results on Special:AbuseFilter
https://gerrit.wikimedia.org/r/538026

@CPT I'd like to go with this one. The other AF patch should probably be abandoned, while I think the depends-on in core may still be valuable (I'm gonna open separate tasks for them if that's the case).

Change 547186 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] Use PHP regexps instead of SQL to filter on Special:AbuseFilter

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

Change 503562 abandoned by Jforrester:
Make patterns searching compatible with Postgres and SQLite

Reason:
Per the other one being merged.

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

Change 547186 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] Use PHP regexps instead of SQL to filter on Special:AbuseFilter

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

Change 538026 abandoned by Daimona Eaytoy:
Use PHP regexps instead of SQL to filter results on Special:AbuseFilter

Reason:
Superseded by If6d8717795b6c1dcf619a23363eb6144902cfaed

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

Daimona closed this task as Resolved.Fri, Nov 1, 10:40 AM
Daimona removed a project: Patch-For-Review.