r17492 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r17491‎ | r17492 | r17493 >
Date:14:03, 8 November 2006
Author:brion
Status:old
Tags:
Comment:
* (bug 6737) Fixes for MySQL 5 schema in strict mode
Fixed a field format change for ipb_address which got skipped on the MySQL 5 schema,
and switched TYPE= to ENGINE= to suppress annoying warnings
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/maintenance/mysql5/tables.sql (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/mysql5/tables.sql
@@ -77,7 +77,7 @@
7878 -- Password hashes, normally hashed like so:
7979 -- MD5(CONCAT(user_id,'-',MD5(plaintext_password))), see
8080 -- wfEncryptPassword() in GlobalFunctions.php
81 - user_password tinyblob NOT NULL default '',
 81+ user_password tinyblob NOT NULL,
8282
8383 -- When using 'mail me a new password', a random
8484 -- password is generated and the hash stored here.
@@ -85,7 +85,7 @@
8686 -- someone actually logs in with the new password,
8787 -- at which point the hash is moved to user_password
8888 -- and the old password is invalidated.
89 - user_newpassword tinyblob NOT NULL default '',
 89+ user_newpassword tinyblob NOT NULL,
9090
9191 -- Timestamp of the last time when a new password was
9292 -- sent, for throttling purposes
@@ -93,11 +93,11 @@
9494
9595 -- Note: email should be restricted, not public info.
9696 -- Same with passwords.
97 - user_email tinytext NOT NULL default '',
 97+ user_email tinytext NOT NULL,
9898
9999 -- Newline-separated list of name=value defining the user
100100 -- preferences
101 - user_options blob NOT NULL default '',
 101+ user_options blob NOT NULL,
102102
103103 -- This is a timestamp which is updated when a user
104104 -- logs in, logs out, changes preferences, or performs
@@ -131,7 +131,7 @@
132132 UNIQUE INDEX user_name (user_name),
133133 INDEX (user_email_token)
134134
135 -) TYPE=InnoDB, DEFAULT CHARSET=utf8;
 135+) ENGINE=InnoDB, DEFAULT CHARSET=utf8;
136136
137137 --
138138 -- User permissions have been broken out to a separate table;
@@ -157,7 +157,7 @@
158158
159159 PRIMARY KEY (ug_user,ug_group),
160160 KEY (ug_group)
161 -) TYPE=InnoDB, DEFAULT CHARSET=utf8;
 161+) ENGINE=InnoDB, DEFAULT CHARSET=utf8;
162162
163163 -- Stores notifications of user talk page changes, for the display
164164 -- of the "you have new messages" box
@@ -169,7 +169,7 @@
170170 user_ip varchar(40) NOT NULL default '',
171171 INDEX user_id (user_id),
172172 INDEX user_ip (user_ip)
173 -) TYPE=InnoDB, DEFAULT CHARSET=utf8;
 173+) ENGINE=InnoDB, DEFAULT CHARSET=utf8;
174174
175175
176176 --
@@ -192,7 +192,7 @@
193193
194194 -- Comma-separated set of permission keys indicating who
195195 -- can move or edit the page.
196 - page_restrictions tinyblob NOT NULL default '',
 196+ page_restrictions tinyblob NOT NULL,
197197
198198 -- Number of times this page has been viewed.
199199 page_counter bigint(20) unsigned NOT NULL default '0',
@@ -229,7 +229,7 @@
230230 INDEX (page_random),
231231 INDEX (page_len)
232232
233 -) TYPE=InnoDB, DEFAULT CHARSET=utf8;
 233+) ENGINE=InnoDB, DEFAULT CHARSET=utf8;
234234
235235 --
236236 -- Every edit of a page creates also a revision row.
@@ -251,7 +251,7 @@
252252 -- Text comment summarizing the change.
253253 -- This text is shown in the history and other changes lists,
254254 -- rendered in a subset of wiki markup by Linker::formatComment()
255 - rev_comment tinyblob NOT NULL default '',
 255+ rev_comment tinyblob NOT NULL,
