Page MenuHomePhabricator

Creating an abuse filter fails when MariaDB's strict mode is enabled
Closed, DuplicatePublic

Description

When MariaDB's strict mode is enabled, it is not possible to create an abuse filter. Trying to do so results in a database error.

Doing T92755 would probably make this work, though as the flags are treated as integers elsewhere in the code, the AbuseFilter extension itself should probably be fixed.

Steps to reproduce:

  1. Ensure your wiki is configured to use MySQL or MariaDB and that the AbuseFilter extension is installed.
  2. Add $wgSQLMode = 'STRICT_ALL_TABLES'; to LocalSettings.php.
  3. Go to the page "Special:AbuseFilter/new".
  4. In the "Description:" box, type: Test.
  5. In the "Conditions:" box, type: "test" in added_lines & !("test" in removed_lines)
  6. Leave the check boxes how they are: only "Enable this filter" and "Flag this edit in the abuse log" should be checked.
  7. Click "Save filter".

Expected result: The edit filter is saved.

Actual result: I get this error message:

Query:
REPLACE INTO `abuse_filter` (af_pattern,af_enabled,af_hidden,af_global,af_throttled,af_public_comments,af_comments,af_group,af_deleted,af_actions,af_timestamp,af_user,af_user_text,af_id) VALUES ('\"test\" in added_lines & !(\"test\" in removed_lines)','1','','','','Test','','default','','','20151008212942','1','PleaseStand',NULL)
Function: AbuseFilterViewEdit::show
Error: 1366 Incorrect integer value: '' for column 'af_hidden' at row 1 (localhost)

Event Timeline

PleaseStand raised the priority of this task from to Needs Triage.
PleaseStand updated the task description. (Show Details)
PleaseStand added a project: AbuseFilter.
PleaseStand added a subscriber: PleaseStand.
Restricted Application added subscribers: Luke081515, Aklapper. · View Herald TranscriptOct 8 2015, 9:48 PM