[],
[ 'content' => [ 'INNER JOIN', [ 'content_id = slot_content_id' ] ] ]
);
+ /** @var \MediaWiki\Storage\SqlBlobStore $blobStore */
$blobStore = MediaWikiServices::getInstance()->getBlobStore();
+ '@phan-var \MediaWiki\Storage\SqlBlobStore $blobStore';
foreach ( $res as $row ) {
$textId = $blobStore->getTextIdFromAddress( $row->content_address );
if ( $textId ) {
}
foreach ( $externalConcatBlobs as $cluster => $xBlobIds ) {
$blobIds = array_keys( $xBlobIds );
- $extDb =& $this->dbStore->getSlave( $cluster );
+ $extDb =& $this->dbStore->getReplica( $cluster );
$blobsTable = $this->dbStore->getTable( $extDb );
$res = $extDb->select( $blobsTable,
[ 'blob_id' ],
foreach ( $externalConcatBlobs as $cluster => $oldIds ) {
$blobIds = array_keys( $oldIds );
- $extDb =& $this->dbStore->getSlave( $cluster );
+ $extDb =& $this->dbStore->getReplica( $cluster );
$blobsTable = $this->dbStore->getTable( $extDb );
$headerLength = strlen( self::CONCAT_HEADER );
$res = $extDb->select( $blobsTable,
// Find text row again
$dbr = wfGetDB( DB_REPLICA );
- $oldId = $dbr->selectField( 'revision', 'rev_text_id', [ 'rev_id' => $id ], __METHOD__ );
+ global $wgMultiContentRevisionSchemaMigrationStage;
+ if ( $wgMultiContentRevisionSchemaMigrationStage & SCHEMA_COMPAT_READ_OLD ) {
+ $oldId = $dbr->selectField( 'revision', 'rev_text_id', [ 'rev_id' => $id ], __METHOD__ );
+ } else {
+ $res = $dbr->selectRow(
+ [ 'slots', 'content' ],
+ [ 'content_address' ],
+ [ 'slot_revision_id' => $id ],
+ __METHOD__,
+ [],
+ [ 'content' => [ 'INNER JOIN', [ 'content_id = slot_content_id' ] ] ]
+ );
+ // @phan-suppress-next-line PhanAccessMethodInternal
+ $blobStore = MediaWikiServices::getInstance()
+ ->getBlobStoreFactory()
+ ->newSqlBlobStore();
+ $oldId = $blobStore->getTextIdFromAddress( $res->content_address );
+ }
+
if ( !$oldId ) {
echo "Missing revision row for rev_id $id\n";
-
return;
}