Normalize use of "INNER JOIN" to "JOIN" in database queries

The ANSI SQL default join type is INNER and this might save
some line breaks here and there.

Change-Id: Ibd39976f46ca3f9b71190d3b60b76ca085787a00
This commit is contained in:
Aaron Schulz 2019-03-06 09:17:27 -08:00
parent 7110e89e54
commit cb15755e92
45 changed files with 82 additions and 82 deletions

View file

@ -339,7 +339,7 @@ class CategoryViewer extends ContextSource {
'ORDER BY' => $this->flip[$type] ? 'cl_sortkey DESC' : 'cl_sortkey',
],
[
'categorylinks' => [ 'INNER JOIN', 'cl_from = page_id' ],
'categorylinks' => [ 'JOIN', 'cl_from = page_id' ],
'category' => [ 'LEFT JOIN', [
'cat_title = page_title',
'page_namespace' => NS_CATEGORY

View file

@ -330,7 +330,7 @@ class Revision implements IDBAccessObject {
*/
public static function pageJoinCond() {
wfDeprecated( __METHOD__, '1.31' );
return [ 'INNER JOIN', [ 'page_id = rev_page' ] ];
return [ 'JOIN', [ 'page_id = rev_page' ] ];
}
/**

View file

@ -2308,7 +2308,7 @@ class RevisionStore
'page_is_redirect',
'page_len',
] );
$ret['joins']['page'] = [ 'INNER JOIN', [ 'page_id = rev_page' ] ];
$ret['joins']['page'] = [ 'JOIN', [ 'page_id = rev_page' ] ];
}
if ( in_array( 'user', $options, true ) ) {
@ -2337,7 +2337,7 @@ class RevisionStore
'old_text',
'old_flags'
] );
$ret['joins']['text'] = [ 'INNER JOIN', [ 'rev_text_id=old_id' ] ];
$ret['joins']['text'] = [ 'JOIN', [ 'rev_text_id=old_id' ] ];
}
return $ret;
@ -2413,7 +2413,7 @@ class RevisionStore
'content_address',
'content_model',
] );
$ret['joins']['content'] = [ 'INNER JOIN', [ 'slot_content_id = content_id' ] ];
$ret['joins']['content'] = [ 'JOIN', [ 'slot_content_id = content_id' ] ];
if ( in_array( 'model', $options, true ) ) {
// Use left join to attach model name, so we still find the revision row even

View file

@ -131,7 +131,7 @@ class ApiQueryAllDeletedRevisions extends ApiQueryRevisionsBase {
if ( !is_null( $params['tag'] ) ) {
$this->addTables( 'change_tag' );
$this->addJoinConds(
[ 'change_tag' => [ 'INNER JOIN', [ 'ar_rev_id=ct_rev_id' ] ] ]
[ 'change_tag' => [ 'JOIN', [ 'ar_rev_id=ct_rev_id' ] ] ]
);
$changeTagDefStore = MediaWikiServices::getInstance()->getChangeTagDefStore();
try {

View file

@ -105,7 +105,7 @@ class ApiQueryAllRevisions extends ApiQueryRevisionsBase {
if ( $needPageTable ) {
$revQuery['tables'][] = 'page';
$revQuery['joins']['page'] = [ 'INNER JOIN', [ "$pageField = page_id" ] ];
$revQuery['joins']['page'] = [ 'JOIN', [ "$pageField = page_id" ] ];
if ( (bool)$miser_ns ) {
$revQuery['fields'][] = 'page_namespace';
}

View file

@ -117,7 +117,7 @@ class ApiQueryAllUsers extends ApiQueryBase {
$this->addTables( 'user_groups', 'ug1' );
$this->addJoinConds( [
'ug1' => [
'INNER JOIN',
'JOIN',
[
'ug1.ug_user=user_id',
'ug1.ug_group' => $params['group'],
@ -172,7 +172,7 @@ class ApiQueryAllUsers extends ApiQueryBase {
// There shouldn't be any duplicate rows in querycachetwo here.
$this->addTables( 'querycachetwo' );
$this->addJoinConds( [ 'querycachetwo' => [
'INNER JOIN', [
'JOIN', [
'qcc_type' => 'activeusers',
'qcc_namespace' => NS_USER,
'qcc_title=user_name',

View file

@ -176,7 +176,7 @@ class ApiQueryContributors extends ApiQueryBase {
$limitGroups = array_unique( $limitGroups );
$this->addTables( 'user_groups' );
$this->addJoinConds( [ 'user_groups' => [
$excludeGroups ? 'LEFT OUTER JOIN' : 'INNER JOIN',
$excludeGroups ? 'LEFT OUTER JOIN' : 'JOIN',
[
'ug_user=' . $revQuery['fields']['rev_user'],
'ug_group' => $limitGroups,

View file

@ -83,7 +83,7 @@ class ApiQueryDeletedRevisions extends ApiQueryRevisionsBase {
if ( !is_null( $params['tag'] ) ) {
$this->addTables( 'change_tag' );
$this->addJoinConds(
[ 'change_tag' => [ 'INNER JOIN', [ 'ar_rev_id=ct_rev_id' ] ] ]
[ 'change_tag' => [ 'JOIN', [ 'ar_rev_id=ct_rev_id' ] ] ]
);
$changeTagDefStore = MediaWikiServices::getInstance()->getChangeTagDefStore();
try {

View file

@ -137,7 +137,7 @@ class ApiQueryDeletedrevs extends ApiQueryBase {
if ( !is_null( $params['tag'] ) ) {
$this->addTables( 'change_tag' );
$this->addJoinConds(
[ 'change_tag' => [ 'INNER JOIN', [ 'ar_rev_id=ct_rev_id' ] ] ]
[ 'change_tag' => [ 'JOIN', [ 'ar_rev_id=ct_rev_id' ] ] ]
);
$changeTagDefStore = MediaWikiServices::getInstance()->getChangeTagDefStore();
try {

View file

@ -112,7 +112,7 @@ class ApiQueryLogEvents extends ApiQueryBase {
if ( !is_null( $params['tag'] ) ) {
$this->addTables( 'change_tag' );
$this->addJoinConds( [ 'change_tag' => [ 'INNER JOIN',
$this->addJoinConds( [ 'change_tag' => [ 'JOIN',
[ 'log_id=ct_log_id' ] ] ] );
$changeTagDefStore = MediaWikiServices::getInstance()->getChangeTagDefStore();
try {

View file

@ -360,7 +360,7 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase {
if ( !is_null( $params['tag'] ) ) {
$this->addTables( 'change_tag' );
$this->addJoinConds( [ 'change_tag' => [ 'INNER JOIN', [ 'rc_id=ct_rc_id' ] ] ] );
$this->addJoinConds( [ 'change_tag' => [ 'JOIN', [ 'rc_id=ct_rc_id' ] ] ] );
$changeTagDefStore = MediaWikiServices::getInstance()->getChangeTagDefStore();
try {
$this->addWhereFld( 'ct_tag_id', $changeTagDefStore->getId( $params['tag'] ) );

View file

@ -177,7 +177,7 @@ class ApiQueryRevisions extends ApiQueryRevisionsBase {
// Always join 'page' so orphaned revisions are filtered out
$this->addTables( [ 'revision', 'page' ] );
$this->addJoinConds(
[ 'page' => [ 'INNER JOIN', [ 'page_id = rev_page' ] ] ]
[ 'page' => [ 'JOIN', [ 'page_id = rev_page' ] ] ]
);
$this->addFields( [
'rev_id' => $idField, 'rev_timestamp' => $tsField, 'rev_page' => $pageField
@ -191,7 +191,7 @@ class ApiQueryRevisions extends ApiQueryRevisionsBase {
if ( $params['tag'] !== null ) {
$this->addTables( 'change_tag' );
$this->addJoinConds(
[ 'change_tag' => [ 'INNER JOIN', [ 'rev_id=ct_rev_id' ] ] ]
[ 'change_tag' => [ 'JOIN', [ 'rev_id=ct_rev_id' ] ] ]
);
$changeTagDefStore = MediaWikiServices::getInstance()->getChangeTagDefStore();
try {

View file

@ -488,7 +488,7 @@ class ApiQueryUserContribs extends ApiQueryBase {
if ( isset( $this->params['tag'] ) ) {
$this->addTables( 'change_tag' );
$this->addJoinConds(
[ 'change_tag' => [ 'INNER JOIN', [ $idField . ' = ct_rev_id' ] ] ]
[ 'change_tag' => [ 'JOIN', [ $idField . ' = ct_rev_id' ] ] ]
);
$changeTagDefStore = MediaWikiServices::getInstance()->getChangeTagDefStore();
try {

View file

@ -168,7 +168,7 @@ class ApiQueryUsers extends ApiQueryBase {
}
$this->addTables( 'user_groups' );
$this->addJoinConds( [ 'user_groups' => [ 'INNER JOIN', 'ug_user=user_id' ] ] );
$this->addJoinConds( [ 'user_groups' => [ 'JOIN', 'ug_user=user_id' ] ] );
$this->addFields( [ 'user_name' ] );
$this->addFields( UserGroupMembership::selectFields() );
$this->addWhere( 'ug_expiry IS NULL OR ug_expiry >= ' .

View file

@ -756,7 +756,7 @@ class ChangeTags {
// Add an INNER JOIN on change_tag
$tables[] = 'change_tag';
$join_conds['change_tag'] = [ 'INNER JOIN', $join_cond ];
$join_conds['change_tag'] = [ 'JOIN', $join_cond ];
$filterTagIds = [];
$changeTagDefStore = MediaWikiServices::getInstance()->getChangeTagDefStore();
foreach ( (array)$filter_tag as $filterTagName ) {
@ -808,7 +808,7 @@ class ChangeTags {
}
$tagTables = [ 'change_tag', 'change_tag_def' ];
$join_cond_ts_tags = [ 'change_tag_def' => [ 'INNER JOIN', 'ct_tag_id=ctd_id' ] ];
$join_cond_ts_tags = [ 'change_tag_def' => [ 'JOIN', 'ct_tag_id=ctd_id' ] ];
$field = 'ctd_name';
return wfGetDB( DB_REPLICA )->buildGroupConcatField(

View file

@ -372,18 +372,18 @@ class WikiExporter {
$opts[] = 'STRAIGHT_JOIN';
$opts['USE INDEX']['revision'] = 'rev_page_id';
unset( $join['revision'] );
$join['page'] = [ 'INNER JOIN', 'rev_page=page_id' ];
$join['page'] = [ 'JOIN', 'rev_page=page_id' ];
}
} elseif ( $this->history & self::CURRENT ) {
# Latest revision dumps...
if ( $this->list_authors && $cond != '' ) { // List authors, if so desired
$this->do_list_authors( $cond );
}
$join['revision'] = [ 'INNER JOIN', 'page_id=rev_page AND page_latest=rev_id' ];
$join['revision'] = [ 'JOIN', 'page_id=rev_page AND page_latest=rev_id' ];
} elseif ( $this->history & self::STABLE ) {
# "Stable" revision dumps...
# Default JOIN, to be overridden...
$join['revision'] = [ 'INNER JOIN', 'page_id=rev_page AND page_latest=rev_id' ];
$join['revision'] = [ 'JOIN', 'page_id=rev_page AND page_latest=rev_id' ];
# One, and only one hook should set this, and return false
if ( Hooks::run( 'WikiExporter::dumpStableQuery', [ &$tables, &$opts, &$join ] ) ) {
throw new MWException( __METHOD__ . " given invalid history dump type." );

View file

@ -333,7 +333,7 @@ class LogPager extends ReverseChronologicalPager {
}
}
# Don't show duplicate rows when using log_search
$joins['log_search'] = [ 'INNER JOIN', 'ls_log_id=log_id' ];
$joins['log_search'] = [ 'JOIN', 'ls_log_id=log_id' ];
$info = [
'tables' => $tables,

View file

@ -235,7 +235,7 @@ class WikiFilePage extends WikiPage {
],
__METHOD__,
[],
[ 'categorylinks' => [ 'INNER JOIN', 'page_id = cl_from' ] ]
[ 'categorylinks' => [ 'JOIN', 'page_id = cl_from' ] ]
);
return TitleArray::newFromResult( $res );

View file

@ -50,7 +50,7 @@ class AncientPagesPage extends QueryPage {
];
$joinConds = [
'revision' => [
'INNER JOIN', [
'JOIN', [
'page_latest = rev_id'
]
],

View file

@ -149,7 +149,7 @@ class SpecialPagesWithProp extends QueryPage {
'pp_propname' => $this->propName,
],
'join_conds' => [
'page' => [ 'INNER JOIN', 'page_id = pp_page' ]
'page' => [ 'JOIN', 'page_id = pp_page' ]
],
'options' => []
];

View file

@ -219,7 +219,7 @@ class SpecialRandomInCategory extends FormSpecialPage {
'OFFSET' => $offset
],
'join_conds' => [
'page' => [ 'INNER JOIN', 'cl_from = page_id' ]
'page' => [ 'JOIN', 'cl_from = page_id' ]
]
];

View file

@ -207,7 +207,7 @@ class SpecialRecentChangesLinked extends SpecialRecentChanges {
$conds + $subconds,
__METHOD__,
$order + $query_options,
$join_conds + [ $link_table => [ 'INNER JOIN', $subjoin ] ]
$join_conds + [ $link_table => [ 'JOIN', $subjoin ] ]
);
if ( $dbr->unionSupportsOrderAndLimit() ) {

View file

@ -343,7 +343,7 @@ class SpecialWatchlist extends ChangesListSpecialPage {
$join_conds = array_merge(
[
'watchlist' => [
'INNER JOIN',
'JOIN',
[
'wl_user' => $user->getId(),
'wl_namespace=rc_namespace',

View file

@ -170,7 +170,7 @@ class SpecialWhatLinksHere extends IncludableSpecialPage {
// Force JOIN order per T106682 to avoid large filesorts
[ 'ORDER BY' => $fromCol, 'LIMIT' => 2 * $queryLimit, 'STRAIGHT_JOIN' ],
[
'page' => [ 'INNER JOIN', "$fromCol = page_id" ],
'page' => [ 'JOIN', "$fromCol = page_id" ],
'redirect' => [ 'LEFT JOIN', $on ]
]
);
@ -180,7 +180,7 @@ class SpecialWhatLinksHere extends IncludableSpecialPage {
[],
__CLASS__ . '::showIndirectLinks',
[ 'ORDER BY' => 'page_id', 'LIMIT' => $queryLimit ],
[ 'page' => [ 'INNER JOIN', "$fromCol = page_id" ] ]
[ 'page' => [ 'JOIN', "$fromCol = page_id" ] ]
);
};

View file

@ -122,7 +122,7 @@ class NewFilesPager extends RangeChronologicalPager {
$jcond = $rcQuery['fields']['rc_user'] . ' = ' . $imgQuery['fields']['img_user'];
}
$jconds['recentchanges'] = [
'INNER JOIN',
'JOIN',
[
'rc_title = img_name',
$jcond,

View file

@ -102,7 +102,7 @@ class NewPagesPager extends ReverseChronologicalPager {
$fields = array_merge( $rcQuery['fields'], [
'length' => 'page_len', 'rev_id' => 'page_latest', 'page_namespace', 'page_title'
] );
$join_conds = [ 'page' => [ 'INNER JOIN', 'page_id=rc_cur_id' ] ] + $rcQuery['joins'];
$join_conds = [ 'page' => [ 'JOIN', 'page_id=rc_cur_id' ] ] + $rcQuery['joins'];
// Avoid PHP 7.1 warning from passing $this by reference
$pager = $this;

View file

@ -693,7 +693,7 @@ class WatchedItemQueryService {
private function getWatchedItemsWithRCInfoQueryJoinConds( array $options ) {
$joinConds = [
'watchlist' => [ 'INNER JOIN',
'watchlist' => [ 'JOIN',
[
'wl_namespace=rc_namespace',
'wl_title=rc_title'

View file

@ -145,7 +145,7 @@ class BenchmarkParse extends Maintenance {
],
__METHOD__,
[ 'ORDER BY' => 'rev_timestamp DESC', 'LIMIT' => 1 ],
[ 'revision' => [ 'INNER JOIN', 'rev_page=page_id' ] ]
[ 'revision' => [ 'JOIN', 'rev_page=page_id' ] ]
);
return $id;

View file

@ -307,7 +307,7 @@ SPARQL;
'rc_type' => RC_LOG,
] );
$it->addJoinConditions( [
'page' => [ 'INNER JOIN', 'rc_cur_id = page_id' ],
'page' => [ 'JOIN', 'rc_cur_id = page_id' ],
] );
$this->addIndex( $it );
return $it;

View file

@ -46,7 +46,7 @@ class FindMissingFiles extends Maintenance {
$joinConds = [];
if ( $mtime1 || $mtime2 ) {
$joinTables[] = 'page';
$joinConds['page'] = [ 'INNER JOIN',
$joinConds['page'] = [ 'JOIN',
[ 'page_title = img_name', 'page_namespace' => NS_FILE ] ];
$joinTables[] = 'logging';
$on = [ 'log_page = page_id', 'log_type' => [ 'upload', 'move', 'delete' ] ];
@ -56,7 +56,7 @@ class FindMissingFiles extends Maintenance {
if ( $mtime2 ) {
$on[] = "log_timestamp < {$dbr->addQuotes($mtime2)}";
}
$joinConds['logging'] = [ 'INNER JOIN', $on ];
$joinConds['logging'] = [ 'JOIN', $on ];
}
do {

View file

@ -160,7 +160,7 @@ class PopulateContentModel extends Maintenance {
} else { // revision
$selectTables = [ 'revision', 'page' ];
$fields = [ 'page_title', 'page_namespace' ];
$join_conds = [ 'page' => [ 'INNER JOIN', 'rev_page=page_id' ] ];
$join_conds = [ 'page' => [ 'JOIN', 'rev_page=page_id' ] ];
$where = $ns === 'all' ? [] : [ 'page_namespace' => $ns ];
$page_id_column = 'rev_page';
$rev_id_column = 'rev_id';

View file

@ -99,7 +99,7 @@ class PurgeChangedPages extends Maintenance {
__METHOD__,
[ 'ORDER BY' => 'rev_timestamp', 'LIMIT' => $bSize ],
[
'page' => [ 'INNER JOIN', 'rev_page=page_id' ],
'page' => [ 'JOIN', 'rev_page=page_id' ],
]
);

View file

@ -55,7 +55,7 @@ class McrReadNewRevisionStoreDbTest extends RevisionStoreDbTestBase {
[ 'rev_id' => $rev->getId(), 'rev_text_id > 0' ],
[ [ 1 ] ],
[],
[ 'text' => [ 'INNER JOIN', [ 'rev_text_id = old_id' ] ] ]
[ 'text' => [ 'JOIN', [ 'rev_text_id = old_id' ] ] ]
);
parent::assertRevisionExistsInDatabase( $rev );

View file

@ -55,7 +55,7 @@ class McrWriteBothRevisionStoreDbTest extends RevisionStoreDbTestBase {
[ 'rev_id' => $rev->getId(), 'rev_text_id > 0' ],
[ [ 1 ] ],
[],
[ 'text' => [ 'INNER JOIN', [ 'rev_text_id = old_id' ] ] ]
[ 'text' => [ 'JOIN', [ 'rev_text_id = old_id' ] ] ]
);
parent::assertRevisionExistsInDatabase( $rev );

View file

@ -80,7 +80,7 @@ class NoContentModelRevisionStoreDbTest extends RevisionStoreDbTestBase {
]
),
'joins' => [
'page' => [ 'INNER JOIN', [ 'page_id = rev_page' ] ],
'page' => [ 'JOIN', [ 'page_id = rev_page' ] ],
],
]
];
@ -115,7 +115,7 @@ class NoContentModelRevisionStoreDbTest extends RevisionStoreDbTestBase {
]
),
'joins' => [
'text' => [ 'INNER JOIN', [ 'rev_text_id=old_id' ] ],
'text' => [ 'JOIN', [ 'rev_text_id=old_id' ] ],
],
]
];

View file

@ -38,7 +38,7 @@ class PreMcrRevisionStoreDbTest extends RevisionStoreDbTestBase {
[ 'rev_id' => $rev->getId(), 'rev_text_id > 0' ],
[ [ 1 ] ],
[],
[ 'text' => [ 'INNER JOIN', [ 'rev_text_id = old_id' ] ] ]
[ 'text' => [ 'JOIN', [ 'rev_text_id = old_id' ] ] ]
);
parent::assertRevisionExistsInDatabase( $rev );

View file

@ -244,7 +244,7 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
$this->getNewCommentQueryFields( 'rev' )
),
'joins' => [
'page' => [ 'INNER JOIN', [ 'page_id = rev_page' ] ],
'page' => [ 'JOIN', [ 'page_id = rev_page' ] ],
'user' => [
'LEFT JOIN',
[ 'actor_rev_user.actor_user != 0', 'user_id = actor_rev_user.actor_user' ],
@ -289,7 +289,7 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
),
'joins' => array_merge(
[
'page' => [ 'INNER JOIN', [ 'page_id = rev_page' ] ],
'page' => [ 'JOIN', [ 'page_id = rev_page' ] ],
'user' => [
'LEFT JOIN',
[
@ -332,7 +332,7 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
),
'joins' => array_merge(
[
'page' => [ 'INNER JOIN', [ 'page_id = rev_page' ] ],
'page' => [ 'JOIN', [ 'page_id = rev_page' ] ],
'user' => [
'LEFT JOIN',
[
@ -401,7 +401,7 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
),
'joins' => array_merge(
[
'page' => [ 'INNER JOIN', [ 'page_id = rev_page' ] ],
'page' => [ 'JOIN', [ 'page_id = rev_page' ] ],
'user' => [
'LEFT JOIN',
[
@ -464,7 +464,7 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
$this->getNewCommentQueryFields( 'rev' )
),
'joins' => [
'page' => [ 'INNER JOIN', [ 'page_id = rev_page' ] ],
'page' => [ 'JOIN', [ 'page_id = rev_page' ] ],
'user' => [ 'LEFT JOIN', [ 'rev_user != 0', 'user_id = rev_user' ] ],
'temp_rev_comment' => [ 'JOIN', 'temp_rev_comment.revcomment_rev = rev_id' ],
'comment_rev_comment'
@ -517,7 +517,7 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
$this->getNewCommentQueryFields( 'rev' )
),
'joins' => [
'page' => [ 'INNER JOIN', [ 'page_id = rev_page' ], ],
'page' => [ 'JOIN', [ 'page_id = rev_page' ], ],
'temp_rev_comment' => [ 'JOIN', 'temp_rev_comment.revcomment_rev = rev_id' ],
'comment_rev_comment'
=> [ 'JOIN', 'comment_rev_comment.comment_id = temp_rev_comment.revcomment_comment_id' ],
@ -571,7 +571,7 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
$this->getNewCommentQueryFields( 'rev' )
),
'joins' => [
'text' => [ 'INNER JOIN', [ 'rev_text_id=old_id' ] ],
'text' => [ 'JOIN', [ 'rev_text_id=old_id' ] ],
'temp_rev_comment' => [ 'JOIN', 'temp_rev_comment.revcomment_rev = rev_id' ],
'comment_rev_comment'
=> [ 'JOIN', 'comment_rev_comment.comment_id = temp_rev_comment.revcomment_comment_id' ],
@ -601,7 +601,7 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
),
'joins' => [
'page' => [
'INNER JOIN',
'JOIN',
[ 'page_id = rev_page' ],
],
'user' => [
@ -612,7 +612,7 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
],
],
'text' => [
'INNER JOIN',
'JOIN',
[ 'rev_text_id=old_id' ],
],
'temp_rev_comment' => [ 'JOIN', 'temp_rev_comment.revcomment_rev = rev_id' ],
@ -686,7 +686,7 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
'content_model',
],
'joins' => [
'content' => [ 'INNER JOIN', [ 'slot_content_id = content_id' ] ],
'content' => [ 'JOIN', [ 'slot_content_id = content_id' ] ],
],
]
];
@ -714,7 +714,7 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
'model_name',
],
'joins' => [
'content' => [ 'INNER JOIN', [ 'slot_content_id = content_id' ] ],
'content' => [ 'JOIN', [ 'slot_content_id = content_id' ] ],
'content_models' => [ 'LEFT JOIN', [ 'content_model = model_id' ] ],
],
]
@ -993,7 +993,7 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
public function testRevisionPageJoinCond() {
$this->hideDeprecated( 'Revision::pageJoinCond' );
$this->assertEquals(
[ 'INNER JOIN', [ 'page_id = rev_page' ] ],
[ 'JOIN', [ 'page_id = rev_page' ] ],
Revision::pageJoinCond()
);
}

View file

@ -51,7 +51,7 @@ class RevisionMcrReadNewDbTest extends RevisionDbTestBase {
[
'tables' => [ 'text' ],
'fields' => [ 'old_id', 'old_text', 'old_flags', 'rev_text_id' ],
'joins' => [ 'text' => [ 'INNER JOIN', 'old_id=rev_text_id' ] ]
'joins' => [ 'text' => [ 'JOIN', 'old_id=rev_text_id' ] ]
]
];
}

View file

@ -131,8 +131,8 @@ class ApiBlockTest extends ApiTestCase {
__METHOD__,
[],
[
'change_tag' => [ 'INNER JOIN', 'ct_log_id = log_id' ],
'change_tag_def' => [ 'INNER JOIN', 'ctd_id = ct_tag_id' ],
'change_tag' => [ 'JOIN', 'ct_log_id = log_id' ],
'change_tag_def' => [ 'JOIN', 'ctd_id = ct_tag_id' ],
]
) );
}

View file

@ -128,8 +128,8 @@ class ApiDeleteTest extends ApiTestCase {
__METHOD__,
[],
[
'change_tag' => [ 'INNER JOIN', 'ct_log_id = log_id' ],
'change_tag_def' => [ 'INNER JOIN', 'ctd_id = ct_tag_id' ]
'change_tag' => [ 'JOIN', 'ct_log_id = log_id' ],
'change_tag_def' => [ 'JOIN', 'ctd_id = ct_tag_id' ]
]
) );
}

View file

@ -1349,7 +1349,7 @@ class ApiEditPageTest extends ApiTestCase {
'ctd_name',
[ 'ct_rev_id' => $revId ],
__METHOD__,
[ 'change_tag_def' => [ 'INNER JOIN', 'ctd_id = ct_tag_id' ] ]
[ 'change_tag_def' => [ 'JOIN', 'ctd_id = ct_tag_id' ] ]
)
);
}

View file

@ -127,8 +127,8 @@ class ApiUnblockTest extends ApiTestCase {
__METHOD__,
[],
[
'change_tag' => [ 'INNER JOIN', 'ct_log_id = log_id' ],
'change_tag_def' => [ 'INNER JOIN', 'ctd_id = ct_tag_id' ],
'change_tag' => [ 'JOIN', 'ct_log_id = log_id' ],
'change_tag_def' => [ 'JOIN', 'ctd_id = ct_tag_id' ],
]
) );
}

View file

@ -206,7 +206,7 @@ class ApiUserrightsTest extends ApiTestCase {
'log_title' => strtr( $user->getName(), ' ', '_' )
],
__METHOD__,
[ 'change_tag_def' => [ 'INNER JOIN', 'ctd_id = ct_tag_id' ] ]
[ 'change_tag_def' => [ 'JOIN', 'ctd_id = ct_tag_id' ] ]
)
);
}

View file

@ -62,7 +62,7 @@ class ChangeTagsTest extends MediaWikiTestCase {
// HACK if we call $dbr->buildGroupConcatField() now, it will return the wrong table names
// We have to have the test runner call it instead
$baseConcats = [ ',', [ 'change_tag', 'change_tag_def' ], 'ctd_name' ];
$joinConds = [ 'change_tag_def' => [ 'INNER JOIN', 'ct_tag_id=ctd_id' ] ];
$joinConds = [ 'change_tag_def' => [ 'JOIN', 'ct_tag_id=ctd_id' ] ];
$groupConcats = [
'recentchanges' => array_merge( $baseConcats, [ 'ct_rc_id=rc_id', $joinConds ] ),
'logging' => array_merge( $baseConcats, [ 'ct_log_id=log_id', $joinConds ] ),
@ -121,7 +121,7 @@ class ChangeTagsTest extends MediaWikiTestCase {
'tables' => [ 'recentchanges', 'change_tag' ],
'fields' => [ 'rc_id', 'rc_timestamp', 'ts_tags' => $groupConcats['recentchanges'] ],
'conds' => [ "rc_timestamp > '20170714183203'", 'ct_tag_id' => [ 1 ] ],
'join_conds' => [ 'change_tag' => [ 'INNER JOIN', 'ct_rc_id=rc_id' ] ],
'join_conds' => [ 'change_tag' => [ 'JOIN', 'ct_rc_id=rc_id' ] ],
'options' => [ 'ORDER BY' => 'rc_timestamp DESC' ],
]
],
@ -139,7 +139,7 @@ class ChangeTagsTest extends MediaWikiTestCase {
'tables' => [ 'logging', 'change_tag' ],
'fields' => [ 'log_id', 'ts_tags' => $groupConcats['logging'] ],
'conds' => [ "log_timestamp > '20170714183203'", 'ct_tag_id' => [ 1 ] ],
'join_conds' => [ 'change_tag' => [ 'INNER JOIN', 'ct_log_id=log_id' ] ],
'join_conds' => [ 'change_tag' => [ 'JOIN', 'ct_log_id=log_id' ] ],
'options' => [ 'ORDER BY log_timestamp DESC' ],
]
],
@ -157,7 +157,7 @@ class ChangeTagsTest extends MediaWikiTestCase {
'tables' => [ 'revision', 'change_tag' ],
'fields' => [ 'rev_id', 'rev_timestamp', 'ts_tags' => $groupConcats['revision'] ],
'conds' => [ "rev_timestamp > '20170714183203'", 'ct_tag_id' => [ 1 ] ],
'join_conds' => [ 'change_tag' => [ 'INNER JOIN', 'ct_rev_id=rev_id' ] ],
'join_conds' => [ 'change_tag' => [ 'JOIN', 'ct_rev_id=rev_id' ] ],
'options' => [ 'ORDER BY' => 'rev_timestamp DESC' ],
]
],
@ -175,7 +175,7 @@ class ChangeTagsTest extends MediaWikiTestCase {
'tables' => [ 'archive', 'change_tag' ],
'fields' => [ 'ar_id', 'ar_timestamp', 'ts_tags' => $groupConcats['archive'] ],
'conds' => [ "ar_timestamp > '20170714183203'", 'ct_tag_id' => [ 1 ] ],
'join_conds' => [ 'change_tag' => [ 'INNER JOIN', 'ct_rev_id=ar_rev_id' ] ],
'join_conds' => [ 'change_tag' => [ 'JOIN', 'ct_rev_id=ar_rev_id' ] ],
'options' => [ 'ORDER BY' => 'ar_timestamp DESC' ],
]
],
@ -223,7 +223,7 @@ class ChangeTagsTest extends MediaWikiTestCase {
'tables' => [ 'recentchanges', 'change_tag' ],
'fields' => [ 'rc_id', 'rc_timestamp', 'ts_tags' => $groupConcats['recentchanges'] ],
'conds' => [ "rc_timestamp > '20170714183203'", 'ct_tag_id' => [ 1, 2 ] ],
'join_conds' => [ 'change_tag' => [ 'INNER JOIN', 'ct_rc_id=rc_id' ] ],
'join_conds' => [ 'change_tag' => [ 'JOIN', 'ct_rc_id=rc_id' ] ],
'options' => [ 'ORDER BY' => 'rc_timestamp DESC', 'DISTINCT' ],
]
],
@ -241,7 +241,7 @@ class ChangeTagsTest extends MediaWikiTestCase {
'tables' => [ 'recentchanges', 'change_tag' ],
'fields' => [ 'rc_id', 'rc_timestamp', 'ts_tags' => $groupConcats['recentchanges'] ],
'conds' => [ "rc_timestamp > '20170714183203'", 'ct_tag_id' => [ 1, 2 ] ],
'join_conds' => [ 'change_tag' => [ 'INNER JOIN', 'ct_rc_id=rc_id' ] ],
'join_conds' => [ 'change_tag' => [ 'JOIN', 'ct_rc_id=rc_id' ] ],
'options' => [ 'DISTINCT', 'ORDER BY' => 'rc_timestamp DESC' ],
]
],
@ -259,7 +259,7 @@ class ChangeTagsTest extends MediaWikiTestCase {
'tables' => [ 'recentchanges', 'change_tag' ],
'fields' => [ 'rc_id', 'ts_tags' => $groupConcats['recentchanges'] ],
'conds' => [ "rc_timestamp > '20170714183203'", 'ct_tag_id' => [ 1, 2 ] ],
'join_conds' => [ 'change_tag' => [ 'INNER JOIN', 'ct_rc_id=rc_id' ] ],
'join_conds' => [ 'change_tag' => [ 'JOIN', 'ct_rc_id=rc_id' ] ],
'options' => [ 'ORDER BY rc_timestamp DESC', 'DISTINCT' ],
]
],

View file

@ -263,7 +263,7 @@ class WatchedItemQueryServiceUnitTest extends MediaWikiTestCase {
],
[
'watchlist' => [
'INNER JOIN',
'JOIN',
[
'wl_namespace=rc_namespace',
'wl_title=rc_title'
@ -386,7 +386,7 @@ class WatchedItemQueryServiceUnitTest extends MediaWikiTestCase {
],
[
'watchlist' => [
'INNER JOIN',
'JOIN',
[
'wl_namespace=rc_namespace',
'wl_title=rc_title'
@ -888,7 +888,7 @@ class WatchedItemQueryServiceUnitTest extends MediaWikiTestCase {
$expectedJoinConds = array_merge(
[
'watchlist' => [
'INNER JOIN',
'JOIN',
[
'wl_namespace=rc_namespace',
'wl_title=rc_title'
@ -1121,7 +1121,7 @@ class WatchedItemQueryServiceUnitTest extends MediaWikiTestCase {
$this->isType( 'string' ),
$this->isType( 'array' ),
array_merge( [
'watchlist' => [ 'INNER JOIN', [ 'wl_namespace=rc_namespace', 'wl_title=rc_title' ] ],
'watchlist' => [ 'JOIN', [ 'wl_namespace=rc_namespace', 'wl_title=rc_title' ] ],
'page' => [ 'LEFT JOIN', 'rc_cur_id=page_id' ],
], $expectedExtraJoins )
)
@ -1159,7 +1159,7 @@ class WatchedItemQueryServiceUnitTest extends MediaWikiTestCase {
[],
[
'watchlist' => [
'INNER JOIN',
'JOIN',
[
'wl_namespace=rc_namespace',
'wl_title=rc_title'
@ -1282,7 +1282,7 @@ class WatchedItemQueryServiceUnitTest extends MediaWikiTestCase {
[],
[
'watchlist' => [
'INNER JOIN',
'JOIN',
[
'wl_namespace=rc_namespace',
'wl_title=rc_title'
@ -1328,7 +1328,7 @@ class WatchedItemQueryServiceUnitTest extends MediaWikiTestCase {
[],
[
'watchlist' => [
'INNER JOIN',
'JOIN',
[
'wl_namespace=rc_namespace',
'wl_title=rc_title'