maintenance: Replace manual IN query with select wrapper
Bug: T182208 Change-Id: I4c410bc1f7a57efacda4ac71a074a8a8ee2d1d98
This commit is contained in:
parent
7c65b479bf
commit
002c0977ea
1 changed files with 14 additions and 6 deletions
|
|
@ -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] == '' ) {
|
||||
|
|
@ -224,7 +232,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 +291,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 ) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue