DatabaseUpdater::populateInterwikiTable() says Common function for databases that don't understand the MySQLish syntax of interwiki.sql.
It seems daft to be maintaining basically two lists and ways of doing the same sort of thing.
The SQL version does have REPLACE INTO which would allow a form of updating... But the MysqlUpdater code doesn't actually allow that to happen, and doesn't run the SQL file if the interwiki table already exists...
Do we have documentation telling people to run/use it in another way? If not, why are we using REPLACE INTO etc?
/** * Check that interwiki table exists; if it doesn't source it */ protected function doInterwikiUpdate() { global $IP; if ( !$this->doTable( 'interwiki' ) ) { return; } if ( $this->db->tableExists( "interwiki", __METHOD__ ) ) { $this->output( "...already have interwiki table\n" ); return; } $this->applyPatch( 'patch-interwiki.sql', false, 'Creating interwiki table' ); $this->applyPatch( "$IP/maintenance/interwiki.sql", true, 'Adding default interwiki definitions' ); }
This seems ripe for cleaning up in some way or another.... Especially as it starts being relevant to T259771: RFC: Drop support for older database upgrades and potentially as part of the Abstract Schema initiative.
Maybe even MW should be updating the interwiki table when there are changes to the files/lists too?