256256
257257 -- Key to user.user_id of the user who made this edit.
258258 -- Stores 0 for anonymous edits and for some mass imports.
@@ -277,7 +277,7 @@
278278 INDEX user_timestamp (rev_user,rev_timestamp),
279279 INDEX usertext_timestamp (rev_user_text,rev_timestamp)
280280
281 -) TYPE=InnoDB, DEFAULT CHARSET=utf8;
 281+) ENGINE=InnoDB, DEFAULT CHARSET=utf8;
282282
283283
284284 --
@@ -298,7 +298,7 @@
299299
300300 -- Depending on the contents of the old_flags field, the text
301301 -- may be convenient plain text, or it may be funkily encoded.
302 - old_text mediumblob NOT NULL default '',
 302+ old_text mediumblob NOT NULL,
303303
304304 -- Comma-separated list of flags:
305305 -- gzip: text is compressed with PHP's gzdeflate() function.
@@ -309,11 +309,11 @@
310310 -- The object either contains multiple versions compressed
311311 -- together to achieve a better compression ratio, or it refers
312312 -- to another row where the text can be found.
313 - old_flags tinyblob NOT NULL default '',
 313+ old_flags tinyblob NOT NULL,
314314
315315 PRIMARY KEY old_id (old_id)
316316
317 -) TYPE=InnoDB, DEFAULT CHARSET=utf8;
 317+) ENGINE=InnoDB, DEFAULT CHARSET=utf8;
318318
319319 --
320320 -- Holding area for deleted articles, which may be viewed
@@ -331,17 +331,17 @@
332332 -- so old archived pages will remain accessible after
333333 -- upgrading from 1.4 to 1.5.
334334 -- Text may be gzipped or otherwise funky.
335 - ar_text mediumblob NOT NULL default '',
 335+ ar_text mediumblob NOT NULL,
336336
337337 -- Basic revision stuff...
338 - ar_comment tinyblob NOT NULL default '',
 338+ ar_comment tinyblob NOT NULL,
339339 ar_user int(5) unsigned NOT NULL default '0',
340340 ar_user_text varchar(255) binary NOT NULL,
341341 ar_timestamp char(14) binary NOT NULL default '',
342342 ar_minor_edit tinyint(1) NOT NULL default '0',
343343
344344 -- See ar_text note.
345 - ar_flags tinyblob NOT NULL default '',
 345+ ar_flags tinyblob NOT NULL,
346346
347347 -- When revisions are deleted, their unique rev_id is stored
348348 -- here so it can be retained after undeletion. This is necessary
@@ -365,7 +365,7 @@
366366
367367 KEY name_title_timestamp (ar_namespace,ar_title,ar_timestamp)
368368
369 -) TYPE=InnoDB, DEFAULT CHARSET=utf8;
 369+) ENGINE=InnoDB, DEFAULT CHARSET=utf8;
370370
371371
372372 --
@@ -385,7 +385,7 @@
386386 UNIQUE KEY pl_from(pl_from,pl_namespace,pl_title),
387387 KEY (pl_namespace,pl_title)
388388
389 -) TYPE=InnoDB, DEFAULT CHARSET=utf8;
 389+) ENGINE=InnoDB, DEFAULT CHARSET=utf8;
390390
391391
392392 --
@@ -405,7 +405,7 @@
406406 UNIQUE KEY tl_from(tl_from,tl_namespace,tl_title),
407407 KEY (tl_namespace,tl_title)
408408
409 -) TYPE=InnoDB, DEFAULT CHARSET=utf8;
 409+) ENGINE=InnoDB, DEFAULT CHARSET=utf8;
410410
411411
412412 --
@@ -425,7 +425,7 @@
426426 UNIQUE KEY il_from(il_from,il_to),
427427 KEY (il_to)
428428
429 -) TYPE=InnoDB, DEFAULT CHARSET=utf8;
 429+) ENGINE=InnoDB, DEFAULT CHARSET=utf8;
430430
431431 --
432432 -- Track category inclusions *used inline*
@@ -464,7 +464,7 @@
465465 -- Not really used?
466466 KEY cl_timestamp(cl_to,cl_timestamp)
467467
468 -) TYPE=InnoDB, DEFAULT CHARSET=utf8;
 468+) ENGINE=InnoDB, DEFAULT CHARSET=utf8;
