Rewrite runBatchedQuery.php
authorTim Starling <tstarling@wikimedia.org>
Tue, 15 Nov 2016 05:11:15 +0000 (16:11 +1100)
committerBrian Wolff <bawolff+wn@gmail.com>
Wed, 16 Nov 2016 00:34:53 +0000 (00:34 +0000)
commit4c8c5c434f1f620e12710d7a81198775e6dd3116
tree6e40bdbc1ec503200d5a8942be7a307bf3987dca
parent735c32ffe2ee17e7287270a9f1d8af99a52d827b
Rewrite runBatchedQuery.php

This maintenance script was previously introduced as a way to do large
UPDATE queries in a replication safe way. However, in modern versions of
MySQL, UPDATE...LIMIT is considered a non-replication-safe query, and
will emit a warning.

So instead, ask the user to provide slightly more structured data about
the update query being done, and partition the table based on an index.
In the UPDATE queries, specify index ranges instead of using LIMIT.

Also add a "db" option, which allows the script to update databases
which are not valid wiki names, for example, centralauth.

Change-Id: I462bdcb03e107af9db4738895952d5110f0ec4fc
maintenance/runBatchedQuery.php