aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance/mysql.php
Commit message (Collapse)AuthorAgeFilesLines
* add `use MediaWiki\Maintenance\Maintenance` to some maintenance classesNovem Linguae2024-12-041-0/+1
| | | | | | | | | | | | | F–P. Still need to do P–Z. there's a couple spots where I added `use MediaWiki\Maintenance\LoggedUpdateMaintenance;` or similar instead. some of the existing "use" blocks were in weird spots (e.g. above the copyright docblock, or too far down). i didn't move those because they are out of scope for this patch. Change-Id: I5b6a8f3eae5be85d67bccfcce31c0c2027850f45
* maintenance: Use namespaced classesUmherirrender2024-10-211-0/+1
| | | | | | | This does not include use of MediaWiki\Maintenance\Maintenance, assuming the maintenance scripts going into the same namespace Change-Id: I488f95b537ce86eb5e463be7bce3653610dd13d9
* Exclude boilerplate maintenance code from code coverage reportsDreamy Jazz2024-08-271-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * Maintenance scripts in core have bolierplate code that is added before and after the class to allow directly running the maintenance script. * Running the maintenance script directly has been deprecated since 1.40, so this boilerplate code is only to support a now deprecated method of running maintenance scripts. * This code cannot also be marked as covered, due to PHPUnit not recognising code coverage for files. * Therefore, it is best to ignore this boilerplate code in code coverage reports as it cannot be marked as covered and also is for deprecated code. What: * Wrap the boilerplate code (requiring Maintenance.php and then later defining the maintenance script class and running if the maintenance script was called directly) with @codeCoverageIgnore comments. * Some files use a different boilerplate code, however, these should also be marked as ignored for coverage for the same reason that coverage is not properly reported for files. Bug: T371167 Change-Id: I32f5c6362dfb354149a48ce9c28da9a7fc494f7c
* rdbms: Remove ILoadBalancer::getWriterIndex()Amir Sarabadani2024-06-031-1/+2
| | | | | | | | It doesn't need to have its own method, We can just use the constant instead. Bug: T363839 Change-Id: Iaec5a8e88dc3e5ae4eaf1f24aebf4c5d73f4b350
* Update references to renamed DatabaseMySQL classJames D. Forrester2023-11-011-1/+1
| | | | Change-Id: Ic8d411152f5c031db6f30fc243af999f0ba5509e
* maintenance: Begin using `Maintenance::getServiceContainer()`Derick Alangi2023-09-041-2/+1
| | | | | | | | | | | Maintenance class provides a method for getting a fresh reference of the MW services container instance. Let's make use of these in maintenance scripts now that we have it. NOTE: There are still some static methods like in refreshLinks.php that makes use of services that we can't use this method for now. Change-Id: Idba744057577896fc97c9ecf4724db27542bf01c
* rdbms: Merge DatabaseMysqli into DatabaseMysqlBaseAmir Sarabadani2023-08-071-1/+1
| | | | | | This should have been done long time ago. Change-Id: I4935b0483a566266e5bc99542478387304843624
* Maintenance: use getArgs instead of mArgs.daniel2023-04-031-1/+1
| | | | Change-Id: If013a450c701efcf2bad7b12a253b455996a9685
* maintenance/mysql: Add missing $serverInfo to fix --raw-host optionTimo Tijhof2023-01-181-1/+1
| | | | | | Follows-up I76f362d10818ec2. Change-Id: I26ae8439c597d94ee5cfc8e50f3f67de07bb5c68
* maintenance/mysql.php: Add --raw-host parameterTimo Tijhof2023-01-111-3/+24
| | | | | | | | | | | This is to ease connecting to ParserCache and MainStash DB hosts, which are configured directly with SqlBagOStuff instead of via $wgLBFactory, thus they are considered unknown to the way this script worked before. This new option can also be used to connect with regular core DB hosts that e.g. are not yet pooled or are depooled for some reason. Change-Id: I76f362d10818ec2ea4d8f3fbcb367835928be7de
* Merge "rdbms: remove DB domain from more LoadBalancer methods"jenkins-bot2022-10-251-2/+2
|\
| * rdbms: remove DB domain from more LoadBalancer methodsAaron Schulz2022-10-251-2/+2
| | | | | | | | | | | | | | | | | | | | This affects: * LoadBalancer::pickReaderIndex() * LoadBalancer::getReaderIndex() These callers should not need to care about a DB domain. Change-Id: I4658faf31c4aad6c8a34ac80b3ca235370e0b09f
* | Use short array destructuring instead of list()Tim Starling2022-10-211-1/+1
|/ | | | | | | | Introduced in PHP 7.1. Because it's shorter and looks nice. I used regex replacement. Change-Id: I0555e199d126cd44501f859cb4589f8bd49694da
* maintenance: Cleanup use of exit in Maintenance::execute implementationUmherirrender2021-08-301-3/+3
| | | | | | | | Returning void from execute() is success. Returning true is success, false is failure with exit(1) Using fatalError also using exit(1) Change-Id: I1d40430ad6226e4aab8f0810b03ee1213282d123
* More master -> primary documentation and internal var renamingJames D. Forrester2021-07-151-1/+1
| | | | | Bug: T254646 Change-Id: I63cc8895033714bdfbf09aee933a8f0a43b387f3
* MysqlMaintenance: Make use of Maintenance::fatalErrorAmmarpad2021-02-281-17/+10
| | | | | | This simplifies the code by using base Maintenance class abstraction Change-Id: Ib476101247cb8e1c9e0142a7d7acc29a89472bdf
* Fix --group option for mysql.phpdaniel2021-02-091-1/+1
| | | | Change-Id: I95b1923f94be680cfde7cbc7e4bee18ca6150442
* in deployment-prep some groups don't exist, permit scripts that use them to runAriel T. Glenn2021-02-091-0/+4
| | | | | | | | | Example, there are dump scripts that use mysql.php with group=dump and these work fine in production where the groups are, but die in deployment-prep. Instead of dying, try to get any replica for the wiki and use that instead. Bug: T269377 Change-Id: I54e295175a8a78d886b9390c15a0cacd16d41a15
* Coding style: Auto-fix MediaWiki.Classes.UnsortedUseStatements.UnsortedUseJames D. Forrester2020-01-101-1/+1
| | | | Change-Id: I94a0ae83c65e8ee419bbd1ae1e86ab21ed4d8210
* Use namespaced IPUtils classKunal Mehta2020-01-011-1/+2
| | | | Change-Id: I047e099a93203a59093946d336a143d899d0271f
* Make use of the list() feature where it makes senseThiemo Kreuz2019-03-241-3/+1
| | | | | | | | | | This code is functionally identical, but less error prone (not so easy to forget or mix these numerical indexes). This patch happens to touch the Parser, which might be a bit scary. We can remove this file from this patch if you prefer. Change-Id: I8cbe3a9a6725d1c42b86e67678c1af15fbc5961a
* maintenance: Remove unused code from several maintenance scriptsThiemo Kreuz2019-03-031-2/+0
| | | | | | | | | | | | The most notable removal is done in the orphans script. This code was really never used. Brion introduced it in 2005, already disabled. I have all the respect for what Brion did. I just think it does not make much sense to keep code around for so long if it does not work anyway, and must be rewritten from scratch anyway now that we have multi-content revisions and such. Change-Id: I4e8050929f90e44a6e6051bf938993a8b0cdf649
* Fix param doc of MysqlMaintenance::runMysqlUmherirrender2018-08-061-2/+2
| | | | | | Add missing var name and type Change-Id: I26c84723ee28b21f6b9b654d9507ed680c07055a
* In mysql.php ignore SIGINTTim Starling2018-07-181-0/+6
| | | | | | | | | | | | | | | | | | Every foreground process with the terminal open will receive SIGINT when the interrupt key is pressed. But mysql handles SIGINT and kills the running query, we don't want the wrapper to exit in that case. So, ignore SIGINT while mysql is running. This is similar to how a shell deals with this problem. The other options would have been: * Close the filehandles in PHP after forking (probably impossible) * Use pcntl_exec() so that PHP isn't running (more complicated and requires the pcntl extension anyway) * Clear termcap ISIG flag (probably would have broken mysql) Bug: T199152 Change-Id: I7660cd24e036fbe3fe36d12563ffe1c1fa2360d0
* Maintenance script to wrap the mysql binaryTim Starling2018-05-311-0/+184
This is more or less equivalent to the WMF shell script "sql", but it is reasonably portable and written in a less hackish way. Change-Id: I240d8d4e65ce46680cac257ee376a9b026c13f92