r50168 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50167‎ | r50168 | r50169 >
Date:09:31, 4 May 2009
Author:tstarling
Status:resolved (Comments)
Tags:
Comment:
(bug 18657) Workaround for MySQL optimiser bug. Replaces Domas's live patch.
Modified paths:
  • /trunk/phase3/includes/LogEventsList.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/LogEventsList.php
@@ -726,6 +726,17 @@
727727 public function getTagFilter() {
728728 return $this->mTagFilter;
729729 }
 730+
 731+ public function doQuery() {
 732+ // Work around MySQL optimizer bug
 733+ if ( in_array( get_class( $this->mDb ), array( 'Database', 'DatabaseMysql' ) ) ) {
 734+ $this->mDb->query( 'SET SQL_BIG_SELECTS=1' );
 735+ parent::doQuery();
 736+ $this->mDb->query( 'SET SQL_BIG_SELECTS=0' );
 737+ } else {
 738+ parent::doQuery();
 739+ }
 740+ }
730741 }
731742
732743 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r51047Implemented save/restore logic for sql_big_selects, per CR comments on r50168.tstarling06:10, 27 May 2009

Comments

#Comment by Simetrical (talk | contribs)   23:54, 4 May 2009

The default value for SQL_BIG_SELECTS is 1. This code will randomly set it to 0 on log pages, which may cause unexpected behavior. Isn't it more correct to check whether it's already 1, and skip both the set and unset if it is?

#Comment by Tim Starling (talk | contribs)   06:13, 27 May 2009

The default is zero on Wikimedia, presumably for good reason, so it makes sense to set it back to zero after we're done with the log list. I've moved the DBMS-specific code into the Database classes and implemented a save/restore scheme in r51047.

Status & tagging log