Index: trunk/phase3/includes/db/DatabaseMysql.php |
— | — | @@ -113,8 +113,10 @@ |
114 | 114 | if( $wgDBmysql5 ) { |
115 | 115 | $this->query( 'SET NAMES utf8', __METHOD__ ); |
116 | 116 | } |
117 | | - // Turn off strict mode |
118 | | - $this->query( "SET sql_mode = ''", __METHOD__ ); |
| 117 | + // Set SQL mode, default is turning them all off, can be overridden or skipped with null |
| 118 | + if (is_string($wgSQLMode)) { |
| 119 | + $this->query( "SET sql_mode = '$wgSQLMode'", __METHOD__ ); |
| 120 | + } |
119 | 121 | } |
120 | 122 | |
121 | 123 | // Turn off strict mode if it is on |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -1123,6 +1123,14 @@ |
1124 | 1124 | /** MySQL table options to use during installation or update */ |
1125 | 1125 | $wgDBTableOptions = 'ENGINE=InnoDB'; |
1126 | 1126 | |
| 1127 | +/** |
| 1128 | + * SQL Mode - default is turning off all modes, including strict, if set. |
| 1129 | + * null can be used to skip the setting for performance reasons and assume |
| 1130 | + * DBA has done his best job. |
| 1131 | + * String override can be used for some additional fun :-) |
| 1132 | + */ |
| 1133 | +$wgSQLMode = ''; |
| 1134 | + |
1127 | 1135 | /** Mediawiki schema */ |
1128 | 1136 | $wgDBmwschema = 'mediawiki'; |
1129 | 1137 | /** Tsearch2 schema */ |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -38,6 +38,8 @@ |
39 | 39 | * Added $wgJQueryVersion, $wgJQueryMinified and $wgJQueryOnEveryPage (true by |
40 | 40 | default) to configure loading of jQuery by MediaWiki. |
41 | 41 | * XmlFunctions.php has been removed. Use the Xml or Html classes as appropriate. |
| 42 | +* Added $wgSQLMode for setting database SQL modes - either performance (null) |
| 43 | + or other reasons (such as enabling stricter checks) |
42 | 44 | |
43 | 45 | === New features in 1.17 === |
44 | 46 | * (bug 10183) Users can now add personal styles and scripts to all skins via |