469469
470470 --
471471 -- Track links to external URLs
@@ -474,7 +474,7 @@
475475 el_from int(8) unsigned NOT NULL default '0',
476476
477477 -- The URL
478 - el_to blob NOT NULL default '',
 478+ el_to blob NOT NULL,
479479
480480 -- In the case of HTTP URLs, this is the URL with any username or password
481481 -- removed, and with the labels in the hostname reversed and converted to
@@ -487,12 +487,12 @@
488488 -- which allows for fast searching for all pages under example.com with the
489489 -- clause:
490490 -- WHERE el_index LIKE 'http://com.example.%'
491 - el_index blob NOT NULL default '',
 491+ el_index blob NOT NULL,
492492
493493 KEY (el_from, el_to(40)),
494494 KEY (el_to(60), el_from),
495495 KEY (el_index(60))
496 -) TYPE=InnoDB, DEFAULT CHARSET=utf8;
 496+) ENGINE=InnoDB, DEFAULT CHARSET=utf8;
497497
498498 --
499499 -- Track interlanguage links
@@ -546,7 +546,7 @@
547547
548548 UNIQUE KEY ss_row_id (ss_row_id)
549549
550 -) TYPE=InnoDB;
 550+) ENGINE=InnoDB;
551551
552552 --
553553 -- Stores an ID for every time any article is visited;
@@ -557,7 +557,7 @@
558558 --
559559 CREATE TABLE /*$wgDBprefix*/hitcounter (
560560 hc_id INTEGER UNSIGNED NOT NULL
561 -) TYPE=HEAP MAX_ROWS=25000;
 561+) ENGINE=HEAP MAX_ROWS=25000;
562562
563563
564564 --
@@ -569,7 +569,7 @@
570570 ipb_id int(8) NOT NULL auto_increment,
571571
572572 -- Blocked IP address in dotted-quad form or user name.
573 - ipb_address varchar(40) binary NOT NULL default '',
 573+ ipb_address tinyblob NOT NULL,
574574
575575 -- Blocked user ID or 0 for IP blocks.
576576 ipb_user int(8) unsigned NOT NULL default '0',
@@ -578,7 +578,7 @@
579579 ipb_by int(8) unsigned NOT NULL default '0',
580580
581581 -- Text comment made by blocker.
582 - ipb_reason tinyblob NOT NULL default '',
 582+ ipb_reason tinyblob NOT NULL,
583583
584584 -- Creation (or refresh) date in standard YMDHMS form.
585585 -- IP blocks expire automatically.
@@ -617,7 +617,7 @@
618618 INDEX ipb_timestamp (ipb_timestamp),
619619 INDEX ipb_expiry (ipb_expiry)
620620
621 -) TYPE=InnoDB, DEFAULT CHARSET=utf8;
 621+) ENGINE=InnoDB, DEFAULT CHARSET=utf8;
622622
623623
624624 --
@@ -657,7 +657,7 @@
658658
659659 -- Description field as entered by the uploader.
660660 -- This is displayed in image upload history and logs.
661 - img_description tinyblob NOT NULL default '',
 661+ img_description tinyblob NOT NULL,
662662
663663 -- user_id and user_name of uploader.
664664 img_user int(5) unsigned NOT NULL default '0',
@@ -674,7 +674,7 @@
675675 -- Used by Special:Newimages and Special:Imagelist
676676 INDEX img_timestamp (img_timestamp)
677677
678 -) TYPE=InnoDB, DEFAULT CHARSET=utf8;
 678+) ENGINE=InnoDB, DEFAULT CHARSET=utf8;
679679
680680 --
681681 -- Previous revisions of uploaded files.
@@ -694,14 +694,14 @@
695695 oi_width int(5) NOT NULL default 0,
696696 oi_height int(5) NOT NULL default 0,
697697 oi_bits int(3) NOT NULL default 0,
698 - oi_description tinyblob NOT NULL default '',
 698+ oi_description tinyblob NOT NULL,
699699 oi_user int(5) unsigned NOT NULL default '0',
700700 oi_user_text varchar(255) binary NOT NULL default '',
701701 oi_timestamp char(14) binary NOT NULL default '',
702702
703703 INDEX oi_name (oi_name(10))
704704
705 -) TYPE=InnoDB, DEFAULT CHARSET=utf8;
 705+) ENGINE=InnoDB, DEFAULT CHARSET=utf8;
706706
707707
708708 --
@@ -743,7 +743,7 @@
744744 fa_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL,
745745 fa_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") default "unknown",
746746 fa_minor_mime varchar(32) default "unknown",
747 - fa_description tinyblob default '',
 747+ fa_description tinyblob,
748748 fa_user int(5) unsigned default '0',
749749 fa_user_text varchar(255) binary default '',
750750 fa_timestamp char(14) binary default '',
@@ -754,7 +754,7 @@
755755 INDEX (fa_deleted_timestamp), -- sort by deletion time
756756 INDEX (fa_deleted_user) -- sort by deleter
757757
758 -) TYPE=InnoDB, DEFAULT CHARSET=utf8;
 758+) ENGINE=InnoDB, DEFAULT CHARSET=utf8;
759759
760760 --
761761 -- Primarily a summary table for Special:Recentchanges,
@@ -819,7 +819,7 @@
820820 INDEX rc_ip (rc_ip),
821821 INDEX rc_ns_usertext ( rc_namespace, rc_user_text )
822822
823 -) TYPE=InnoDB, DEFAULT CHARSET=utf8;
 823+) ENGINE=InnoDB, DEFAULT CHARSET=utf8;
824824
825825 CREATE TABLE /*$wgDBprefix*/watchlist (
826826 -- Key to user.user_id
@@ -838,7 +838,7 @@
839839 UNIQUE KEY (wl_user, wl_namespace, wl_title),
840840 KEY namespace_title (wl_namespace,wl_title)
841841
842 -) TYPE=InnoDB, DEFAULT CHARSET=utf8;
 842+) ENGINE=InnoDB, DEFAULT CHARSET=utf8;
843843
844844
845845 --
@@ -864,7 +864,7 @@
865865
866866 UNIQUE KEY math_inputhash (math_inputhash)
867867
868 -) TYPE=InnoDB, DEFAULT CHARSET=utf8;
 868+) ENGINE=InnoDB, DEFAULT CHARSET=utf8;
869869
870870 --
871871 -- When using the default MySQL search backend, page titles
@@ -882,13 +882,13 @@
883883 si_title varchar(255) NOT NULL default '',
884884
885885 -- Munged version of body text
886 - si_text mediumtext NOT NULL default '',
 886+ si_text mediumtext NOT NULL,
887887
888888 UNIQUE KEY (si_page),
889889 FULLTEXT si_title (si_title),
890890 FULLTEXT si_text (si_text)
891891
892 -) TYPE=MyISAM, DEFAULT CHARSET=utf8;
 892+) ENGINE=MyISAM, DEFAULT CHARSET=utf8;
893893
894894 --
895895 -- Recognized interwiki link prefixes
@@ -911,7 +911,7 @@
912912
913913 UNIQUE KEY iw_prefix (iw_prefix)
914914
915 -) TYPE=InnoDB, DEFAULT CHARSET=utf8;
 915+) ENGINE=InnoDB, DEFAULT CHARSET=utf8;
916916
917917 --
918918 -- Used for caching expensive grouped queries
@@ -929,7 +929,7 @@
930930
931931 KEY (qc_type,qc_value)
932932
933 -) TYPE=InnoDB, DEFAULT CHARSET=utf8;
 933+) ENGINE=InnoDB, DEFAULT CHARSET=utf8;
934934
935935 --
936936 -- For a few generic cache operations if not using Memcached
@@ -941,7 +941,7 @@
942942 unique key (keyname),
943943 key (exptime)
944944
945 -) TYPE=InnoDB, DEFAULT CHARSET=utf8;
 945+) ENGINE=InnoDB, DEFAULT CHARSET=utf8;
