From: Umherirrender Date: Fri, 7 Jun 2019 17:12:35 +0000 (+0200) Subject: Pass options as array to IDatabase::insert X-Git-Tag: 1.34.0-rc.0~1490^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=5f43b1706c9b69928100260085cc5f081e743920 Pass options as array to IDatabase::insert The documentation only allows arrays there Change-Id: I00c6e47a817a70bed9a443aebc675ef4c3d6b1e5 --- diff --git a/includes/Pingback.php b/includes/Pingback.php index f4e85adfdb..3b0ab2b689 100644 --- a/includes/Pingback.php +++ b/includes/Pingback.php @@ -196,7 +196,7 @@ class Pingback { 'updatelog', [ 'ul_key' => 'PingBack', 'ul_value' => $id ], __METHOD__, - 'IGNORE' + [ 'IGNORE' ] ); if ( !$dbw->affectedRows() ) { diff --git a/includes/deferred/LinksUpdate.php b/includes/deferred/LinksUpdate.php index 9d3309bad5..9adb2b07b1 100644 --- a/includes/deferred/LinksUpdate.php +++ b/includes/deferred/LinksUpdate.php @@ -497,7 +497,7 @@ class LinksUpdate extends DataUpdate implements EnqueueableDataUpdate { $insertBatches = array_chunk( $insertions, $bSize ); foreach ( $insertBatches as $insertBatch ) { - $this->getDB()->insert( $table, $insertBatch, __METHOD__, 'IGNORE' ); + $this->getDB()->insert( $table, $insertBatch, __METHOD__, [ 'IGNORE' ] ); $lbf->commitAndWaitForReplication( __METHOD__, $this->ticket, [ 'domain' => $domainId ] ); diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index 86b8bbb89c..99fd36d4fc 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -1494,7 +1494,7 @@ class LocalFile extends File { 'img_sha1' => $this->sha1 ] + $commentFields + $actorFields, __METHOD__, - 'IGNORE' + [ 'IGNORE' ] ); $reupload = ( $dbw->affectedRows() == 0 ); diff --git a/includes/installer/DatabaseUpdater.php b/includes/installer/DatabaseUpdater.php index b32be3953a..de7a347120 100644 --- a/includes/installer/DatabaseUpdater.php +++ b/includes/installer/DatabaseUpdater.php @@ -531,7 +531,7 @@ abstract class DatabaseUpdater { if ( $val && $this->canUseNewUpdatelog() ) { $values['ul_value'] = $val; } - $this->db->insert( 'updatelog', $values, __METHOD__, 'IGNORE' ); + $this->db->insert( 'updatelog', $values, __METHOD__, [ 'IGNORE' ] ); $this->db->setFlag( DBO_DDLMODE ); } diff --git a/includes/logging/LogPage.php b/includes/logging/LogPage.php index 1fc56bb527..fe9e26f7d3 100644 --- a/includes/logging/LogPage.php +++ b/includes/logging/LogPage.php @@ -403,7 +403,7 @@ class LogPage { } $dbw = wfGetDB( DB_MASTER ); - $dbw->insert( 'log_search', $data, __METHOD__, 'IGNORE' ); + $dbw->insert( 'log_search', $data, __METHOD__, [ 'IGNORE' ] ); return true; } diff --git a/includes/logging/ManualLogEntry.php b/includes/logging/ManualLogEntry.php index 90c0a72292..1d0bbfd6fa 100644 --- a/includes/logging/ManualLogEntry.php +++ b/includes/logging/ManualLogEntry.php @@ -335,7 +335,7 @@ class ManualLogEntry extends LogEntryBase implements Taggable { } } if ( count( $rows ) ) { - $dbw->insert( 'log_search', $rows, __METHOD__, 'IGNORE' ); + $dbw->insert( 'log_search', $rows, __METHOD__, [ 'IGNORE' ] ); } return $this->id; diff --git a/includes/objectcache/SqlBagOStuff.php b/includes/objectcache/SqlBagOStuff.php index 088f94e37c..5313ca4115 100644 --- a/includes/objectcache/SqlBagOStuff.php +++ b/includes/objectcache/SqlBagOStuff.php @@ -522,7 +522,7 @@ class SqlBagOStuff extends BagOStuff { 'exptime' => $row->exptime ], __METHOD__, - 'IGNORE' + [ 'IGNORE' ] ); if ( $db->affectedRows() == 0 ) { diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index 3814112f6a..332b1ee482 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -1342,7 +1342,7 @@ class WikiPage implements Page, IDBAccessObject { 'page_len' => 0, // Fill this in shortly... ] + $pageIdForInsert, __METHOD__, - 'IGNORE' + [ 'IGNORE' ] ); if ( $dbw->affectedRows() > 0 ) { diff --git a/includes/user/User.php b/includes/user/User.php index c41697f961..79b84204ba 100644 --- a/includes/user/User.php +++ b/includes/user/User.php @@ -2549,7 +2549,7 @@ class User implements IDBAccessObject, UserIdentity { $dbw->insert( 'user_newtalk', [ $field => $id, 'user_last_timestamp' => $dbw->timestampOrNull( $ts ) ], __METHOD__, - 'IGNORE' ); + [ 'IGNORE' ] ); if ( $dbw->affectedRows() ) { wfDebug( __METHOD__ . ": set on ($field, $id)\n" ); return true; diff --git a/includes/watcheditem/WatchedItemStore.php b/includes/watcheditem/WatchedItemStore.php index eed0b6cd60..51d9e32f5b 100644 --- a/includes/watcheditem/WatchedItemStore.php +++ b/includes/watcheditem/WatchedItemStore.php @@ -769,7 +769,7 @@ class WatchedItemStore implements WatchedItemStoreInterface, StatsdAwareInterfac foreach ( $rowBatches as $toInsert ) { // Use INSERT IGNORE to avoid overwriting the notification timestamp // if there's already an entry for this page - $dbw->insert( 'watchlist', $toInsert, __METHOD__, 'IGNORE' ); + $dbw->insert( 'watchlist', $toInsert, __METHOD__, [ 'IGNORE' ] ); $affectedRows += $dbw->affectedRows(); if ( $ticket ) { $this->lbFactory->commitAndWaitForReplication( __METHOD__, $ticket ); diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index 44ce9a5d18..1b17e8c355 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -1724,7 +1724,7 @@ abstract class LoggedUpdateMaintenance extends Maintenance { return false; } - $db->insert( 'updatelog', [ 'ul_key' => $key ], __METHOD__, 'IGNORE' ); + $db->insert( 'updatelog', [ 'ul_key' => $key ], __METHOD__, [ 'IGNORE' ] ); return true; } diff --git a/maintenance/populateCategory.php b/maintenance/populateCategory.php index ce1506ca49..508960d725 100644 --- a/maintenance/populateCategory.php +++ b/maintenance/populateCategory.php @@ -137,7 +137,7 @@ TEXT 'updatelog', [ 'ul_key' => 'populate category' ], __METHOD__, - 'IGNORE' + [ 'IGNORE' ] ); return true; diff --git a/maintenance/populateInterwiki.php b/maintenance/populateInterwiki.php index a654a1fc95..6cc86e0dce 100644 --- a/maintenance/populateInterwiki.php +++ b/maintenance/populateInterwiki.php @@ -141,7 +141,7 @@ TEXT 'iw_local' => 1 ], __METHOD__, - 'IGNORE' + [ 'IGNORE' ] ); } diff --git a/maintenance/populateIpChanges.php b/maintenance/populateIpChanges.php index 6e88dfaeac..80f8d300c5 100644 --- a/maintenance/populateIpChanges.php +++ b/maintenance/populateIpChanges.php @@ -128,7 +128,7 @@ TEXT } if ( $insertRows ) { - $dbw->insert( 'ip_changes', $insertRows, __METHOD__, 'IGNORE' ); + $dbw->insert( 'ip_changes', $insertRows, __METHOD__, [ 'IGNORE' ] ); $inserted += $dbw->affectedRows(); }