Why:
* The logging table on en.wikipedia.org contains an entry from
2005 which is an unblock of an autoblock. However, the log_title
contains the namespace, which makes the code that looks for
logs which target an autoblock fail (because it checks for the
first character being '#').
* Fixing the log_title to remove the 'User:' prefix from rows which
are autoblocks (i.e. searching for log_titles which start with
'User:#') should address the exceptions seen on Special:Log for
these rows.
** The search can be limited to rows which have the 'unblock'
log_action, as this has only been seen for this type of log.
What:
* Create fixAutoblockLogTitles.php which searches for the entries
and then updates the log_title value to no longer include the
'User:' prefix
** The queries to search are split, such that the expensive LIKE
query is performed on batches of row IDs. If the LIKE query is
applied directly to all rows in the table, the query takes 30s
to run on WMF production.
* Add this maintenance script to update.php. It will be run once
as the class extends LoggedUpdateMaintenance.
* Test the newly added maintenance script to ensure it works.
Bug: T373929
Change-Id: Ia62db56eda456bb764303b5f4b5a29be8f2d8fff