Page MenuHomePhabricator

Getting database error when trying to save filter
Closed, ResolvedPublic

Description

Author: Wiki.Melancholie

Description:
On alswiki, I am getting a database error when trying to save a filter containing a umlaut or a regex:

lcase(added_lines) contains "fööbar" |
lcase(added_lines) rlike "foo[^ ]bar"

Error message is:

A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was:

(SQL query hidden)

from within function "AbuseFilterViewEdit::show". MySQL returned error "1054: Unknown column 'af_global' in 'field list' (10.0.6.21)".


Version: unspecified
Severity: enhancement

Details

Reference
bz19135

Event Timeline

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

Wiki.Melancholie wrote:

Suddenly applies for all filters there, not just for those containing an umlaut or regex. Error occurs not always, but in, let's say, 9 of 10 attempts.

Looks like a schema change has slipped through the cracks here. Could this be related to Tim's running schema changes earlier today?

I've looked at the error logs and I can find the error on alswiki, from lots and lots of different servers.

It's a bit strange, the code isn't supposed to be updated on those servers.

mwpnl wrote:

The same problem occurs on nl-wikipedia. We cannot commit any changes to filters.

mwpnl wrote:

The error on nl-wikipedia:
Error in function "AbuseFilterViewEdit::show”.
MySQL returned “1054: Unknown column 'af_global' in 'field list' (10.0.6.23)

Best regards,
Mark Wesbeek

Did a live hack on Wikimedia to fix. I suggest implementing a permanent fix along the lines of using an explicit field list for any INSERT queries instead of trusting the DB. Also you shouldn't be selecting data from a slave and then saving it back to the master, that could lead to some nasty unintended reversions if there's any replication lag.