Drop MySQL 3.23.x support; 4.0 or greater required.
authorBrion Vibber <brion@users.mediawiki.org>
Fri, 26 Aug 2005 23:02:54 +0000 (23:02 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Fri, 26 Aug 2005 23:02:54 +0000 (23:02 +0000)
RELEASE-NOTES
config/index.php
includes/Block.php
includes/Database.php
includes/DefaultSettings.php
includes/SearchEngine.php
includes/SearchMySQL3.php [deleted file]
maintenance/refreshLinks.inc
tests/RunTests.php
tests/SearchMySQL3Test.php [deleted file]

index 2cf2b37..2541187 100644 (file)
@@ -7,6 +7,10 @@ setting since version 1.2.0. If you have it on, turn it *off* if you can.
 
 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
@@ -58,6 +62,7 @@ fully support the editing toolbar, but was found to be too confusing.
 * (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 ===
index 8952fce..d9da0f7 100644 (file)
@@ -552,10 +552,8 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) {
                }
 
                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 ) {
@@ -1043,7 +1041,6 @@ function escapePhpString( $string ) {
 }
 
 function writeLocalSettings( $conf ) {
-       $conf->DBmysql4 = @$conf->DBmysql4 ? 'true' : 'false';
        $conf->UseImageResize = $conf->UseImageResize ? 'true' : 'false';
        $conf->PasswordSender = $conf->EmergencyContact;
        $zlib = ($conf->zlib ? "" : "# ");
@@ -1118,6 +1115,10 @@ function writeLocalSettings( $conf ) {
 # 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\" );
@@ -1174,9 +1175,6 @@ if ( \$wgCommandLineMode ) {
 \$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;
index 721b1f7..f8f0186 100644 (file)
@@ -67,7 +67,7 @@ class Block
         */
        function load( $address = '', $user = 0, $killExpired = true )
        {
-               global $wgDBmysql4, $wgAntiLockFlags;
+               global $wgAntiLockFlags;
                $fname = 'Block::load';
                wfDebug( "Block::load: '$address', '$user', $killExpired\n" );
 
@@ -92,8 +92,8 @@ class Block
                        $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}";
index 6f21171..c4390cf 100644 (file)
@@ -1178,10 +1178,7 @@ class Database {
         * PostgreSQL doesn't have them and returns ""
         */
        function useIndexClause( $index ) {
-               global $wgDBmysql4;
-               return $wgDBmysql4
-                       ? "FORCE INDEX ($index)"
-                       : "USE INDEX ($index)";
+               return "FORCE INDEX ($index)";
        }
 
        /**
index ab262c0..4348041 100644 (file)
@@ -447,8 +447,9 @@ $wgDBClusterTimeout = 10;
 $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
index abc4d58..ee90ab7 100644 (file)
@@ -178,17 +178,12 @@ class SearchEngine {
         * @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' );
diff --git a/includes/SearchMySQL3.php b/includes/SearchMySQL3.php
deleted file mode 100644 (file)
index 3636045..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-<?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 . ' )';
-       }
-
-}
-
-?>
index 355cf52..73bfbdb 100644 (file)
@@ -124,29 +124,7 @@ function deleteLinksFromNonexistent( $maxLag = 0 ) {
                }
 
                $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 );
index 5291d93..81ed74a 100644 (file)
@@ -10,11 +10,6 @@ define( "MEDIAWIKI", true );
 require_once( 'PHPUnit.php' );
 
 $testOptions = array(
-       'mysql3' => array(
-               'server' => null,
-               'user' => null,
-               'password' => null,
-               'database' => null ),
        'mysql4' => array(
                'server' => null,
                'user' => null,
@@ -34,7 +29,6 @@ if( file_exists( 'LocalTestSettings.php' ) ) {
 $tests = array(
        'GlobalTest',
        'DatabaseTest',
-       'SearchMySQL3Test',
        'SearchMySQL4Test',
        'ArticleTest',
        'SanitizerTest',
diff --git a/tests/SearchMySQL3Test.php b/tests/SearchMySQL3Test.php
deleted file mode 100644 (file)
index 9767e18..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<?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