r37540 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r37539‎ | r37540 | r37541 >
Date:22:00, 10 July 2008
Author:dantman
Status:old
Tags:
Comment:
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
Modified paths:
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/maintenance/archives/patch-hitcounter.sql (modified) (history)
  • /trunk/phase3/maintenance/archives/patch-profiling.sql (modified) (history)
  • /trunk/phase3/maintenance/archives/patch-searchindex.sql (modified) (history)
  • /trunk/phase3/maintenance/archives/rebuildRecentchanges.inc (modified) (history)
  • /trunk/phase3/maintenance/archives/upgradeWatchlist.php (modified) (history)
  • /trunk/phase3/maintenance/storage/blobs.sql (modified) (history)
  • /trunk/phase3/maintenance/tables.sql (modified) (history)
  • /trunk/phase3/maintenance/updaters.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/archives/rebuildRecentchanges.inc
@@ -32,7 +32,7 @@
3333 INDEX rc_timestamp (rc_timestamp),
3434 INDEX rc_namespace (rc_namespace),
3535 INDEX rc_title (rc_title)
36 -) TYPE=MyISAM PACK_KEYS=1;";
 36+) ENGINE=MyISAM PACK_KEYS=1;";
3737 wfQuery( $sql );
3838
3939 print( "Loading from CUR table...\n" );
Index: trunk/phase3/maintenance/archives/patch-hitcounter.sql
@@ -6,4 +6,4 @@
77
88 CREATE TABLE /*$wgDBprefix*/hitcounter (
99 hc_id INTEGER UNSIGNED NOT NULL
10 -) TYPE=HEAP MAX_ROWS=25000;
 10+) ENGINE=HEAP MAX_ROWS=25000;
Index: trunk/phase3/maintenance/archives/patch-profiling.sql
@@ -8,4 +8,4 @@
99 pf_name varchar(255) NOT NULL default '',
1010 pf_server varchar(30) NOT NULL default '',
1111 UNIQUE KEY pf_name_server (pf_name, pf_server)
12 -) TYPE=HEAP;
 12+) ENGINE=HEAP;
Index: trunk/phase3/maintenance/archives/patch-searchindex.sql
@@ -19,7 +19,7 @@
2020
2121 UNIQUE KEY (si_page)
2222
23 -) TYPE=MyISAM;
 23+) ENGINE=MyISAM;
2424
2525 -- Copying data into new table...
2626 INSERT INTO /*$wgDBprefix*/searchindex
Index: trunk/phase3/maintenance/archives/upgradeWatchlist.php
@@ -30,7 +30,7 @@
3131 wl_user int(5) unsigned NOT NULL,
3232 wl_page int(8) unsigned NOT NULL,
3333 UNIQUE KEY (wl_user, wl_page)
34 -) TYPE=MyISAM PACK_KEYS=1";
 34+) ENGINE=MyISAM PACK_KEYS=1";
3535 wfQuery( $sql, DB_MASTER );
3636
3737 $lc = new LinkCache;
Index: trunk/phase3/maintenance/storage/blobs.sql
@@ -4,5 +4,5 @@
55 blob_id integer UNSIGNED NOT NULL AUTO_INCREMENT,
66 blob_text longblob,
77 PRIMARY KEY (blob_id)
8 -) TYPE=MyISAM MAX_ROWS=1000000 AVG_ROW_LENGTH=1000000;
 8+) ENGINE=MyISAM MAX_ROWS=1000000 AVG_ROW_LENGTH=1000000;
99
Index: trunk/phase3/maintenance/updaters.inc
@@ -555,7 +555,7 @@
556556 UNIQUE INDEX name_title (page_namespace,page_title),
557557 INDEX (page_random),
558558 INDEX (page_len)
559 - ) TYPE=InnoDB", $fname );
 559+ ) ENGINE=InnoDB", $fname );
560560 $wgDatabase->query("CREATE TABLE $revision (
561561 rev_id int(8) unsigned NOT NULL auto_increment,
562562 rev_page int(8) unsigned NOT NULL,
@@ -573,7 +573,7 @@
574574 INDEX page_timestamp (rev_page,rev_timestamp),
575575 INDEX user_timestamp (rev_user,rev_timestamp),
576576 INDEX usertext_timestamp (rev_user_text,rev_timestamp)
577 - ) TYPE=InnoDB", $fname );
 577+ ) ENGINE=InnoDB", $fname );
578578
579579 echo wfTimestamp( TS_DB );
580580 echo "......Locking tables.\n";
Index: trunk/phase3/maintenance/tables.sql
@@ -616,7 +616,7 @@
617617 --
618618 CREATE TABLE /*$wgDBprefix*/hitcounter (
619619 hc_id int unsigned NOT NULL
620 -) TYPE=HEAP MAX_ROWS=25000;
 620+) ENGINE=HEAP MAX_ROWS=25000;
621621
622622
623623 --
@@ -994,7 +994,7 @@
995995 FULLTEXT si_title (si_title),
996996 FULLTEXT si_text (si_text)
997997
998 -) TYPE=MyISAM;
 998+) ENGINE=MyISAM;
999999
10001000 --
10011001 -- Recognized interwiki link prefixes
Index: trunk/phase3/includes/DefaultSettings.php
@@ -554,7 +554,7 @@
555555 /** Table name prefix */
556556 $wgDBprefix = '';
557557 /** MySQL table options to use during installation or update */
558 -$wgDBTableOptions = 'TYPE=InnoDB';
 558+$wgDBTableOptions = 'ENGINE=InnoDB';
559559
560560 /** To override default SQLite data directory ($docroot/../data) */
561561 $wgSQLiteDataDir = '';

Status & tagging log