diff options
author | Umherirrender <umherirrender_de.wp@web.de> | 2024-04-15 20:38:14 +0200 |
---|---|---|
committer | Umherirrender <umherirrender_de.wp@web.de> | 2024-04-15 20:42:04 +0200 |
commit | 5137fd6b1a6c3f99d3830052d5aaaf6739d5a16c (patch) | |
tree | 6957c7a1629445787e83a101f086bc5375ea390b | |
parent | 66cdfc9d4e1825f3c442a7f35695cc69f3830c08 (diff) | |
download | mediawikicore-5137fd6b1a6c3f99d3830052d5aaaf6739d5a16c.tar.gz mediawikicore-5137fd6b1a6c3f99d3830052d5aaaf6739d5a16c.zip |
Use functions of SelectQueryBuilder for STRAIGHT_JOIN / LIMIT
Change-Id: I0324f87ebf80f1c97ab162fcef9550fef691674f
-rw-r--r-- | includes/logging/LogPager.php | 2 | ||||
-rw-r--r-- | includes/page/PageStore.php | 2 | ||||
-rw-r--r-- | includes/title/Title.php | 9 |
3 files changed, 5 insertions, 8 deletions
diff --git a/includes/logging/LogPager.php b/includes/logging/LogPager.php index 9117b758cb44..6aa48bccd121 100644 --- a/includes/logging/LogPager.php +++ b/includes/logging/LogPager.php @@ -399,7 +399,7 @@ class LogPager extends ReverseChronologicalPager { // Tell it not to reorder the query. But not when tag filtering or log_search was used, as it // seems as likely to be harmed as helped in that case. if ( $this->mTagFilter === '' && !array_key_exists( 'ls_field', $this->mConds ) ) { - $queryBuilder->option( 'STRAIGHT_JOIN' ); + $queryBuilder->straightJoinOption(); } $maxExecTime = $this->getConfig()->get( MainConfigNames::MaxExecutionTimeForExpensiveQueries ); diff --git a/includes/page/PageStore.php b/includes/page/PageStore.php index e1786e9e1cf9..4cf8411c4d1c 100644 --- a/includes/page/PageStore.php +++ b/includes/page/PageStore.php @@ -435,7 +435,7 @@ class PageStore implements PageLookup { return $this->newSelectQueryBuilder() ->whereTitlePrefix( $page->getNamespace(), $page->getDBkey() . '/' ) ->orderByTitle() - ->options( [ 'LIMIT' => $limit ] ) + ->limit( $limit ) ->caller( __METHOD__ ) ->fetchPageRecords(); } diff --git a/includes/title/Title.php b/includes/title/Title.php index 446a0b49725c..805d98b15ef9 100644 --- a/includes/title/Title.php +++ b/includes/title/Title.php @@ -2493,19 +2493,16 @@ class Title implements LinkTarget, PageIdentity { return []; } - $options = []; - if ( $limit > -1 ) { - $options['LIMIT'] = $limit; - } - $services = MediaWikiServices::getInstance(); $pageStore = $services->getPageStore(); $titleFactory = $services->getTitleFactory(); $query = $pageStore->newSelectQueryBuilder() ->fields( $pageStore->getSelectFields() ) ->whereTitlePrefix( $this->getNamespace(), $this->getDBkey() . '/' ) - ->options( $options ) ->caller( __METHOD__ ); + if ( $limit > -1 ) { + $query->limit( $limit ); + } return $titleFactory->newTitleArrayFromResult( $query->fetchResultSet() ); } |