r83138 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83137‎ | r83138 | r83139 >
Date:06:38, 3 March 2011
Author:aaron
Status:ok (Comments)
Tags:
Comment:
Changed char(14)'s to varbinary(14)'s for sanity in avoiding the threat of \0 padding
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.sql (modified) (history)
  • /trunk/extensions/FlaggedRevs/mysql/patch-fi_img_timestamp.sql (modified) (history)
  • /trunk/extensions/FlaggedRevs/mysql/patch-flaggedpage_pending.sql (modified) (history)
  • /trunk/extensions/FlaggedRevs/mysql/patch-fp_pending_since.sql (modified) (history)
  • /trunk/extensions/FlaggedRevs/mysql/patch-fr_img_name.sql (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.sql
@@ -10,7 +10,7 @@
1111 -- Is the stable version synced?
1212 fp_reviewed bool NOT NULL default '0',
1313 -- When (or NULL) the first edit after the stable version was made
14 - fp_pending_since char(14) NULL,
 14+ fp_pending_since varbinary(14) NULL,
1515 -- Foreign key to flaggedrevs.fr_rev_id
1616 fp_stable integer unsigned NOT NULL,
1717 -- The highest quality of the page's reviewed revisions.
@@ -31,7 +31,7 @@
3232 -- The last rev ID with this quality
3333 fpp_rev_id integer unsigned NOT NULL,
3434 -- Time of the first edit after the last revision reviewed to this level
35 - fpp_pending_since char(14) NOT NULL,
 35+ fpp_pending_since varbinary(14) NOT NULL,
3636
3737 PRIMARY KEY (fpp_page_id,fpp_quality)
3838 ) /*$wgDBTableOptions*/;
@@ -47,7 +47,7 @@
4848 fr_rev_id integer unsigned NOT NULL,
4949 -- Foreign key to user.user_id
5050 fr_user integer unsigned NOT NULL,
51 - fr_timestamp char(14) NOT NULL,
 51+ fr_timestamp varbinary(14) NOT NULL,
5252 fr_comment mediumblob NOT NULL,
5353 -- Store the precedence level
5454 fr_quality tinyint(1) NOT NULL default 0,
@@ -66,7 +66,7 @@
6767 -- Name of included image (NULL if n/a)
6868 fr_img_name varchar(255) binary NULL default NULL,
6969 -- Timestamp of file (when uploaded) (NULL if n/a)
70 - fr_img_timestamp char(14) NULL default NULL,
 70+ fr_img_timestamp varbinary(14) NULL default NULL,
7171 -- Statistically unique SHA-1 key (NULL if n/a)
7272 fr_img_sha1 varbinary(32) NULL default NULL,
7373
@@ -94,7 +94,7 @@
9595 -- Name of included image
9696 fi_name varchar(255) binary NOT NULL default '',
9797 -- Timestamp of image used when reviewed
98 - fi_img_timestamp char(14) NULL,
 98+ fi_img_timestamp varbinary(14) NULL,
9999 -- Statistically unique SHA-1 key
100100 fi_img_sha1 varbinary(32) NOT NULL default '',
101101
Index: trunk/extensions/FlaggedRevs/mysql/patch-flaggedpage_pending.sql
@@ -7,7 +7,7 @@
88 -- The last rev ID with this quality
99 fpp_rev_id integer unsigned NOT NULL,
1010 -- Time (or NULL) of the first edit after the last revision reviewed to this level
11 - fpp_pending_since char(14) NOT NULL,
 11+ fpp_pending_since varbinary(14) NOT NULL,
1212
1313 PRIMARY KEY (fpp_page_id,fpp_quality),
1414 INDEX fpp_quality_pending (fpp_quality,fpp_pending_since)
Index: trunk/extensions/FlaggedRevs/mysql/patch-fp_pending_since.sql
@@ -1,4 +1,4 @@
22 -- Add timestamp column of first unreviewed rev for flaggedrevs
33 ALTER TABLE /*$wgDBprefix*/flaggedpages
4 - ADD fp_pending_since char(14) NULL,
 4+ ADD fp_pending_since varbinary(14) NULL,
55 ADD INDEX fp_pending_since (fp_pending_since);
Index: trunk/extensions/FlaggedRevs/mysql/patch-fi_img_timestamp.sql
@@ -1,6 +1,6 @@
22 -- Fix bad fi_img_timestamp definition
33 ALTER TABLE /*$wgDBprefix*/flaggedimages
4 - CHANGE fi_img_timestamp fi_img_timestamp char(14) NULL;
 4+ CHANGE fi_img_timestamp fi_img_timestamp varbinary(14) NULL;
55 -- Move bad values over to NULL
66 UPDATE /*$wgDBprefix*/flaggedimages
77 SET fi_img_timestamp = NULL WHERE LOCATE( '\0', fi_img_timestamp );
Index: trunk/extensions/FlaggedRevs/mysql/patch-fr_img_name.sql
@@ -3,7 +3,7 @@
44 -- Name of included image
55 ADD fr_img_name varchar(255) binary NULL default NULL,
66 -- Timestamp of file (when uploaded)
7 - ADD fr_img_timestamp char(14) NULL default NULL,
 7+ ADD fr_img_timestamp varbinary(14) NULL default NULL,
88 -- Statistically unique SHA-1 key
99 ADD fr_img_sha1 varbinary(32) NULL default NULL,
1010 ADD INDEX fr_img_sha1 (fr_img_sha1);

Follow-up revisions

RevisionCommit summaryAuthorDate
r83451MFT r83138: FlaggedRevs schema timestamp typetstarling09:53, 7 March 2011

Comments

#Comment by 😂 (talk | contribs)   21:30, 29 May 2011

Patch to change current char(14)s? Otherwise this is ok.

#Comment by Aaron Schulz (talk | contribs)   23:06, 29 May 2011

The only one that *needs* it already has a patch. The others are just there for better layout practice.

Status & tagging log