Normalize use of "INNER JOIN" to "JOIN" in database queries
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 6 Mar 2019 17:17:27 +0000 (09:17 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 6 Mar 2019 17:17:30 +0000 (09:17 -0800)
The ANSI SQL default join type is INNER and this might save
some line breaks here and there.

Change-Id: Ibd39976f46ca3f9b71190d3b60b76ca085787a00

45 files changed:
includes/CategoryViewer.php
includes/Revision.php
includes/Revision/RevisionStore.php
includes/api/ApiQueryAllDeletedRevisions.php
includes/api/ApiQueryAllRevisions.php
includes/api/ApiQueryAllUsers.php
includes/api/ApiQueryContributors.php
includes/api/ApiQueryDeletedRevisions.php
includes/api/ApiQueryDeletedrevs.php
includes/api/ApiQueryLogEvents.php
includes/api/ApiQueryRecentChanges.php
includes/api/ApiQueryRevisions.php
includes/api/ApiQueryUserContribs.php
includes/api/ApiQueryUsers.php
includes/changetags/ChangeTags.php
includes/export/WikiExporter.php
includes/logging/LogPager.php
includes/page/WikiFilePage.php
includes/specials/SpecialAncientpages.php
includes/specials/SpecialPagesWithProp.php
includes/specials/SpecialRandomInCategory.php
includes/specials/SpecialRecentchangeslinked.php
includes/specials/SpecialWatchlist.php
includes/specials/SpecialWhatlinkshere.php
includes/specials/pagers/NewFilesPager.php
includes/specials/pagers/NewPagesPager.php
includes/watcheditem/WatchedItemQueryService.php
maintenance/benchmarks/benchmarkParse.php
maintenance/categoryChangesAsRdf.php
maintenance/findMissingFiles.php
maintenance/populateContentModel.php
maintenance/purgeChangedPages.php
tests/phpunit/includes/Revision/McrReadNewRevisionStoreDbTest.php
tests/phpunit/includes/Revision/McrWriteBothRevisionStoreDbTest.php
tests/phpunit/includes/Revision/NoContentModelRevisionStoreDbTest.php
tests/phpunit/includes/Revision/PreMcrRevisionStoreDbTest.php
tests/phpunit/includes/Revision/RevisionQueryInfoTest.php
tests/phpunit/includes/RevisionMcrReadNewDbTest.php
tests/phpunit/includes/api/ApiBlockTest.php
tests/phpunit/includes/api/ApiDeleteTest.php
tests/phpunit/includes/api/ApiEditPageTest.php
tests/phpunit/includes/api/ApiUnblockTest.php
tests/phpunit/includes/api/ApiUserrightsTest.php
tests/phpunit/includes/changetags/ChangeTagsTest.php
tests/phpunit/includes/watcheditem/WatchedItemQueryServiceUnitTest.php

index a07e1b4..689624f 100644 (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
index f2ca79a..cbaff90 100644 (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' ] ];
        }
 
        /**
index cf19ffb..ee6bf67 100644 (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
index 8855615..bb50185 100644 (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 {
index 5343c33..75d75ec 100644 (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';
                                }
index a540661..d7adb9b 100644 (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',
index a8f970e..93cf016 100644 (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,
index c156341..b266ecf 100644 (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 {
index 3ee75f5..370a3fb 100644 (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 {
index 0934ab3..cc11c48 100644 (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 {
index 2d5c987..4b1bf2e 100644 (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'] ) );
index 9301f81..3781ab0 100644 (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 {
index 0ca0b20..7e548ab 100644 (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 {
index 824c4d5..66d8db4 100644 (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 >= ' .
index 91877f2..00eed14 100644 (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(
index 88282bd..52e38a0 100644 (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." );
index 32afa37..801c474 100644 (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,
index 4c2ebdc..c457a34 100644 (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 );
index 4f691cb..cea6d37 100644 (file)
@@ -50,7 +50,7 @@ class AncientPagesPage extends QueryPage {
                ];
                $joinConds = [
                        'revision' => [
-                               'INNER JOIN', [
+                               'JOIN', [
                                        'page_latest = rev_id'
                                ]
                        ],
index 46ad31c..3c009c3 100644 (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' => []
                ];
index d781e16..855f799 100644 (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' ]
                        ]
                ];
 
index e42cc70..62c867b 100644 (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() ) {
index 7772ef7..d59b66b 100644 (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',
index 766e190..b48e858 100644 (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" ] ]
                        );
                };
 
index 8bac2c4..d05ebf8 100644 (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,
index d03401d..5788bb2 100644 (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;
index a85e7e8..8b54a95 100644 (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'
index 3a79ad3..c42fcd9 100644 (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;
index 564f7ce..8324133 100644 (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;
index 4997cab..5c1d49e 100644 (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 {
index 8d64dae..e6f47d1 100644 (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';
index feeac92..0ef2a99 100644 (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' ],
                                ]
                        );
 
index 3efd372..8bf8606 100644 (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 );
index 0385708..68d3000 100644 (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 );
index 59481f0..b9b7ad9 100644 (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' ] ],
                                ],
                        ]
                ];
index 4345335..b3c34c8 100644 (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 );
index 9f1c69c..3ee61f7 100644 (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()
                );
        }
index 64de854..228bcaa 100644 (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' ] ]
                        ]
                ];
        }
index a26f8a8..01455ed 100644 (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' ],
                        ]
                ) );
        }
index 803eefb..c68954c 100644 (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' ]
                        ]
                ) );
        }
index 1706ad1..aeb829d 100644 (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' ] ]
                        )
                );
        }
index 6ebd835..ea39da7 100644 (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' ],
                        ]
                ) );
        }
index 8cc0217..5889f82 100644 (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' ] ]
                        )
                );
        }
index e9058b6..0e209d5 100644 (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' ],
                                ]
                        ],
index 50e6c20..e814a57 100644 (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'