Misc work going on.....
+Big things to note:
+* MySQL 3.23.x is no longer supported.
+
+
== Changes since 1.5 ==
* please fill in for the last couple weeks
* (bug 3271) Updated LanguageNn.php for HEAD
* (bug 3280) Respect 'move' group permission on page moves
* (bug 2613) Clear saved passwords from the form
+* Finally dropped MySQL 3.23.x support
=== Caveats ===
}
print "<li>Connected to $myver";
- if( version_compare( $myver, "4.0.0" ) >= 0 ) {
- print "; enabling MySQL 4 enhancements";
- $conf->DBmysql4 = true;
- $local = writeLocalSettings( $conf );
+ if( version_compare( $myver, "4.0.0" ) < 0 ) {
+ die( " -- mysql 4.0 or later required. Aborting." );
}
$mysqlNewAuth = version_compare( $myver, "4.1.0", "ge" );
if( $mysqlNewAuth && $mysqlOldClient ) {
}
function writeLocalSettings( $conf ) {
- $conf->DBmysql4 = @$conf->DBmysql4 ? 'true' : 'false';
$conf->UseImageResize = $conf->UseImageResize ? 'true' : 'false';
$conf->PasswordSender = $conf->EmergencyContact;
$zlib = ($conf->zlib ? "" : "# ");
# This file was automatically generated by the MediaWiki installer.
# If you make manual changes, please keep track in case you need to
# recreate them later.
+#
+# See includes/DefaultSettings.php for all configurable settings
+# and their default values, but don't forget to make changes in _this_
+# file, not there.
\$IP = \"{$slconf['IP']}\";
ini_set( \"include_path\", \".$sep\$IP$sep\$IP/includes$sep\$IP/languages\" );
\$wgDBprefix = \"{$slconf['DBprefix']}\";
\$wgDBtype = \"{$slconf['DBtype']}\";
-# If you're on MySQL 3.x, this next line must be FALSE:
-\$wgDBmysql4 = {$conf->DBmysql4};
-
## Shared memory settings
\$wgMainCacheType = $cacheType;
\$wgMemCachedServers = $mcservers;
*/
function load( $address = '', $user = 0, $killExpired = true )
{
- global $wgDBmysql4, $wgAntiLockFlags;
+ global $wgAntiLockFlags;
$fname = 'Block::load';
wfDebug( "Block::load: '$address', '$user', $killExpired\n" );
$sql = "SELECT * FROM $ipblocks WHERE ipb_user={$user} $options";
} elseif ($user=="") {
$sql = "SELECT * FROM $ipblocks WHERE ipb_address='" . $db->strencode( $address ) . "' $options";
- } elseif ( $options=='' && $wgDBmysql4 ) {
- # If there are no optiones (e.g. FOR UPDATE), use a UNION
+ } elseif ( $options=='' ) {
+ # If there are no options (e.g. FOR UPDATE), use a UNION
# so that the query can make efficient use of indices
$sql = "SELECT * FROM $ipblocks WHERE ipb_address='" . $db->strencode( $address ) .
"' UNION SELECT * FROM $ipblocks WHERE ipb_user={$user}";
* PostgreSQL doesn't have them and returns ""
*/
function useIndexClause( $index ) {
- global $wgDBmysql4;
- return $wgDBmysql4
- ? "FORCE INDEX ($index)"
- : "USE INDEX ($index)";
+ return "FORCE INDEX ($index)";
}
/**
$wgDBminWordLen = 4;
/** Set to true if using InnoDB tables */
$wgDBtransactions = false;
-/** Set to true to use enhanced fulltext search */
-$wgDBmysql4 = false;
+/** Set to true for compatibility with extensions that might be checking.
+ * MySQL 3.23.x is no longer supported. */
+$wgDBmysql4 = true;
/**
* Other wikis on this site, can be administered from a single developer
* @access private
*/
function create() {
- global $wgDBtype, $wgDBmysql4, $wgSearchType;
+ global $wgDBtype, $wgSearchType;
if( $wgSearchType ) {
$class = $wgSearchType;
} elseif( $wgDBtype == 'mysql' ) {
- if( $wgDBmysql4 ) {
- $class = 'SearchMySQL4';
- require_once( 'SearchMySQL4.php' );
- } else {
- $class = 'SearchMysql3';
- require_once( 'SearchMySQL3.php' );
- }
+ $class = 'SearchMySQL4';
+ require_once( 'SearchMySQL4.php' );
} else if ( $wgDBtype == 'PostgreSQL' ) {
$class = 'SearchTsearch2';
require_once( 'SearchTsearch2.php' );
+++ /dev/null
-<?php
-# Copyright (C) 2004 Brion Vibber <brion@pobox.com>
-# http://www.mediawiki.org/
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-# http://www.gnu.org/copyleft/gpl.html
-
-/**
- * Search engine hook for MySQL 3.23.x
- * @package MediaWiki
- * @subpackage Search
- */
-
-/** */
-require_once( 'SearchMySQL.php' );
-
-/**
- * @package MediaWiki
- * @subpackage Search
- */
-class SearchMySQL3 extends SearchMySQL {
- function SearchMySQL3( &$db ) {
- $this->db =& $db;
- }
-
- function parseQuery( $filteredText, $fulltext ) {
- global $wgDBminWordLen, $wgContLang;
-
- $field = $this->getIndexField( $fulltext );
-
- # on non mysql4 database: get list of words we don't want to search for
- require_once( 'FulltextStoplist.php' );
-
- $lc = SearchEngine::legalSearchChars() . '()';
- $q = preg_replace( "/([()])/", " \\1 ", $filteredText );
- $q = preg_replace( "/\\s+/", " ", $q );
- $w = explode( ' ', trim( $q ) );
-
- $last = $cond = '';
- foreach ( $w as $word ) {
- $word = $wgContLang->stripForSearch( $word );
- if ( 'and' == $word || 'or' == $word || 'not' == $word
- || '(' == $word || ')' == $word ) {
- $cond .= ' ' . strtoupper( $word );
- $last = '';
- } else if ( strlen( $word ) < $wgDBminWordLen ) {
- continue;
- } else if ( FulltextStoplist::inList( $word ) ) {
- continue;
- } else {
- if ( '' != $last ) { $cond .= ' AND'; }
- $cond .= " (MATCH ($field) AGAINST ('" .
- $this->db->strencode( $word ). "'))";
- $last = $word;
- $this->searchTerms[] = "\\b" . preg_quote( $word, '/' ) . "\\b";
- }
- }
- if ( 0 == count( $this->searchTerms ) ) {
- # No searchable terms remaining.
- # We have to return a term for the query or we get an SQL error.
- return "0";
- }
-
- return '(' . $cond . ' )';
- }
-
-}
-
-?>
}
$pTable = $dbw->tableName( $table );
- global $wgDBmysql4, $wgDBtype;
- if( $wgDBmysql4 || $wgDBtype != 'mysql' ) {
- $sql = "DELETE $pTable FROM $pTable LEFT JOIN $page ON page_id=$field WHERE page_id IS NULL";
- } else {
- # Hack-around for MySQL 3.x, which lacks support
- # for multi-table deletes.
-
- $sql = "SELECT DISTINCT $field AS id FROM $pTable LEFT JOIN $page ON page_id=$field WHERE page_id IS NULL";
- echo "Looking in $table from non-existent articles...";
- $result = $dbw->query( $sql );
- $ids = array();
- while( $row = $dbw->fetchObject( $result ) ) {
- $ids[] = $row->id;
- }
- $dbw->freeResult( $result );
-
- if( empty( $ids ) ) {
- echo " none.\n";
- continue;
- }
- echo " found.\n";
- $sql = "DELETE FROM $pTable WHERE $field IN (" . implode( ",", $ids ) . ")";
- }
+ $sql = "DELETE $pTable FROM $pTable LEFT JOIN $page ON page_id=$field WHERE page_id IS NULL";
print "Deleting $table from non-existent articles...";
$dbw->query( $sql, $fname );
require_once( 'PHPUnit.php' );
$testOptions = array(
- 'mysql3' => array(
- 'server' => null,
- 'user' => null,
- 'password' => null,
- 'database' => null ),
'mysql4' => array(
'server' => null,
'user' => null,
$tests = array(
'GlobalTest',
'DatabaseTest',
- 'SearchMySQL3Test',
'SearchMySQL4Test',
'ArticleTest',
'SanitizerTest',
+++ /dev/null
-<?php
-
-require_once( 'SearchEngineTest.php' );
-require_once( '../includes/SearchMySQL3.php' );
-
-class SearchMySQL3Test extends SearchEngine_TestCase {
- var $db;
-
- function SearchMySQL3Test( $name ) {
- $this->PHPUnit_TestCase( $name );
- }
-
- function setUp() {
- $GLOBALS['wgContLang'] = new LanguageUtf8;
- $this->db =& buildTestDatabase(
- 'mysql3',
- array( 'page', 'revision', 'text', 'searchindex' ) );
- if( $this->db ) {
- $this->insertSearchData();
- }
- $this->search =& new SearchMySQL3( $this->db );
- }
-
- function tearDown() {
- if( !is_null( $this->db ) ) {
- $this->db->close();
- }
- unset( $this->db );
- unset( $this->search );
- }
-
-}
-
-?>
\ No newline at end of file