Change all uses of TYPE= in MySQL to ENGINE=
authorDaniel Friesen <dantman@users.mediawiki.org>
Thu, 10 Jul 2008 22:00:04 +0000 (22:00 +0000)
committerDaniel Friesen <dantman@users.mediawiki.org>
Thu, 10 Jul 2008 22:00:04 +0000 (22:00 +0000)
According to the MySQL manual, TYPE= has been depreciated since MySQL 4.0, starting in 5.1 database warnings are issued when TYPE= is used instead of ENGINE=, and in MySQL 5.2 TYPE= will be removed.

Using ENGINE= inside of sql should serve the best compatibility since we require at least MySQL 4.0

includes/DefaultSettings.php
maintenance/archives/patch-hitcounter.sql
maintenance/archives/patch-profiling.sql
maintenance/archives/patch-searchindex.sql
maintenance/archives/rebuildRecentchanges.inc
maintenance/archives/upgradeWatchlist.php
maintenance/storage/blobs.sql
maintenance/tables.sql
maintenance/updaters.inc

index cc49ba6..43d4328 100644 (file)
@@ -554,7 +554,7 @@ $wgSearchType           = null;
 /** Table name prefix */
 $wgDBprefix         = '';
 /** MySQL table options to use during installation or update */
-$wgDBTableOptions = 'TYPE=InnoDB';
+$wgDBTableOptions = 'ENGINE=InnoDB';
 
 /** To override default SQLite data directory ($docroot/../data) */
 $wgSQLiteDataDir = '';
index 260f717..50e56e0 100644 (file)
@@ -6,4 +6,4 @@
 
 CREATE TABLE /*$wgDBprefix*/hitcounter (
   hc_id INTEGER UNSIGNED NOT NULL
-) TYPE=HEAP MAX_ROWS=25000;
+) ENGINE=HEAP MAX_ROWS=25000;
index 84464e8..e748ca3 100644 (file)
@@ -8,4 +8,4 @@ CREATE TABLE /*$wgDBprefix*/profiling (
   pf_name varchar(255) NOT NULL default '',
   pf_server varchar(30) NOT NULL default '',
   UNIQUE KEY pf_name_server (pf_name, pf_server)
-) TYPE=HEAP;
+) ENGINE=HEAP;
index 452c454..9b635a8 100644 (file)
@@ -19,7 +19,7 @@ CREATE TABLE /*$wgDBprefix*/searchindex (
   
   UNIQUE KEY (si_page)
 
-) TYPE=MyISAM;
+) ENGINE=MyISAM;
 
 -- Copying data into new table...
 INSERT INTO /*$wgDBprefix*/searchindex
index 0de108a..65ba560 100644 (file)
@@ -32,7 +32,7 @@ function rebuildRecentChangesTable()
   INDEX rc_timestamp (rc_timestamp),
   INDEX rc_namespace (rc_namespace),
   INDEX rc_title (rc_title)
-) TYPE=MyISAM PACK_KEYS=1;";
+) ENGINE=MyISAM PACK_KEYS=1;";
        wfQuery( $sql );
 
        print( "Loading from CUR table...\n" );
index 745f3ae..9788aa5 100644 (file)
@@ -30,7 +30,7 @@ $sql = "CREATE TABLE watchlist (
   wl_user int(5) unsigned NOT NULL,
   wl_page int(8) unsigned NOT NULL,
   UNIQUE KEY (wl_user, wl_page)
-) TYPE=MyISAM PACK_KEYS=1";
+) ENGINE=MyISAM PACK_KEYS=1";
 wfQuery( $sql, DB_MASTER );
 
 $lc = new LinkCache;
index b50865c..0b1b82d 100644 (file)
@@ -4,5 +4,5 @@ CREATE TABLE /*$wgDBprefix*/blobs (
        blob_id integer UNSIGNED NOT NULL AUTO_INCREMENT,
        blob_text longblob,
        PRIMARY KEY  (blob_id)
-) TYPE=MyISAM MAX_ROWS=1000000 AVG_ROW_LENGTH=1000000;
+) ENGINE=MyISAM MAX_ROWS=1000000 AVG_ROW_LENGTH=1000000;
 
index 3821e5b..08889b2 100644 (file)
@@ -616,7 +616,7 @@ CREATE TABLE /*$wgDBprefix*/site_stats (
 --
 CREATE TABLE /*$wgDBprefix*/hitcounter (
   hc_id int unsigned NOT NULL
-) TYPE=HEAP MAX_ROWS=25000;
+) ENGINE=HEAP MAX_ROWS=25000;
 
 
 --
@@ -994,7 +994,7 @@ CREATE TABLE /*$wgDBprefix*/searchindex (
   FULLTEXT si_title (si_title),
   FULLTEXT si_text (si_text)
 
-) TYPE=MyISAM;
+) ENGINE=MyISAM;
 
 --
 -- Recognized interwiki link prefixes
index 1e1ec54..5e271bf 100644 (file)
@@ -555,7 +555,7 @@ function do_schema_restructuring() {
                        UNIQUE INDEX name_title (page_namespace,page_title),
                        INDEX (page_random),
                        INDEX (page_len)
-                       ) TYPE=InnoDB", $fname );
+                       ) ENGINE=InnoDB", $fname );
                $wgDatabase->query("CREATE TABLE $revision (
                        rev_id int(8) unsigned NOT NULL auto_increment,
                        rev_page int(8) unsigned NOT NULL,
@@ -573,7 +573,7 @@ function do_schema_restructuring() {
                        INDEX page_timestamp (rev_page,rev_timestamp),
                        INDEX user_timestamp (rev_user,rev_timestamp),
                        INDEX usertext_timestamp (rev_user_text,rev_timestamp)
-                       ) TYPE=InnoDB", $fname );
+                       ) ENGINE=InnoDB", $fname );
 
                echo wfTimestamp( TS_DB );
                echo "......Locking tables.\n";