From 19b85e4191285422b7547bdaf8ca5d79c4cc4621 Mon Sep 17 00:00:00 2001 From: Daniel Friesen Date: Thu, 10 Jul 2008 22:00:04 +0000 Subject: [PATCH] Change all uses of TYPE= in MySQL to ENGINE= 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 | 2 +- maintenance/archives/patch-hitcounter.sql | 2 +- maintenance/archives/patch-profiling.sql | 2 +- maintenance/archives/patch-searchindex.sql | 2 +- maintenance/archives/rebuildRecentchanges.inc | 2 +- maintenance/archives/upgradeWatchlist.php | 2 +- maintenance/storage/blobs.sql | 2 +- maintenance/tables.sql | 4 ++-- maintenance/updaters.inc | 4 ++-- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index cc49ba6f34..43d4328e44 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -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 = ''; diff --git a/maintenance/archives/patch-hitcounter.sql b/maintenance/archives/patch-hitcounter.sql index 260f717f03..50e56e0ce2 100644 --- a/maintenance/archives/patch-hitcounter.sql +++ b/maintenance/archives/patch-hitcounter.sql @@ -6,4 +6,4 @@ CREATE TABLE /*$wgDBprefix*/hitcounter ( hc_id INTEGER UNSIGNED NOT NULL -) TYPE=HEAP MAX_ROWS=25000; +) ENGINE=HEAP MAX_ROWS=25000; diff --git a/maintenance/archives/patch-profiling.sql b/maintenance/archives/patch-profiling.sql index 84464e8eec..e748ca310d 100644 --- a/maintenance/archives/patch-profiling.sql +++ b/maintenance/archives/patch-profiling.sql @@ -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; diff --git a/maintenance/archives/patch-searchindex.sql b/maintenance/archives/patch-searchindex.sql index 452c454851..9b635a8fbd 100644 --- a/maintenance/archives/patch-searchindex.sql +++ b/maintenance/archives/patch-searchindex.sql @@ -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 diff --git a/maintenance/archives/rebuildRecentchanges.inc b/maintenance/archives/rebuildRecentchanges.inc index 0de108aa08..65ba560c38 100644 --- a/maintenance/archives/rebuildRecentchanges.inc +++ b/maintenance/archives/rebuildRecentchanges.inc @@ -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" ); diff --git a/maintenance/archives/upgradeWatchlist.php b/maintenance/archives/upgradeWatchlist.php index 745f3ae3e7..9788aa56de 100644 --- a/maintenance/archives/upgradeWatchlist.php +++ b/maintenance/archives/upgradeWatchlist.php @@ -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; diff --git a/maintenance/storage/blobs.sql b/maintenance/storage/blobs.sql index b50865c657..0b1b82d81f 100644 --- a/maintenance/storage/blobs.sql +++ b/maintenance/storage/blobs.sql @@ -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; diff --git a/maintenance/tables.sql b/maintenance/tables.sql index 3821e5b3d7..08889b2031 100644 --- a/maintenance/tables.sql +++ b/maintenance/tables.sql @@ -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 diff --git a/maintenance/updaters.inc b/maintenance/updaters.inc index 1e1ec54a7c..5e271bf501 100644 --- a/maintenance/updaters.inc +++ b/maintenance/updaters.inc @@ -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"; -- 2.20.1