946946
947947 --
948948 -- Cache of interwiki transclusion
@@ -951,7 +951,7 @@
952952 tc_contents TEXT,
953953 tc_time INT NOT NULL,
954954 UNIQUE INDEX tc_url_idx(tc_url)
955 -) TYPE=InnoDB, DEFAULT CHARSET=utf8;
 955+) ENGINE=InnoDB, DEFAULT CHARSET=utf8;
956956
957957 CREATE TABLE /*$wgDBprefix*/logging (
958958 -- Symbolic keys for the general log type and the action type
@@ -975,13 +975,13 @@
976976 log_comment varchar(255) NOT NULL default '',
977977
978978 -- LF separated list of miscellaneous parameters
979 - log_params blob NOT NULL default '',
 979+ log_params blob NOT NULL,
980980
981981 KEY type_time (log_type, log_timestamp),
982982 KEY user_time (log_user, log_timestamp),
983983 KEY page_time (log_namespace, log_title, log_timestamp)
984984
985 -) TYPE=InnoDB, DEFAULT CHARSET=utf8;
 985+) ENGINE=InnoDB, DEFAULT CHARSET=utf8;
986986
987987 CREATE TABLE /*$wgDBprefix*/trackbacks (
988988 tb_id integer AUTO_INCREMENT PRIMARY KEY,
@@ -992,7 +992,7 @@
993993 tb_name varchar(255),
994994
995995 INDEX (tb_page)
996 -) TYPE=InnoDB, DEFAULT CHARSET=utf8;
 996+) ENGINE=InnoDB, DEFAULT CHARSET=utf8;
997997
998998 -- Jobs performed by parallel apache threads or a command-line daemon
999999 CREATE TABLE /*$wgDBprefix*/job (
@@ -1008,11 +1008,11 @@
10091009
10101010 -- Any other parameters to the command
10111011 -- Presently unused, format undefined
1012 - job_params blob NOT NULL default '',
 1012+ job_params blob NOT NULL,
10131013
10141014 PRIMARY KEY job_id (job_id),
10151015 KEY (job_cmd, job_namespace, job_title)
1016 -) TYPE=InnoDB, DEFAULT CHARSET=utf8;
 1016+) ENGINE=InnoDB, DEFAULT CHARSET=utf8;
10171017
10181018 -- Details of updates to cached special pages
10191019 CREATE TABLE /*$wgDBprefix*/querycache_info (
@@ -1026,7 +1026,7 @@
10271027
10281028 UNIQUE KEY ( qci_type )
10291029
1030 -) TYPE=InnoDB;
 1030+) ENGINE=InnoDB;
10311031
10321032 -- For each redirect, this table contains exactly one row defining its target
10331033 CREATE TABLE /*$wgDBprefix*/redirect (
@@ -1042,7 +1042,7 @@
10431043
10441044 PRIMARY KEY rd_from (rd_from),
10451045 KEY rd_ns_title (rd_namespace,rd_title,rd_from)
1046 -) TYPE=InnoDB, DEFAULT CHARSET=utf8;
 1046+) ENGINE=InnoDB, DEFAULT CHARSET=utf8;
10471047
10481048 -- Used for caching expensive grouped queries that need two links (for example double-redirects)
10491049
@@ -1065,4 +1065,4 @@
10661066 KEY qcc_title (qcc_type,qcc_namespace,qcc_title),
10671067 KEY qcc_titletwo (qcc_type,qcc_namespacetwo,qcc_titletwo)
10681068
1069 -) TYPE=InnoDB, DEFAULT CHARSET=utf8;
 1069+) ENGINE=InnoDB, DEFAULT CHARSET=utf8;
Index: trunk/phase3/RELEASE-NOTES
@@ -159,6 +159,7 @@
160160 make CheckUser.php and the new retroactive autoblock functionality faster.
161161 * Fix regression in Special:Undelete for revisions deleted under MediaWiki 1.4
162162 with compression or legacy encoding
 163+* (bug 6737) Fixes for MySQL 5 schema in strict mode
163164
164165
165166 == Languages updated ==