X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Fstorage%2FcheckStorage.php;h=6348e96b217fb95ef26aa963e7685ec10cb70b75;hb=7900790c7a3a28b8054a18473df71abacb9ec669;hp=acf0103bfa480ce738bb870a2af3e73b3bcfb2aa;hpb=4c96ff5203daefc5c87cb2aec6f9ba1acac3b6cb;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/storage/checkStorage.php b/maintenance/storage/checkStorage.php index acf0103bfa..6348e96b21 100644 --- a/maintenance/storage/checkStorage.php +++ b/maintenance/storage/checkStorage.php @@ -100,8 +100,12 @@ class CheckStorage { $missingTextRows = array_flip( $this->oldIdMap ); $externalRevs = []; $objectRevs = []; - $res = $dbr->select( 'text', [ 'old_id', 'old_flags' ], - 'old_id IN (' . implode( ',', $this->oldIdMap ) . ')', __METHOD__ ); + $res = $dbr->select( + 'text', + [ 'old_id', 'old_flags' ], + [ 'old_id' => $this->oldIdMap ], + __METHOD__ + ); foreach ( $res as $row ) { /** * @var $flags int @@ -158,8 +162,12 @@ class CheckStorage { $externalConcatBlobs = []; $externalNormalBlobs = []; if ( count( $externalRevs ) ) { - $res = $dbr->select( 'text', [ 'old_id', 'old_flags', 'old_text' ], - [ 'old_id IN (' . implode( ',', $externalRevs ) . ')' ], __METHOD__ ); + $res = $dbr->select( + 'text', + [ 'old_id', 'old_flags', 'old_text' ], + [ 'old_id' => $externalRevs ], + __METHOD__ + ); foreach ( $res as $row ) { $urlParts = explode( '://', $row->old_text, 2 ); if ( count( $urlParts ) !== 2 || $urlParts[1] == '' ) { @@ -200,7 +208,9 @@ class CheckStorage { $blobsTable = $this->dbStore->getTable( $extDb ); $res = $extDb->select( $blobsTable, [ 'blob_id' ], - [ 'blob_id IN( ' . implode( ',', $blobIds ) . ')' ], __METHOD__ ); + [ 'blob_id' => $blobIds ], + __METHOD__ + ); foreach ( $res as $row ) { unset( $xBlobIds[$row->blob_id] ); } @@ -224,7 +234,7 @@ class CheckStorage { $res = $dbr->select( 'text', [ 'old_id', 'old_flags', "LEFT(old_text, $headerLength) AS header" ], - [ 'old_id IN (' . implode( ',', $objectRevs ) . ')' ], + [ 'old_id' => $objectRevs ], __METHOD__ ); foreach ( $res as $row ) { @@ -283,7 +293,7 @@ class CheckStorage { $res = $dbr->select( 'text', [ 'old_id', 'old_flags', "LEFT(old_text, $headerLength) AS header" ], - [ 'old_id IN (' . implode( ',', array_keys( $concatBlobs ) ) . ')' ], + [ 'old_id' => array_keys( $concatBlobs ) ], __METHOD__ ); foreach ( $res as $row ) { @@ -402,7 +412,9 @@ class CheckStorage { $headerLength = strlen( self::CONCAT_HEADER ); $res = $extDb->select( $blobsTable, [ 'blob_id', "LEFT(blob_text, $headerLength) AS header" ], - [ 'blob_id IN( ' . implode( ',', $blobIds ) . ')' ], __METHOD__ ); + [ 'blob_id' => $blobIds ], + __METHOD__ + ); foreach ( $res as $row ) { if ( strcasecmp( $row->header, self::CONCAT_HEADER ) ) { $this->addError(