r23239 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23238‎ | r23239 | r23240 >
Date:18:31, 22 June 2007
Author:tstarling
Status:old
Tags:
Comment:
* Fixed complete breakage for MySQL instances with a maximum key length of 1000 bytes. Tested with MyISAM 5 with UTF-8 default character set.
* Replaced char/varchar with binary/varbinary in cases where the data is pure ASCII. This is more efficient for various reasons in MySQL 4.1+, and equivalent to char() binary in 4.0. Sometimes varbinary is needed where char was used before, to avoid zero-padding on the right. As a side-effect, this means the MySQL 5 binary schema is no longer broken.
* Removed width specifiers from integer columns. These do virtually nothing, the MySQL command line client ignores them and they have no impact on storage. The only thing they do is cause arguments between developers over whether the most appropriate width of a 32-bit integer is 8, 9 or 10 columns.
* No updater provided for the moment, but everyone should migrate to the MySQL 5 binary schema eventually since it should now work correctly and efficiently.
Modified paths:
  • /trunk/phase3/maintenance/tables.sql (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/tables.sql
@@ -15,7 +15,7 @@
1616 --
1717 --
1818 -- The MySQL table backend for MediaWiki currently uses
 19+-- 14-character BINARY or VARBINARY fields to store timestamps.
1920 -- The format is YYYYMMDDHHMMSS, which is derived from the
2021 -- text format of MySQL's TIMESTAMP fields.
2122 --
@@ -49,7 +49,7 @@
5050 -- tables.
5151 --
5252 CREATE TABLE /*$wgDBprefix*/user (
53 - user_id int(5) unsigned NOT NULL auto_increment,
 53+ user_id int unsigned NOT NULL auto_increment,
5454
5555 -- Usernames must be unique, must not be in the form of
5656 -- an IP address. _Shouldn't_ allow slashes or case
@@ -76,7 +76,7 @@
7777
7878 -- Timestamp of the last time when a new password was
7979 -- sent, for throttling purposes
80 - user_newpass_time char(14) binary,
 80+ user_newpass_time binary(14),
8181
8282 -- Note: email should be restricted, not public info.
8383 -- Same with passwords.
@@ -90,29 +90,29 @@
9191 -- logs in, logs out, changes preferences, or performs
9292 -- some other action requiring HTML cache invalidation
9393 -- to ensure that the UI is updated.
94 - user_touched char(14) binary NOT NULL default '',
 94+ user_touched binary(14) NOT NULL default '',
9595
9696 -- A pseudorandomly generated value that is stored in
9797 -- a cookie when the "remember password" feature is
9898 -- used (previously, a hash of the password was used, but
9999 -- this was vulnerable to cookie-stealing attacks)
100 - user_token char(32) binary NOT NULL default '',
 100+ user_token binary(32) NOT NULL default '',
101101
102102 -- Initially NULL; when a user's e-mail address has been
103103 -- validated by returning with a mailed token, this is
104104 -- set to the current timestamp.
105 - user_email_authenticated char(14) binary,
 105+ user_email_authenticated binary(14),
106106
107107 -- Randomly generated token created when the e-mail address
108108 -- is set and a confirmation test mail sent.
109 - user_email_token char(32) binary,
 109+ user_email_token binary(32),
110110
111111 -- Expiration date for the user_email_token
112 - user_email_token_expires char(14) binary,
 112+ user_email_token_expires binary(14),
113113
114114 -- Timestamp of account registration.
115115 -- Accounts predating this schema addition may contain NULL.
116 - user_registration char(14) binary,
 116+ user_registration binary(14),
117117
118118 -- Count of edits and edit-like actions.
119119 --
@@ -142,7 +142,7 @@
143143 --
144144 CREATE TABLE /*$wgDBprefix*/user_groups (
145145 -- Key to user_id
146 - ug_user int(5) unsigned NOT NULL default '0',
 146+ ug_user int unsigned NOT NULL default '0',
147147
148148 -- Group names are short symbolic string keys.
149149 -- The set of group names is open-ended, though in practice
@@ -152,7 +152,7 @@
153153 -- with particular permissions. A user will have the combined
154154 -- permissions of any group they're explicitly in, plus
155155 -- the implicit '*' and 'user' groups.
156 - ug_group char(16) NOT NULL default '',
 156+ ug_group varbinary(16) NOT NULL default '',
157157
158158 PRIMARY KEY (ug_user,ug_group),
159159 KEY (ug_group)
@@ -162,10 +162,10 @@
163163 -- of the "you have new messages" box
164164 CREATE TABLE /*$wgDBprefix*/user_newtalk (
165165 -- Key to user.user_id
166 - user_id int(5) NOT NULL default '0',
 166+ user_id int NOT NULL default '0',
167167 -- If the user is an anonymous user their IP address is stored here
168168 -- since the user_id of 0 is ambiguous
169 - user_ip varchar(40) NOT NULL default '',
 169+ user_ip varbinary(40) NOT NULL default '',
170170 INDEX user_id (user_id),
171171 INDEX user_ip (user_ip)
172172
@@ -179,7 +179,7 @@
180180 CREATE TABLE /*$wgDBprefix*/page (
181181 -- Unique identifier number. The page_id will be preserved across
182182 -- edits and rename operations, but not deletions and recreations.
183 - page_id int(8) unsigned NOT NULL auto_increment,
 183+ page_id int unsigned NOT NULL auto_increment,
184184
185185 -- A page name is broken into a namespace and a title.
186186 -- The namespace keys are UI-language-independent constants,
@@ -195,14 +195,14 @@
196196 page_restrictions tinyblob NOT NULL,
197197
198198 -- Number of times this page has been viewed.
199 - page_counter bigint(20) unsigned NOT NULL default '0',
 199+ page_counter bigint unsigned NOT NULL default '0',
200200
201201 -- 1 indicates the article is a redirect.
202 - page_is_redirect tinyint(1) unsigned NOT NULL default '0',
 202+ page_is_redirect tinyint unsigned NOT NULL default '0',
203203
204204 -- 1 indicates this is a new entry, with only one edit.
205205 -- Not all pages with one edit are new pages.
206 - page_is_new tinyint(1) unsigned NOT NULL default '0',
 206+ page_is_new tinyint unsigned NOT NULL default '0',
207207
208208 -- Random value between 0 and 1, used for Special:Randompage
209209 page_random real unsigned NOT NULL,
@@ -212,15 +212,15 @@
213213 -- Aside from editing this includes permission changes,
214214 -- creation or deletion of linked pages, and alteration
215215 -- of contained templates.
216 - page_touched char(14) binary NOT NULL default '',
 216+ page_touched binary(14) NOT NULL default '',
217217
218218 -- Handy key to revision.rev_id of the current revision.
219219 -- This may be 0 during page creation, but that shouldn't
220220 -- happen outside of a transaction... hopefully.
221 - page_latest int(8) unsigned NOT NULL,
 221+ page_latest int unsigned NOT NULL,
222222
223223 -- Uncompressed length in bytes of the page's current source text.
224 - page_len int(8) unsigned NOT NULL,
 224+ page_len int unsigned NOT NULL,
225225
226226 PRIMARY KEY page_id (page_id),
227227 UNIQUE INDEX name_title (page_namespace,page_title),
@@ -237,16 +237,16 @@
238238 -- to the text storage backend.
239239 --
240240 CREATE TABLE /*$wgDBprefix*/revision (
241 - rev_id int(8) unsigned NOT NULL auto_increment,
 241+ rev_id int unsigned NOT NULL auto_increment,
242242
243243 -- Key to page_id. This should _never_ be invalid.
244 - rev_page int(8) unsigned NOT NULL,
 244+ rev_page int unsigned NOT NULL,
245245
246246 -- Key to text.old_id, where the actual bulk text is stored.
247247 -- It's possible for multiple revisions to use the same text,
248248 -- for instance revisions where only metadata is altered
249249 -- or a rollback to a previous version.
250 - rev_text_id int(8) unsigned NOT NULL,
 250+ rev_text_id int unsigned NOT NULL,
251251
252252 -- Text comment summarizing the change.
253253 -- This text is shown in the history and other changes lists,
@@ -255,27 +255,27 @@
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.
259 - rev_user int(5) unsigned NOT NULL default '0',
 259+ rev_user int unsigned NOT NULL default '0',
260260
261261 -- Text username or IP address of the editor.
262262 rev_user_text varchar(255) binary NOT NULL default '',
263263
264264 -- Timestamp
265 - rev_timestamp char(14) binary NOT NULL default '',
 265+ rev_timestamp binary(14) NOT NULL default '',
266266
267267 -- Records whether the user marked the 'minor edit' checkbox.
268268 -- Many automated edits are marked as minor.
269 - rev_minor_edit tinyint(1) unsigned NOT NULL default '0',
 269+ rev_minor_edit tinyint unsigned NOT NULL default '0',
270270
271271 -- Not yet used; reserved for future changes to the deletion system.
272 - rev_deleted tinyint(1) unsigned NOT NULL default '0',
 272+ rev_deleted tinyint unsigned NOT NULL default '0',
273273
274274 -- Length of this revision in bytes
275 - rev_len int(8) unsigned,
 275+ rev_len int unsigned,
276276
277277 -- Key to revision.rev_id
278278 -- This field is used to add support for a tree structure (The Adjacency List Model)
279 - rev_parent_id int(8) unsigned default NULL,
 279+ rev_parent_id int unsigned default NULL,
280280
281281 PRIMARY KEY rev_page_id (rev_page, rev_id),
282282 UNIQUE INDEX rev_id (rev_id),
@@ -301,7 +301,7 @@
302302 -- refer to this number anymore, but to rev_id.
303303 --
304304 -- revision.rev_text_id is a key to this column
305 - old_id int(8) unsigned NOT NULL auto_increment,
 305+ old_id int unsigned NOT NULL auto_increment,
306306
307307 -- Depending on the contents of the old_flags field, the text
308308 -- may be convenient plain text, or it may be funkily encoded.
@@ -343,10 +343,10 @@
344344
345345 -- Basic revision stuff...
346346 ar_comment tinyblob NOT NULL,
347 - ar_user int(5) unsigned NOT NULL default '0',
 347+ ar_user int unsigned NOT NULL default '0',
348348 ar_user_text varchar(255) binary NOT NULL,
349 - ar_timestamp char(14) binary NOT NULL default '',
350 - ar_minor_edit tinyint(1) NOT NULL default '0',
 349+ ar_timestamp binary(14) NOT NULL default '',
 350+ ar_minor_edit tinyint NOT NULL default '0',
351351
352352 -- See ar_text note.
353353 ar_flags tinyblob NOT NULL,
@@ -358,7 +358,7 @@
359359 --
360360 -- Old entries from 1.4 will be NULL here, and a new rev_id will
361361 -- be created on undeletion for those revisions.
362 - ar_rev_id int(8) unsigned,
 362+ ar_rev_id int unsigned,
363363
364364 -- For newly deleted revisions, this is the text.old_id key to the
365365 -- actual stored text. To avoid breaking the block-compression scheme
@@ -369,13 +369,13 @@
370370 -- Old entries deleted under 1.2-1.4 will have NULL here, and their
371371 -- ar_text and ar_flags fields will be used to create a new text
372372 -- row upon undeletion.
373 - ar_text_id int(8) unsigned,
 373+ ar_text_id int unsigned,
374374
375375 -- rev_deleted for archives
376 - ar_deleted tinyint(1) unsigned NOT NULL default '0',
 376+ ar_deleted tinyint unsigned NOT NULL default '0',
377377
378378 -- Length of this revision in bytes
379 - ar_len int(8) unsigned,
 379+ ar_len int unsigned,
380380
381381 KEY name_title_timestamp (ar_namespace,ar_title,ar_timestamp)
382382
@@ -387,7 +387,7 @@
388388 --
389389 CREATE TABLE /*$wgDBprefix*/pagelinks (
390390 -- Key to the page_id of the page containing the link.
391 - pl_from int(8) unsigned NOT NULL default '0',
 391+ pl_from int unsigned NOT NULL default '0',
392392
393393 -- Key to page_namespace/page_title of the target page.
394394 -- The target page may or may not exist, and due to renames
@@ -407,7 +407,7 @@
408408 --
409409 CREATE TABLE /*$wgDBprefix*/templatelinks (
410410 -- Key to the page_id of the page containing the link.
411 - tl_from int(8) unsigned NOT NULL default '0',
 411+ tl_from int unsigned NOT NULL default '0',
412412
413413 -- Key to page_namespace/page_title of the target page.
414414 -- The target page may or may not exist, and due to renames
@@ -428,7 +428,7 @@
429429 --
430430 CREATE TABLE /*$wgDBprefix*/imagelinks (
431431 -- Key to page_id of the page containing the image / media link.
432 - il_from int(8) unsigned NOT NULL default '0',
 432+ il_from int unsigned NOT NULL default '0',
433433
434434 -- Filename of target image.
435435 -- This is also the page_title of the file's description page;
@@ -447,7 +447,7 @@
448448 --
449449 CREATE TABLE /*$wgDBprefix*/categorylinks (
450450 -- Key to page_id of the page defined as a category member.
451 - cl_from int(8) unsigned NOT NULL default '0',
 451+ cl_from int unsigned NOT NULL default '0',
452452
453453 -- Name of the category.
454454 -- This is also the page_title of the category's description page;
@@ -460,11 +460,9 @@
461461 -- and dangerous new world in MySQL... The sortkey is updated
462462 -- if no override exists and cl_from is renamed.
463463 --
464 - -- For MySQL 4.1+ with charset set to utf8, the sort key *index*
465 - -- needs cut to be smaller than 1024 bytes (at 3 bytes per char).
466 - -- To sort properly on the shorter key, this field needs to be
467 - -- the same shortness.
468 - cl_sortkey varchar(86) binary NOT NULL default '',
 464+ -- Truncate so that the cl_sortkey key fits in 1000 bytes
 465+ -- (MyISAM 5 with server_character_set=utf8)
 466+ cl_sortkey varchar(70) binary NOT NULL default '',
469467
470468 -- This isn't really used at present. Provided for an optional
471469 -- sorting method by approximate addition time.
@@ -485,7 +483,7 @@
486484 --
487485 CREATE TABLE /*$wgDBprefix*/externallinks (
488486 -- page_id of the referring page
489 - el_from int(8) unsigned NOT NULL default '0',
 487+ el_from int unsigned NOT NULL default '0',
490488
491489 -- The URL
492490 el_to blob NOT NULL,
@@ -513,10 +511,10 @@
514512 --
515513 CREATE TABLE /*$wgDBprefix*/langlinks (
516514 -- page_id of the referring page
517 - ll_from int(8) unsigned NOT NULL default '0',
 515+ ll_from int unsigned NOT NULL default '0',
518516
519517 -- Language code of the target
520 - ll_lang varchar(10) binary NOT NULL default '',
 518+ ll_lang varbinary(20) NOT NULL default '',
521519
522520 -- Title of the target, including namespace
523521 ll_title varchar(255) binary NOT NULL default '',
@@ -531,32 +529,32 @@
532530 --
533531 CREATE TABLE /*$wgDBprefix*/site_stats (
534532 -- The single row should contain 1 here.
535 - ss_row_id int(8) unsigned NOT NULL,
 533+ ss_row_id int unsigned NOT NULL,
536534
537535 -- Total number of page views, if hit counters are enabled.
538 - ss_total_views bigint(20) unsigned default '0',
 536+ ss_total_views bigint unsigned default '0',
539537
540538 -- Total number of edits performed.
541 - ss_total_edits bigint(20) unsigned default '0',
 539+ ss_total_edits bigint unsigned default '0',
542540
543541 -- An approximate count of pages matching the following criteria:
544542 -- * in namespace 0
545543 -- * not a redirect
546544 -- * contains the text '[['
547545 -- See Article::isCountable() in includes/Article.php
548 - ss_good_articles bigint(20) unsigned default '0',
 546+ ss_good_articles bigint unsigned default '0',
549547
550548 -- Total pages, theoretically equal to SELECT COUNT(*) FROM page; except faster
551 - ss_total_pages bigint(20) default '-1',
 549+ ss_total_pages bigint default '-1',
552550
553551 -- Number of users, theoretically equal to SELECT COUNT(*) FROM user;
554 - ss_users bigint(20) default '-1',
 552+ ss_users bigint default '-1',
555553
556554 -- Deprecated, no longer updated as of 1.5
557 - ss_admins int(10) default '-1',
 555+ ss_admins int default '-1',
558556
559557 -- Number of images, equivalent to SELECT COUNT(*) FROM image
560 - ss_images int(10) default '0',
 558+ ss_images int default '0',
561559
562560 UNIQUE KEY ss_row_id (ss_row_id)
563561
@@ -580,23 +578,23 @@
581579 --
582580 CREATE TABLE /*$wgDBprefix*/ipblocks (
583581 -- Primary key, introduced for privacy.
584 - ipb_id int(8) NOT NULL auto_increment,
 582+ ipb_id int NOT NULL auto_increment,
585583
586584 -- Blocked IP address in dotted-quad form or user name.
587585 ipb_address tinyblob NOT NULL,
588586
589587 -- Blocked user ID or 0 for IP blocks.
590 - ipb_user int(8) unsigned NOT NULL default '0',
 588+ ipb_user int unsigned NOT NULL default '0',
591589
592590 -- User ID who made the block.
593 - ipb_by int(8) unsigned NOT NULL default '0',
 591+ ipb_by int unsigned NOT NULL default '0',
594592
595593 -- Text comment made by blocker.
596594 ipb_reason tinyblob NOT NULL,
597595
598596 -- Creation (or refresh) date in standard YMDHMS form.
599597 -- IP blocks expire automatically.
600 - ipb_timestamp char(14) binary NOT NULL default '',
 598+ ipb_timestamp binary(14) NOT NULL default '',
601599
602600 -- Indicates that the IP address was banned because a banned
603601 -- user accessed a page through it. If this is 1, ipb_address
@@ -613,7 +611,8 @@
614612 ipb_enable_autoblock bool NOT NULL default '1',
615613
616614 -- Time at which the block will expire.
617 - ipb_expiry char(14) binary NOT NULL default '',
 615+ -- May be "infinity"
 616+ ipb_expiry varbinary(14) NOT NULL default '',
618617
619618 -- Start and end of an address range, in hexadecimal
620619 -- Size chosen to allow IPv6
@@ -650,17 +649,17 @@
651650 img_name varchar(255) binary NOT NULL default '',
652651
653652 -- File size in bytes.
654 - img_size int(8) unsigned NOT NULL default '0',
 653+ img_size int unsigned NOT NULL default '0',
655654
656655 -- For images, size in pixels.
657 - img_width int(5) NOT NULL default '0',
658 - img_height int(5) NOT NULL default '0',
 656+ img_width int NOT NULL default '0',
 657+ img_height int NOT NULL default '0',
659658
660659 -- Extracted EXIF metadata stored as a serialized PHP array.
661660 img_metadata mediumblob NOT NULL,
662661
663662 -- For images, bits per pixel if known.
664 - img_bits int(3) NOT NULL default '0',
 663+ img_bits int NOT NULL default '0',
665664
666665 -- Media type as defined by the MEDIATYPE_xxx constants
667666 img_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL,
@@ -673,18 +672,18 @@
674673 -- the minor parts are not required to adher to any standard
675674 -- but should be consistent throughout the database
676675 -- see http://www.iana.org/assignments/media-types/
677 - img_minor_mime varchar(32) NOT NULL default "unknown",
 676+ img_minor_mime varbinary(32) NOT NULL default "unknown",
678677
679678 -- Description field as entered by the uploader.
680679 -- This is displayed in image upload history and logs.
681680 img_description tinyblob NOT NULL,
682681
683682 -- user_id and user_name of uploader.
684 - img_user int(5) unsigned NOT NULL default '0',
 683+ img_user int unsigned NOT NULL default '0',
685684 img_user_text varchar(255) binary NOT NULL,
686685
687686 -- Time of the upload.
688 - img_timestamp char(14) binary NOT NULL default '',
 687+ img_timestamp varbinary(14) NOT NULL default '',
689688
690689 PRIMARY KEY img_name (img_name),
691690
@@ -710,23 +709,24 @@
711710 oi_archive_name varchar(255) binary NOT NULL default '',
712711
713712 -- Other fields as in image...
714 - oi_size int(8) unsigned NOT NULL default 0,
715 - oi_width int(5) NOT NULL default 0,
716 - oi_height int(5) NOT NULL default 0,
717 - oi_bits int(3) NOT NULL default 0,
 713+ oi_size int unsigned NOT NULL default 0,
 714+ oi_width int NOT NULL default 0,
 715+ oi_height int NOT NULL default 0,
 716+ oi_bits int NOT NULL default 0,
718717 oi_description tinyblob NOT NULL,
719 - oi_user int(5) unsigned NOT NULL default '0',
 718+ oi_user int unsigned NOT NULL default '0',
720719 oi_user_text varchar(255) binary NOT NULL,
721 - oi_timestamp char(14) binary NOT NULL default '',
 720+ oi_timestamp binary(14) NOT NULL default '',
722721
723722 oi_metadata mediumblob NOT NULL,
724723 oi_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL,
725724 oi_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown",
726 - oi_minor_mime varchar(32) NOT NULL default "unknown",
727 - oi_deleted tinyint(1) unsigned NOT NULL default '0',
 725+ oi_minor_mime varbinary(32) NOT NULL default "unknown",
 726+ oi_deleted tinyint unsigned NOT NULL default '0',
728727
729728 INDEX oi_name_timestamp (oi_name,oi_timestamp),
730 - INDEX oi_name_archive_name (oi_name,oi_archive_name)
 729+ -- oi_archive_name truncated to 14 to avoid key length overflow
 730+ INDEX oi_name_archive_name (oi_name,oi_archive_name(14))
731731
732732 ) /*$wgDBTableOptions*/;
733733
@@ -746,36 +746,36 @@
747747 -- Which storage bin (directory tree or object store) the file data
748748 -- is stored in. Should be 'deleted' for files that have been deleted;
749749 -- any other bin is not yet in use.
750 - fa_storage_group varchar(16),
 750+ fa_storage_group varbinary(16),
751751
752752 -- SHA-1 of the file contents plus extension, used as a key for storage.
753753 -- eg 8f8a562add37052a1848ff7771a2c515db94baa9.jpg
754754 --
755755 -- If NULL, the file was missing at deletion time or has been purged
756756 -- from the archival storage.
757 - fa_storage_key varchar(64) binary default '',
 757+ fa_storage_key varbinary(64) default '',
758758
759759 -- Deletion information, if this file is deleted.
760760 fa_deleted_user int,
761 - fa_deleted_timestamp char(14) binary default '',
 761+ fa_deleted_timestamp binary(14) default '',
762762 fa_deleted_reason text,
763763
764764 -- Duped fields from image
765 - fa_size int(8) unsigned default '0',
766 - fa_width int(5) default '0',
767 - fa_height int(5) default '0',
 765+ fa_size int unsigned default '0',
 766+ fa_width int default '0',
 767+ fa_height int default '0',
768768 fa_metadata mediumblob,
769 - fa_bits int(3) default '0',
 769+ fa_bits int default '0',
770770 fa_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL,
771771 fa_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") default "unknown",
772772 fa_minor_mime varchar(32) default "unknown",
773773 fa_description tinyblob,
774 - fa_user int(5) unsigned default '0',
 774+ fa_user int unsigned default '0',
775775 fa_user_text varchar(255) binary,
776 - fa_timestamp char(14) binary default '',
 776+ fa_timestamp binary(14) default '',
777777
778778 -- Visibility of deleted revisions, bitfield
779 - fa_deleted tinyint(1) unsigned NOT NULL default '0',
 779+ fa_deleted tinyint unsigned NOT NULL default '0',
780780
781781 PRIMARY KEY (fa_id),
782782 INDEX (fa_name, fa_timestamp), -- pick out by image name
@@ -791,12 +791,12 @@
792792 -- the last few days, see Article::editUpdates()
793793 --
794794 CREATE TABLE /*$wgDBprefix*/recentchanges (
795 - rc_id int(8) NOT NULL auto_increment,
796 - rc_timestamp varchar(14) binary NOT NULL default '',
797 - rc_cur_time varchar(14) binary NOT NULL default '',
 795+ rc_id int NOT NULL auto_increment,
 796+ rc_timestamp varbinary(14) NOT NULL default '',
 797+ rc_cur_time varbinary(14) NOT NULL default '',
798798
799799 -- As in revision
800 - rc_user int(10) unsigned NOT NULL default '0',
 800+ rc_user int unsigned NOT NULL default '0',
801801 rc_user_text varchar(255) binary NOT NULL,
802802
803803 -- When pages are renamed, their RC entries do _not_ change.
@@ -805,51 +805,51 @@
806806
807807 -- as in revision...
808808 rc_comment varchar(255) binary NOT NULL default '',
809 - rc_minor tinyint(3) unsigned NOT NULL default '0',
 809+ rc_minor tinyint unsigned NOT NULL default '0',
810810
811811 -- Edits by user accounts with the 'bot' rights key are
812812 -- marked with a 1 here, and will be hidden from the
813813 -- default view.
814 - rc_bot tinyint(3) unsigned NOT NULL default '0',
 814+ rc_bot tinyint unsigned NOT NULL default '0',
815815
816 - rc_new tinyint(3) unsigned NOT NULL default '0',
 816+ rc_new tinyint unsigned NOT NULL default '0',
817817
818818 -- Key to page_id (was cur_id prior to 1.5).
819819 -- This will keep links working after moves while
820820 -- retaining the at-the-time name in the changes list.
821 - rc_cur_id int(10) unsigned NOT NULL default '0',
 821+ rc_cur_id int unsigned NOT NULL default '0',
822822
823823 -- rev_id of the given revision
824 - rc_this_oldid int(10) unsigned NOT NULL default '0',
 824+ rc_this_oldid int unsigned NOT NULL default '0',
825825
826826 -- rev_id of the prior revision, for generating diff links.
827 - rc_last_oldid int(10) unsigned NOT NULL default '0',
 827+ rc_last_oldid int unsigned NOT NULL default '0',
828828
829829 -- These may no longer be used, with the new move log.
830 - rc_type tinyint(3) unsigned NOT NULL default '0',
831 - rc_moved_to_ns tinyint(3) unsigned NOT NULL default '0',
 830+ rc_type tinyint unsigned NOT NULL default '0',
 831+ rc_moved_to_ns tinyint unsigned NOT NULL default '0',
832832 rc_moved_to_title varchar(255) binary NOT NULL default '',
833833
834834 -- If the Recent Changes Patrol option is enabled,
835835 -- users may mark edits as having been reviewed to
836836 -- remove a warning flag on the RC list.
837837 -- A value of 1 indicates the page has been reviewed.
838 - rc_patrolled tinyint(3) unsigned NOT NULL default '0',
 838+ rc_patrolled tinyint unsigned NOT NULL default '0',
839839
840840 -- Recorded IP address the edit was made from, if the
841841 -- $wgPutIPinRC option is enabled.
842 - rc_ip char(15) NOT NULL default '',
 842+ rc_ip varbinary(40) NOT NULL default '',
843843
844844 -- Text length in characters before
845845 -- and after the edit
846 - rc_old_len int(10),
847 - rc_new_len int(10),
 846+ rc_old_len int,
 847+ rc_new_len int,
848848
849849 -- Visibility of deleted revisions, bitfield
850 - rc_deleted tinyint(1) unsigned NOT NULL default '0',
 850+ rc_deleted tinyint unsigned NOT NULL default '0',
851851
852852 -- Value corresonding to log_id, specific log entries
853 - rc_logid int(10) unsigned NOT NULL default '0',
 853+ rc_logid int unsigned NOT NULL default '0',
854854 -- Store log type info here, or null
855855 rc_log_type varchar(255) binary NULL default NULL,
856856 -- Store log action or null
@@ -870,7 +870,7 @@
871871
872872 CREATE TABLE /*$wgDBprefix*/watchlist (
873873 -- Key to user.user_id
874 - wl_user int(5) unsigned NOT NULL,
 874+ wl_user int unsigned NOT NULL,
875875
876876 -- Key to page_namespace/page_title
877877 -- Note that users may watch pages which do not exist yet,
@@ -880,7 +880,7 @@
881881
882882 -- Timestamp when user was last sent a notification e-mail;
883883 -- cleared when the user visits the page.
884 - wl_notificationtimestamp varchar(14) binary,
 884+ wl_notificationtimestamp varbinary(14),
885885
886886 UNIQUE KEY (wl_user, wl_namespace, wl_title),
887887 KEY namespace_title (wl_namespace, wl_title)
@@ -894,14 +894,14 @@
895895 --
896896 CREATE TABLE /*$wgDBprefix*/math (
897897 -- Binary MD5 hash of the latex fragment, used as an identifier key.
898 - math_inputhash varchar(16) NOT NULL,
 898+ math_inputhash varbinary(16) NOT NULL,
899899
900900 -- Not sure what this is, exactly...
901 - math_outputhash varchar(16) NOT NULL,
 901+ math_outputhash varbinary(16) NOT NULL,
902902
903903 -- texvc reports how well it thinks the HTML conversion worked;
904904 -- if it's a low level the PNG rendering may be preferred.
905 - math_html_conservativeness tinyint(1) NOT NULL,
 905+ math_html_conservativeness tinyint NOT NULL,
906906
907907 -- HTML output from texvc, if any
908908 math_html text,
@@ -923,7 +923,7 @@
924924 --
925925 CREATE TABLE /*$wgDBprefix*/searchindex (
926926 -- Key to page_id
927 - si_page int(8) unsigned NOT NULL,
 927+ si_page int unsigned NOT NULL,
928928
929929 -- Munged version of title
930930 si_title varchar(255) NOT NULL default '',
@@ -942,19 +942,19 @@
943943 --
944944 CREATE TABLE /*$wgDBprefix*/interwiki (
945945 -- The interwiki prefix, (e.g. "Meatball", or the language prefix "de")
946 - iw_prefix char(32) NOT NULL,
 946+ iw_prefix varchar(32) NOT NULL,
947947
948948 -- The URL of the wiki, with "$1" as a placeholder for an article name.
949949 -- Any spaces in the name will be transformed to underscores before
950950 -- insertion.
951 - iw_url varchar(127) NOT NULL,
 951+ iw_url blob NOT NULL,
952952
953953 -- A boolean value indicating whether the wiki is in this project
954954 -- (used, for example, to detect redirect loops)
955955 iw_local bool NOT NULL,
956956
957957 -- Boolean value indicating whether interwiki transclusions are allowed.
958 - iw_trans tinyint(1) NOT NULL default 0,
 958+ iw_trans tinyint NOT NULL default 0,
959959
960960 UNIQUE KEY iw_prefix (iw_prefix)
961961
@@ -965,10 +965,10 @@
966966 --
967967 CREATE TABLE /*$wgDBprefix*/querycache (
968968 -- A key name, generally the base name of of the special page.
969 - qc_type varchar(32) binary NOT NULL,
 969+ qc_type varbinary(32) NOT NULL,
970970
971971 -- Some sort of stored value. Sizes, counts...
972 - qc_value int(5) unsigned NOT NULL default '0',
 972+ qc_value int unsigned NOT NULL default '0',
973973
974974 -- Target namespace+title
975975 qc_namespace int NOT NULL default '0',
@@ -982,7 +982,7 @@
983983 -- For a few generic cache operations if not using Memcached
984984 --
985985 CREATE TABLE /*$wgDBprefix*/objectcache (
986 - keyname varchar(255) binary NOT NULL default '',
 986+ keyname varbinary(255) NOT NULL default '',
987987 value mediumblob,
988988 exptime datetime,
989989 UNIQUE KEY (keyname),
@@ -1004,11 +1004,11 @@
10051005 -- Symbolic keys for the general log type and the action type
10061006 -- within the log. The output format will be controlled by the
10071007 -- action field, but only the type controls categorization.
1008 - log_type char(10) NOT NULL default '',
1009 - log_action char(10) NOT NULL default '',
 1008+ log_type varbinary(20) NOT NULL default '',
 1009+ log_action varbinary(20) NOT NULL default '',
10101010
10111011 -- Timestamp. Duh.
1012 - log_timestamp char(14) NOT NULL default '19700101000000',
 1012+ log_timestamp binary(14) NOT NULL default '19700101000000',
10131013
10141014 -- The user who performed this action; key to user_id
10151015 log_user int unsigned NOT NULL default 0,
@@ -1028,7 +1028,7 @@
10291029 log_id int unsigned NOT NULL auto_increment,
10301030
10311031 -- rev_deleted for logs
1032 - log_deleted tinyint(1) unsigned NOT NULL default '0',
 1032+ log_deleted tinyint unsigned NOT NULL default '0',
10331033
10341034 PRIMARY KEY log_id (log_id),
10351035 KEY type_time (log_type, log_timestamp),
@@ -1042,7 +1042,7 @@
10431043 tb_id int auto_increment,
10441044 tb_page int REFERENCES page(page_id) ON DELETE CASCADE,
10451045 tb_title varchar(255) NOT NULL,
1046 - tb_url varchar(255) NOT NULL,
 1046+ tb_url blob NOT NULL,
10471047 tb_ex text,
10481048 tb_name varchar(255),
10491049
@@ -1053,10 +1053,11 @@
10541054
10551055 -- Jobs performed by parallel apache threads or a command-line daemon
10561056 CREATE TABLE /*$wgDBprefix*/job (
1057 - job_id int(9) unsigned NOT NULL auto_increment,
 1057+ job_id int unsigned NOT NULL auto_increment,
10581058
1059 - -- Command name, currently only refreshLinks is defined
1060 - job_cmd varchar(255) NOT NULL default '',
 1059+ -- Command name
 1060+ -- Limited to 60 to prevent key length overflow
 1061+ job_cmd varbinary(60) NOT NULL default '',
10611062
10621063 -- Namespace and title to act on
10631064 -- Should be 0 and '' if the command does not operate on a title
@@ -1080,7 +1081,7 @@
10811082 qci_type varchar(32) NOT NULL default '',
10821083
10831084 -- Timestamp of last update
1084 - qci_timestamp char(14) NOT NULL default '19700101000000',
 1085+ qci_timestamp binary(14) NOT NULL default '19700101000000',
10851086
10861087 UNIQUE KEY ( qci_type )
10871088
@@ -1089,7 +1090,7 @@
10901091 -- For each redirect, this table contains exactly one row defining its target
10911092 CREATE TABLE /*$wgDBprefix*/redirect (
10921093 -- Key to the page_id of the redirect page
1093 - rd_from int(8) unsigned NOT NULL default '0',
 1094+ rd_from int unsigned NOT NULL default '0',
10941095
10951096 -- Key to page_namespace/page_title of the target page.
10961097 -- The target page may or may not exist, and due to renames
@@ -1105,10 +1106,10 @@
11061107 -- Used for caching expensive grouped queries that need two links (for example double-redirects)
11071108 CREATE TABLE /*$wgDBprefix*/querycachetwo (
11081109 -- A key name, generally the base name of of the special page.
1109 - qcc_type varchar(32) NOT NULL,
 1110+ qcc_type varbinary(32) NOT NULL,
11101111
11111112 -- Some sort of stored value. Sizes, counts...
1112 - qcc_value int(5) unsigned NOT NULL default '0',
 1113+ qcc_value int unsigned NOT NULL default '0',
11131114
11141115 -- Target namespace+title
11151116 qcc_namespace int NOT NULL default '0',
@@ -1127,17 +1128,17 @@
11281129 -- Used for storing page restrictions (i.e. protection levels)
11291130 CREATE TABLE /*$wgDBprefix*/page_restrictions (
11301131 -- Page to apply restrictions to (Foreign Key to page).
1131 - pr_page int(8) NOT NULL,
 1132+ pr_page int NOT NULL,
11321133 -- The protection type (edit, move, etc)
1133 - pr_type varchar(255) NOT NULL,
 1134+ pr_type varbinary(60) NOT NULL,
11341135 -- The protection level (Sysop, autoconfirmed, etc)
1135 - pr_level varchar(255) NOT NULL,
 1136+ pr_level varbinary(60) NOT NULL,
11361137 -- Whether or not to cascade the protection down to pages transcluded.
1137 - pr_cascade tinyint(4) NOT NULL,
 1138+ pr_cascade tinyint NOT NULL,
11381139 -- Field for future support of per-user restriction.
1139 - pr_user int(8) NULL,
 1140+ pr_user int NULL,
11401141 -- Field for time-limited protection.
1141 - pr_expiry char(14) binary NULL,
 1142+ pr_expiry varbinary(14) NULL,
11421143 -- Field for an ID for this restrictions row (sort-key for Special:ProtectedPages)
11431144 pr_id int unsigned NOT NULL auto_increment,
11441145

Follow-up revisions

RevisionCommit summaryAuthorDate
r23407Merged revisions 23203-23405 via svnmerge from...david23:00, 25 June 2007
r23651Backported schema changes from r23239 and r23247.tstarling16:53, 2 July 2007
r81311For bug 24129 and a followup to r23239, there was never a patch to transfer f...reedy18:35, 1 February 2011

Status & tagging log