r62877 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62876‎ | r62877 | r62878 >
Date:14:13, 23 February 2010
Author:freakolowsky
Status:ok
Tags:
Comment:
Backport r62870 and r62872
Modified paths:
  • /branches/REL1_16/phase3/maintenance/archives/patch-mime_minor_length.sql (added) (history)
  • /branches/REL1_16/phase3/maintenance/ora/tables.sql (modified) (history)
  • /branches/REL1_16/phase3/maintenance/tables.sql (modified) (history)
  • /branches/REL1_16/phase3/maintenance/updaters.inc (modified) (history)

Diff [purge]

Index: branches/REL1_16/phase3/maintenance/archives/patch-mime_minor_length.sql
@@ -0,0 +1,10 @@
 2+ALTER TABLE /*_*/filearchive
 3+ MODIFY COLUMN fa_minor_mime varbinary(100) default "unknown";
 4+
 5+ALTER TABLE /*_*/image
 6+ MODIFY COLUMN img_minor_mime varbinary(100) NOT NULL default "unknown";
 7+
 8+ALTER TABLE /*_*/oldimage
 9+ MODIFY COLUMN oi_minor_mime varbinary(100) NOT NULL default "unknown";
 10+
 11+INSERT INTO /*_*/updatelog VALUES ('mime_minor_length');
\ No newline at end of file
Property changes on: branches/REL1_16/phase3/maintenance/archives/patch-mime_minor_length.sql
___________________________________________________________________
Name: svn:eol-style
112 + native
Index: branches/REL1_16/phase3/maintenance/ora/tables.sql
@@ -253,7 +253,7 @@
254254 img_bits NUMBER,
255255 img_media_type VARCHAR2(32),
256256 img_major_mime VARCHAR2(32) DEFAULT 'unknown',
257 - img_minor_mime VARCHAR2(32) DEFAULT 'unknown',
 257+ img_minor_mime VARCHAR2(100) DEFAULT 'unknown',
258258 img_description VARCHAR2(255),
259259 img_user NUMBER NULL REFERENCES &mw_prefix.mwuser(user_id) ON DELETE SET NULL,
260260 img_user_text VARCHAR2(255) NOT NULL,
@@ -281,7 +281,7 @@
282282 oi_metadata CLOB,
283283 oi_media_type VARCHAR2(32) DEFAULT NULL,
284284 oi_major_mime VARCHAR2(32) DEFAULT 'unknown',
285 - oi_minor_mime VARCHAR2(32) DEFAULT 'unknown',
 285+ oi_minor_mime VARCHAR2(100) DEFAULT 'unknown',
286286 oi_deleted NUMBER DEFAULT 0 NOT NULL,
287287 oi_sha1 VARCHAR2(32)
288288 );
@@ -308,7 +308,7 @@
309309 fa_bits NUMBER,
310310 fa_media_type VARCHAR2(32) DEFAULT NULL,
311311 fa_major_mime VARCHAR2(32) DEFAULT 'unknown',
312 - fa_minor_mime VARCHAR2(32) DEFAULT 'unknown',
 312+ fa_minor_mime VARCHAR2(100) DEFAULT 'unknown',
313313 fa_description VARCHAR2(255),
314314 fa_user NUMBER NULL REFERENCES &mw_prefix.mwuser(user_id) ON DELETE SET NULL,
315315 fa_user_text VARCHAR2(255) NOT NULL,
Index: branches/REL1_16/phase3/maintenance/updaters.inc
@@ -169,6 +169,7 @@
170170 // A field changed name mid-release cycle, so fix it for anyone using
171171 // trunk
172172 array( 'rename_eu_wiki_id' ),
 173+ array( 'do_update_mime_minor_field' ),
173174 ),
174175
175176 'sqlite' => array(
@@ -194,7 +195,6 @@
195196 array( 'add_index', 'change_tag', 'change_tag_rc_tag', 'patch-change_tag-indexes.sql' ),
196197 array( 'add_field', 'redirect', 'rd_interwiki', 'patch-rd_interwiki.sql' ),
197198 array( 'do_update_transcache_field' ),
198 -
199199 // version-independent searchindex setup, added in 1.16
200200 array( 'sqlite_setup_searchindex' ),
201201 ),
@@ -1356,6 +1356,19 @@
13571357 }
13581358 }
13591359
 1360+function do_update_mime_minor_field() {
 1361+ if ( update_row_exists( 'mime_minor_length' ) ) {
 1362+ wfOut( "*_mime_minor fields are already long enough.\n" );
 1363+ } else {
 1364+ global $wgDatabase;
 1365+ wfOut( "Altering all *_mime_minor fields to 100 bytes in size ... " );
 1366+ $wgDatabase->sourceFile( archive( 'patch-mime_minor_length.sql' ) );
 1367+ wfOut( "ok\n" );
 1368+ }
 1369+}
 1370+
 1371+
 1372+
13601373 /***********************************************************************
13611374 * Start PG stuff
13621375 * TODO: merge with above
Index: branches/REL1_16/phase3/maintenance/tables.sql
@@ -764,7 +764,7 @@
765765 -- the minor parts are not required to adher to any standard
766766 -- but should be consistent throughout the database
767767 -- see http://www.iana.org/assignments/media-types/
768 - img_minor_mime varbinary(32) NOT NULL default "unknown",
 768+ img_minor_mime varbinary(100) NOT NULL default "unknown",
769769
770770 -- Description field as entered by the uploader.
771771 -- This is displayed in image upload history and logs.
@@ -816,7 +816,7 @@
817817 oi_metadata mediumblob NOT NULL,
818818 oi_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL,
819819 oi_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown",
820 - oi_minor_mime varbinary(32) NOT NULL default "unknown",
 820+ oi_minor_mime varbinary(100) NOT NULL default "unknown",
821821 oi_deleted tinyint unsigned NOT NULL default 0,
822822 oi_sha1 varbinary(32) NOT NULL default ''
823823 ) /*$wgDBTableOptions*/;
@@ -866,7 +866,7 @@
867867 fa_bits int default 0,
868868 fa_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL,
869869 fa_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") default "unknown",
870 - fa_minor_mime varbinary(32) default "unknown",
 870+ fa_minor_mime varbinary(100) default "unknown",
871871 fa_description tinyblob,
872872 fa_user int unsigned default 0,
873873 fa_user_text varchar(255) binary,

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r62870Changed all *_mime_minor field lengths to 100; current 32 does not support so...freakolowsky11:24, 23 February 2010
r62872Fixes for r62870. It still needs a patch for Oracle thoughmaxsem12:24, 23 February 2010

Status & tagging log