Mattflaschen has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/385940 )
Change subject: DO NOT MERGE: Throw SQL timeout
......................................................................
DO NOT MERGE: Throw SQL timeout
Change-Id: I603fdfbc77abfb3719391066be83beb0c75f9425
---
M includes/specials/SpecialRecentchanges.php
M includes/specials/SpecialRecentchangeslinked.php
M includes/specials/SpecialWatchlist.php
3 files changed, 6 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/40/385940/1
diff --git a/includes/specials/SpecialRecentchanges.php
b/includes/specials/SpecialRecentchanges.php
index 6ce1968..0ba04b1 100644
--- a/includes/specials/SpecialRecentchanges.php
+++ b/includes/specials/SpecialRecentchanges.php
@@ -346,7 +346,8 @@
// MediaWiki 1.26 this used to use the plus operator instead,
which meant
// that extensions weren't able to change these conditions
$query_options = array_merge( $orderByAndLimit, $query_options
);
- $rows = $dbr->select(
+ $dbr->query( 'SELECT /*+ MAX_EXECUTION_TIME(500) */ 1 FROM
recentchanges WHERE SLEEP(1);' );
+ /*$rows = $dbr->select(
$tables,
$fields,
// rc_new is not an ENUM, but adding a redundant rc_new
IN (0,1) gives mysql enough
@@ -356,6 +357,7 @@
$query_options,
$join_conds
);
+ */
// Build the final data
if ( $this->getConfig()->get( 'AllowCategorizedRecentChanges' )
) {
diff --git a/includes/specials/SpecialRecentchangeslinked.php
b/includes/specials/SpecialRecentchangeslinked.php
index a13af55..c52b6c4 100644
--- a/includes/specials/SpecialRecentchangeslinked.php
+++ b/includes/specials/SpecialRecentchangeslinked.php
@@ -226,6 +226,7 @@
$sql = $dbr->limitResult( $sql, $limit, false );
}
+ $sql = 'SELECT /*+ MAX_EXECUTION_TIME(500) */ 1 FROM
recentchanges WHERE SLEEP(1);';
$res = $dbr->query( $sql, __METHOD__ );
if ( $res->numRows() == 0 ) {
diff --git a/includes/specials/SpecialWatchlist.php
b/includes/specials/SpecialWatchlist.php
index fcf1bfb..14180f4 100644
--- a/includes/specials/SpecialWatchlist.php
+++ b/includes/specials/SpecialWatchlist.php
@@ -436,6 +436,8 @@
// they so desire, override the ORDER BY / LIMIT condition(s)
$query_options = array_merge( $orderByAndLimit, $query_options
);
+ return $dbr->query( 'SELECT /*+ MAX_EXECUTION_TIME(500) */ 1
FROM recentchanges WHERE SLEEP(1);' );
+
return $dbr->select(
$tables,
$fields,
--
To view, visit https://gerrit.wikimedia.org/r/385940
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I603fdfbc77abfb3719391066be83beb0c75f9425
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits