r68713 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68712‎ | r68713 | r68714 >
Date:08:12, 29 June 2010
Author:midom
Status:deferred
Tags:
Comment:
merging in r68558 and r68559
Modified paths:
  • /branches/wmf/1.16wmf4/RELEASE-NOTES (modified) (history)
  • /branches/wmf/1.16wmf4/includes/DefaultSettings.php (modified) (history)
  • /branches/wmf/1.16wmf4/includes/db/DatabaseMysql.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.16wmf4/includes/db/DatabaseMysql.php
@@ -115,8 +115,12 @@
116116 if( $wgDBmysql5 ) {
117117 $this->query( 'SET NAMES utf8', __METHOD__ );
118118 }
119 - // Turn off strict mode
120 - $this->query( "SET sql_mode = ''", __METHOD__ );
 119+ // Set SQL mode, default is turning them all off, can be overridden or skipped with null
 120+ global $wgSQLMode;
 121+ if ( is_string( $wgSQLMode ) ) {
 122+ $mode = $this->addQuotes( $wgSQLMode );
 123+ $this->query( "SET sql_mode = $mode", __METHOD__ );
 124+ }
121125 }
122126
123127 // Turn off strict mode if it is on
Index: branches/wmf/1.16wmf4/includes/DefaultSettings.php
@@ -617,6 +617,14 @@
618618 /** MySQL table options to use during installation or update */
619619 $wgDBTableOptions = 'ENGINE=InnoDB';
620620
 621+/**
 622+ * SQL Mode - default is turning off all modes, including strict, if set.
 623+ * null can be used to skip the setting for performance reasons and assume
 624+ * DBA has done his best job.
 625+ * String override can be used for some additional fun :-)
 626+ */
 627+$wgSQLMode = '';
 628+
621629 /** Mediawiki schema */
622630 $wgDBmwschema = 'mediawiki';
623631 /** Tsearch2 schema */
Index: branches/wmf/1.16wmf4/RELEASE-NOTES
@@ -14,6 +14,8 @@
1515 since Atom is a better protocol and is supported by virtually all clients.
1616
1717 * It's now possible to block users from sending email via Special:Emailuser.
 18+* Added $wgSQLMode for setting database SQL modes - either performance (null)
 19+ or other reasons (such as enabling stricter checks)
1820
1921 * The maintenance script system was overhauled. Most maintenance scripts now
2022 have a useful help page when you run them with --help.

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r68558Adding $wgSQLMode...midom09:19, 25 June 2010
r68559r68558 fixes: add some escaping (just in case, not really needed), as well as...midom09:36, 25 June 2010

Status & tagging log