Page MenuHomePhabricator

Minor MySQL-isms in AbuseFilter
Closed, ResolvedPublic

Description

Patch against r48647 to fix these minor issues

Since these are all incredibly minor, I'm just going to submit one patch for the lot of them. If you really want separate patches, let me know.

  1. In Views/AbuseFilterViewList.php, a query uses GROUP BY without specifying all non-aggregate columns. However, it seems the entire join with abuse_filter_action is obsolete since r46359, so may as well just get rid of it.
  2. In Views/AbuseFilterViewList.php, ">>" and "|" are of equal precedence in PG, so parens are needed for correct calculation.
  3. MySQL silently converts arbitrary non-numeric strings to "0", while PG (correctly, IMO) throws an error. Thus, trying to delete "afa_filter = 'new'" in Views/AbuseFilterViewEdit.php causes an error.
  4. Similarly, MySQL silently casts integers to booleans, while PG requires an explicit comparison with 0 for the same result. Easy fix in Views/AbuseFilterViewExamine.php.
  5. The PG schema for the "text" table doesn't allow storing gzipped text; the MySQL schema wouldn't either if MySQL actually supported UTF8 so we didn't use BLOBs all over the place. Revision::compressRevisionText doesn't even try gzip when $wgCompressRevisions is false, you should too.

Version: unspecified
Severity: normal

Attached:

Details

Reference
bz18077

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
Resolved werdna

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:32 PM
bzimport added a project: AbuseFilter.
bzimport set Reference to bz18077.

Applied in r49793. Sorry for the delay and thanks for the report.

Jdforrester-WMF subscribed.

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