aboutsummaryrefslogtreecommitdiffstats
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/api/ApiQueryAllPages.php5
-rw-r--r--includes/specials/SpecialAllPages.php5
-rw-r--r--includes/specials/SpecialPrefixindex.php6
-rw-r--r--includes/specials/pagers/AllMessagesTablePager.php5
4 files changed, 17 insertions, 4 deletions
diff --git a/includes/api/ApiQueryAllPages.php b/includes/api/ApiQueryAllPages.php
index 9cff65e37efc..4cf421eaa96a 100644
--- a/includes/api/ApiQueryAllPages.php
+++ b/includes/api/ApiQueryAllPages.php
@@ -207,7 +207,10 @@ class ApiQueryAllPages extends ApiQueryGeneratorBase {
}
if ( $forceNameTitleIndex ) {
- $this->addOption( 'USE INDEX', 'name_title' );
+ // T270033 Index renaming
+ $pageIndex = $db->indexExists( 'page', 'name_title', __METHOD__ )
+ ? 'name_title' : 'page_name_title';
+ $this->addOption( 'USE INDEX', $pageIndex );
}
$limit = $params['limit'];
diff --git a/includes/specials/SpecialAllPages.php b/includes/specials/SpecialAllPages.php
index 132797a09904..64f8087c875c 100644
--- a/includes/specials/SpecialAllPages.php
+++ b/includes/specials/SpecialAllPages.php
@@ -224,6 +224,9 @@ class SpecialAllPages extends IncludableSpecialPage {
if ( $toKey !== "" ) {
$conds[] = 'page_title <= ' . $dbr->addQuotes( $toKey );
}
+ // T270033 Index renaming
+ $pageIndex = $dbr->indexExists( 'page', 'name_title', __METHOD__ )
+ ? 'name_title' : 'page_name_title';
$res = $dbr->select( 'page',
[ 'page_namespace', 'page_title', 'page_is_redirect', 'page_id' ],
@@ -232,7 +235,7 @@ class SpecialAllPages extends IncludableSpecialPage {
[
'ORDER BY' => 'page_title',
'LIMIT' => $this->maxPerPage + 1,
- 'USE INDEX' => 'name_title',
+ 'USE INDEX' => $pageIndex,
]
);
diff --git a/includes/specials/SpecialPrefixindex.php b/includes/specials/SpecialPrefixindex.php
index d8a9f7591a93..2460830a86c6 100644
--- a/includes/specials/SpecialPrefixindex.php
+++ b/includes/specials/SpecialPrefixindex.php
@@ -192,6 +192,10 @@ class SpecialPrefixindex extends SpecialAllPages {
$conds['page_is_redirect'] = 0;
}
+ // T270033 Index renaming
+ $pageIndex = $dbr->indexExists( 'page', 'name_title', __METHOD__ )
+ ? 'name_title' : 'page_name_title';
+
$res = $dbr->select( 'page',
array_merge(
[ 'page_namespace', 'page_title' ],
@@ -202,7 +206,7 @@ class SpecialPrefixindex extends SpecialAllPages {
[
'ORDER BY' => 'page_title',
'LIMIT' => $this->maxPerPage + 1,
- 'USE INDEX' => 'name_title',
+ 'USE INDEX' => $pageIndex,
]
);
diff --git a/includes/specials/pagers/AllMessagesTablePager.php b/includes/specials/pagers/AllMessagesTablePager.php
index 70dae5d9780f..2fe3587e9388 100644
--- a/includes/specials/pagers/AllMessagesTablePager.php
+++ b/includes/specials/pagers/AllMessagesTablePager.php
@@ -162,12 +162,15 @@ class AllMessagesTablePager extends TablePager {
// FIXME: This function should be moved to Language:: or something.
// Fallback to global state, if not provided
$dbr = $dbr ?? wfGetDB( DB_REPLICA );
+ // T270033 Index renaming
+ $pageIndex = $dbr->indexExists( 'page', 'name_title', __METHOD__ )
+ ? 'name_title' : 'page_name_title';
$res = $dbr->select( 'page',
[ 'page_namespace', 'page_title' ],
[ 'page_namespace' => [ NS_MEDIAWIKI, NS_MEDIAWIKI_TALK ] ],
__METHOD__,
- [ 'USE INDEX' => 'name_title' ]
+ [ 'USE INDEX' => $pageIndex ]
);
$xNames = array_flip( $messageNames );