From 8b70c17d246051dca4ae10eaa2195ebeab66ea68 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Wed, 19 Jan 2011 01:11:21 +0000 Subject: [PATCH] War on varchar. Changed all occurrences of varchar(N) and varchar(N) binary to varbinary(N). varchars cause problems ("Invalid mix of collations" errors) on MySQL databases with certain configs, most notably the default MySQL config --- maintenance/archives/patch-category.sql | 2 +- .../patch-categorylinks-better-collation.sql | 2 +- maintenance/archives/patch-categorylinks.sql | 4 +- maintenance/archives/patch-change_tag.sql | 4 +- maintenance/archives/patch-external_user.sql | 2 +- maintenance/archives/patch-filearchive.sql | 6 +- maintenance/archives/patch-fix-il_from.sql | 2 +- maintenance/archives/patch-interwiki.sql | 2 +- maintenance/archives/patch-ipb_by_text.sql | 2 +- .../archives/patch-iw_api_and_wikiid.sql | 2 +- maintenance/archives/patch-iwlinks.sql | 2 +- maintenance/archives/patch-job.sql | 2 +- maintenance/archives/patch-l10n_cache.sql | 2 +- maintenance/archives/patch-langlinks.sql | 2 +- maintenance/archives/patch-linktables.sql | 4 +- maintenance/archives/patch-log_search.sql | 2 +- maintenance/archives/patch-log_user_text.sql | 2 +- maintenance/archives/patch-logging-title.sql | 2 +- maintenance/archives/patch-logging.sql | 4 +- maintenance/archives/patch-pagelinks.sql | 2 +- maintenance/archives/patch-profiling.sql | 4 +- .../archives/patch-protected_titles.sql | 2 +- .../archives/patch-pt_title-encoding.sql | 2 +- maintenance/archives/patch-querycache.sql | 2 +- maintenance/archives/patch-querycachetwo.sql | 4 +- maintenance/archives/patch-rc_type.sql | 2 +- maintenance/archives/patch-rd_interwiki.sql | 4 +- maintenance/archives/patch-redirect.sql | 2 +- maintenance/archives/patch-restructure.sql | 4 +- maintenance/archives/patch-searchindex.sql | 2 +- maintenance/archives/patch-templatelinks.sql | 2 +- maintenance/archives/patch-testrun.sql | 4 +- maintenance/archives/patch-updatelog.sql | 2 +- maintenance/archives/patch-user-realname.sql | 2 +- maintenance/archives/patch-val_ip.sql | 2 +- maintenance/archives/patch-validate.sql | 4 +- maintenance/archives/patch-watchlist.sql | 2 +- maintenance/tables.sql | 100 +++++++++--------- 38 files changed, 99 insertions(+), 99 deletions(-) diff --git a/maintenance/archives/patch-category.sql b/maintenance/archives/patch-category.sql index 416500c3cc..cb6aee0e52 100644 --- a/maintenance/archives/patch-category.sql +++ b/maintenance/archives/patch-category.sql @@ -1,7 +1,7 @@ CREATE TABLE /*$wgDBprefix*/category ( cat_id int unsigned NOT NULL auto_increment, - cat_title varchar(255) binary NOT NULL, + cat_title varbinary(255) NOT NULL, cat_pages int signed NOT NULL default 0, cat_subcats int signed NOT NULL default 0, diff --git a/maintenance/archives/patch-categorylinks-better-collation.sql b/maintenance/archives/patch-categorylinks-better-collation.sql index c1499c151c..4859e8e685 100644 --- a/maintenance/archives/patch-categorylinks-better-collation.sql +++ b/maintenance/archives/patch-categorylinks-better-collation.sql @@ -10,7 +10,7 @@ -- sure to also change the check in LinksUpdate.php. ALTER TABLE /*$wgDBprefix*/categorylinks CHANGE COLUMN cl_sortkey cl_sortkey varbinary(230) NOT NULL default '', - ADD COLUMN cl_sortkey_prefix varchar(255) binary NOT NULL default '', + ADD COLUMN cl_sortkey_prefix varbinary(255) NOT NULL default '', ADD COLUMN cl_collation varbinary(32) NOT NULL default '', ADD COLUMN cl_type ENUM('page', 'subcat', 'file') NOT NULL default 'page', ADD INDEX (cl_collation), diff --git a/maintenance/archives/patch-categorylinks.sql b/maintenance/archives/patch-categorylinks.sql index 02168d7f25..723c65ecfb 100644 --- a/maintenance/archives/patch-categorylinks.sql +++ b/maintenance/archives/patch-categorylinks.sql @@ -10,7 +10,7 @@ CREATE TABLE /*$wgDBprefix*/categorylinks ( -- Name of the category. -- This is also the page_title of the category's description page; -- all such pages are in namespace 14 (NS_CATEGORY). - cl_to varchar(255) binary NOT NULL default '', + cl_to varbinary(255) NOT NULL default '', -- The title of the linking page, or an optional override -- to determine sort order. Sorting is by binary order, which @@ -19,7 +19,7 @@ CREATE TABLE /*$wgDBprefix*/categorylinks ( -- -- Truncate so that the cl_sortkey key fits in 1000 bytes -- (MyISAM 5 with server_character_set=utf8) - cl_sortkey varchar(70) binary NOT NULL default '', + cl_sortkey varbinary(70) NOT NULL default '', -- This isn't really used at present. Provided for an optional -- sorting method by approximate addition time. diff --git a/maintenance/archives/patch-change_tag.sql b/maintenance/archives/patch-change_tag.sql index 030e086b47..4828131b39 100644 --- a/maintenance/archives/patch-change_tag.sql +++ b/maintenance/archives/patch-change_tag.sql @@ -4,7 +4,7 @@ CREATE TABLE /*_*/change_tag ( ct_rc_id int NULL, ct_log_id int NULL, ct_rev_id int NULL, - ct_tag varchar(255) NOT NULL, + ct_tag varbinary(255) NOT NULL, ct_params BLOB NULL ) /*$wgDBTableOptions*/; @@ -28,5 +28,5 @@ CREATE UNIQUE INDEX /*i*/tag_summary_rev_id ON /*_*/tag_summary (ts_rev_id); CREATE TABLE /*_*/valid_tag ( - vt_tag varchar(255) NOT NULL PRIMARY KEY + vt_tag varbinary(255) NOT NULL PRIMARY KEY ) /*$wgDBTableOptions*/; diff --git a/maintenance/archives/patch-external_user.sql b/maintenance/archives/patch-external_user.sql index 176b46d4ad..ed06bf2562 100644 --- a/maintenance/archives/patch-external_user.sql +++ b/maintenance/archives/patch-external_user.sql @@ -3,7 +3,7 @@ CREATE TABLE /*_*/external_user ( eu_local_id int unsigned NOT NULL PRIMARY KEY, -- Some opaque identifier provided by the external database - eu_external_id varchar(255) binary NOT NULL + eu_external_id varbinary(255) NOT NULL ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/eu_external_id ON /*_*/external_user (eu_external_id); diff --git a/maintenance/archives/patch-filearchive.sql b/maintenance/archives/patch-filearchive.sql index 587a2ab4d2..9ffa6f9919 100644 --- a/maintenance/archives/patch-filearchive.sql +++ b/maintenance/archives/patch-filearchive.sql @@ -6,10 +6,10 @@ CREATE TABLE /*$wgDBprefix*/filearchive ( fa_id int not null auto_increment, -- Original base filename; key to image.img_name, page.page_title, etc - fa_name varchar(255) binary NOT NULL default '', + fa_name varbinary(255) NOT NULL default '', -- Filename of archived file, if an old revision - fa_archive_name varchar(255) binary default '', + fa_archive_name varbinary(255) default '', -- Which storage bin (directory tree or object store) the file data -- is stored in. Should be 'deleted' for files that have been deleted; @@ -39,7 +39,7 @@ CREATE TABLE /*$wgDBprefix*/filearchive ( fa_minor_mime varbinary(32) default "unknown", fa_description tinyblob, fa_user int unsigned default '0', - fa_user_text varchar(255) binary default '', + fa_user_text varbinary(255) default '', fa_timestamp binary(14) default '', PRIMARY KEY (fa_id), diff --git a/maintenance/archives/patch-fix-il_from.sql b/maintenance/archives/patch-fix-il_from.sql index 0a199e4d33..4ae30fed83 100644 --- a/maintenance/archives/patch-fix-il_from.sql +++ b/maintenance/archives/patch-fix-il_from.sql @@ -3,7 +3,7 @@ RENAME TABLE /*_*/imagelinks TO /*_*/imagelinks_old; CREATE TABLE /*_*/imagelinks ( il_from int unsigned NOT NULL default 0, - il_to varchar(255) binary NOT NULL default '' + il_to varbinary(255) NOT NULL default '' ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/il_from ON /*_*/imagelinks (il_from,il_to); diff --git a/maintenance/archives/patch-interwiki.sql b/maintenance/archives/patch-interwiki.sql index 321765b934..5808a485f2 100644 --- a/maintenance/archives/patch-interwiki.sql +++ b/maintenance/archives/patch-interwiki.sql @@ -4,7 +4,7 @@ CREATE TABLE /*$wgDBprefix*/interwiki ( -- The interwiki prefix, (e.g. "Meatball", or the language prefix "de") - iw_prefix varchar(32) NOT NULL, + iw_prefix varbinary(32) NOT NULL, -- The URL of the wiki, with "$1" as a placeholder for an article name. -- Any spaces in the name will be transformed to underscores before diff --git a/maintenance/archives/patch-ipb_by_text.sql b/maintenance/archives/patch-ipb_by_text.sql index c0b620d338..246248aa3f 100644 --- a/maintenance/archives/patch-ipb_by_text.sql +++ b/maintenance/archives/patch-ipb_by_text.sql @@ -2,7 +2,7 @@ -- Required for crosswiki blocks. ALTER TABLE /*$wgDBprefix*/ipblocks - ADD ipb_by_text varchar(255) binary NOT NULL default ''; + ADD ipb_by_text varbinary(255) NOT NULL default ''; UPDATE /*$wgDBprefix*/ipblocks JOIN /*$wgDBprefix*/user ON ipb_by = user_id diff --git a/maintenance/archives/patch-iw_api_and_wikiid.sql b/maintenance/archives/patch-iw_api_and_wikiid.sql index 4384a715f5..0c9205c495 100644 --- a/maintenance/archives/patch-iw_api_and_wikiid.sql +++ b/maintenance/archives/patch-iw_api_and_wikiid.sql @@ -5,5 +5,5 @@ ALTER TABLE /*_*/interwiki ADD iw_api BLOB NOT NULL; ALTER TABLE /*_*/interwiki - ADD iw_wikiid varchar(64) NOT NULL; + ADD iw_wikiid varbinary(64) NOT NULL; diff --git a/maintenance/archives/patch-iwlinks.sql b/maintenance/archives/patch-iwlinks.sql index 89b34cb1ab..07e4c825d4 100644 --- a/maintenance/archives/patch-iwlinks.sql +++ b/maintenance/archives/patch-iwlinks.sql @@ -9,7 +9,7 @@ CREATE TABLE /*_*/iwlinks ( iwl_prefix varbinary(20) NOT NULL default '', -- Title of the target, including namespace - iwl_title varchar(255) binary NOT NULL default '' + iwl_title varbinary(255) NOT NULL default '' ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/iwl_from ON /*_*/iwlinks (iwl_from, iwl_prefix, iwl_title); diff --git a/maintenance/archives/patch-job.sql b/maintenance/archives/patch-job.sql index c9199efbca..72d9c6de3f 100644 --- a/maintenance/archives/patch-job.sql +++ b/maintenance/archives/patch-job.sql @@ -9,7 +9,7 @@ CREATE TABLE /*_*/job ( -- Namespace and title to act on -- Should be 0 and '' if the command does not operate on a title job_namespace int NOT NULL, - job_title varchar(255) binary NOT NULL, + job_title varbinary(255) NOT NULL, -- Any other parameters to the command -- Stored as a PHP serialized array, or an empty string if there are no parameters diff --git a/maintenance/archives/patch-l10n_cache.sql b/maintenance/archives/patch-l10n_cache.sql index 4c865d71f0..6f3d20d1ec 100644 --- a/maintenance/archives/patch-l10n_cache.sql +++ b/maintenance/archives/patch-l10n_cache.sql @@ -1,7 +1,7 @@ -- Table for storing localisation data CREATE TABLE /*_*/l10n_cache ( lc_lang varbinary(32) NOT NULL, - lc_key varchar(255) NOT NULL, + lc_key varbinary(255) NOT NULL, lc_value mediumblob NOT NULL ) /*$wgDBTableOptions*/; CREATE INDEX /*i*/lc_lang_key ON /*_*/l10n_cache (lc_lang, lc_key); diff --git a/maintenance/archives/patch-langlinks.sql b/maintenance/archives/patch-langlinks.sql index ffff07c0ae..894f89d8a2 100644 --- a/maintenance/archives/patch-langlinks.sql +++ b/maintenance/archives/patch-langlinks.sql @@ -6,7 +6,7 @@ CREATE TABLE /*$wgDBprefix*/langlinks ( ll_lang varbinary(20) NOT NULL default '', -- Title of the target, including namespace - ll_title varchar(255) binary NOT NULL default '', + ll_title varbinary(255) NOT NULL default '', UNIQUE KEY (ll_from, ll_lang), KEY (ll_lang, ll_title) diff --git a/maintenance/archives/patch-linktables.sql b/maintenance/archives/patch-linktables.sql index b15878c3a7..4825aa7fc8 100644 --- a/maintenance/archives/patch-linktables.sql +++ b/maintenance/archives/patch-linktables.sql @@ -31,7 +31,7 @@ CREATE TABLE /*$wgDBprefix*/brokenlinks ( -- Text of the target page title ("namesapce:title"). -- Unfortunately this doesn't split the namespace index -- key and therefore can't easily be joined to anything. - bl_to varchar(255) binary NOT NULL default '', + bl_to varbinary(255) NOT NULL default '', UNIQUE KEY bl_from(bl_from,bl_to), KEY (bl_to) @@ -50,7 +50,7 @@ CREATE TABLE /*$wgDBprefix*/imagelinks ( -- Filename of target image. -- This is also the page_title of the file's description page; -- all such pages are in namespace 6 (NS_FILE). - il_to varchar(255) binary NOT NULL default '', + il_to varbinary(255) NOT NULL default '', UNIQUE KEY il_from(il_from,il_to), KEY (il_to) diff --git a/maintenance/archives/patch-log_search.sql b/maintenance/archives/patch-log_search.sql index 8d92030b26..008ba9e59d 100644 --- a/maintenance/archives/patch-log_search.sql +++ b/maintenance/archives/patch-log_search.sql @@ -2,7 +2,7 @@ CREATE TABLE /*_*/log_search ( -- The type of ID (rev ID, log ID, rev timestamp, username) ls_field varbinary(32) NOT NULL, -- The value of the ID - ls_value varchar(255) NOT NULL, + ls_value varbinary(255) NOT NULL, -- Key to log_id ls_log_id int unsigned NOT NULL default 0 ) /*$wgDBTableOptions*/; diff --git a/maintenance/archives/patch-log_user_text.sql b/maintenance/archives/patch-log_user_text.sql index 9a783d8791..e50a09e583 100644 --- a/maintenance/archives/patch-log_user_text.sql +++ b/maintenance/archives/patch-log_user_text.sql @@ -1,5 +1,5 @@ ALTER TABLE /*$wgDBprefix*/logging - ADD log_user_text varchar(255) binary NOT NULL default '', + ADD log_user_text varbinary(255) NOT NULL default '', ADD log_page int unsigned NULL, CHANGE log_type log_type varbinary(32) NOT NULL, CHANGE log_action log_action varbinary(32) NOT NULL; diff --git a/maintenance/archives/patch-logging-title.sql b/maintenance/archives/patch-logging-title.sql index c5da0dc046..dc1d6374fa 100644 --- a/maintenance/archives/patch-logging-title.sql +++ b/maintenance/archives/patch-logging-title.sql @@ -3,4 +3,4 @@ ALTER TABLE /*$wgDBprefix*/logging CHANGE COLUMN log_title - log_title varchar(255) binary NOT NULL default ''; + log_title varbinary(255) NOT NULL default ''; diff --git a/maintenance/archives/patch-logging.sql b/maintenance/archives/patch-logging.sql index b5cfdf7299..2976237c97 100644 --- a/maintenance/archives/patch-logging.sql +++ b/maintenance/archives/patch-logging.sql @@ -17,10 +17,10 @@ CREATE TABLE /*$wgDBprefix*/logging ( -- Key to the page affected. Where a user is the target, -- this will point to the user page. log_namespace int NOT NULL default 0, - log_title varchar(255) binary NOT NULL default '', + log_title varbinary(255) NOT NULL default '', -- Freeform text. Interpreted as edit history comments. - log_comment varchar(255) NOT NULL default '', + log_comment varbinary(255) NOT NULL default '', -- LF separated list of miscellaneous parameters log_params blob NOT NULL, diff --git a/maintenance/archives/patch-pagelinks.sql b/maintenance/archives/patch-pagelinks.sql index 118592fb2b..c1c645fa31 100644 --- a/maintenance/archives/patch-pagelinks.sql +++ b/maintenance/archives/patch-pagelinks.sql @@ -25,7 +25,7 @@ CREATE TABLE /*$wgDBprefix*/pagelinks ( -- and deletions may refer to different page records as time -- goes by. pl_namespace int NOT NULL default '0', - pl_title varchar(255) binary NOT NULL default '', + pl_title varbinary(255) NOT NULL default '', UNIQUE KEY pl_from(pl_from,pl_namespace,pl_title), KEY (pl_namespace,pl_title) diff --git a/maintenance/archives/patch-profiling.sql b/maintenance/archives/patch-profiling.sql index e748ca310d..67f5f56a48 100644 --- a/maintenance/archives/patch-profiling.sql +++ b/maintenance/archives/patch-profiling.sql @@ -5,7 +5,7 @@ CREATE TABLE /*$wgDBprefix*/profiling ( pf_count int NOT NULL default 0, pf_time float NOT NULL default 0, pf_memory float NOT NULL default 0, - pf_name varchar(255) NOT NULL default '', - pf_server varchar(30) NOT NULL default '', + pf_name varbinary(255) NOT NULL default '', + pf_server varbinary(30) NOT NULL default '', UNIQUE KEY pf_name_server (pf_name, pf_server) ) ENGINE=HEAP; diff --git a/maintenance/archives/patch-protected_titles.sql b/maintenance/archives/patch-protected_titles.sql index 20b6035d16..98f404748a 100644 --- a/maintenance/archives/patch-protected_titles.sql +++ b/maintenance/archives/patch-protected_titles.sql @@ -1,7 +1,7 @@ -- Protected titles - nonexistent pages that have been protected CREATE TABLE /*$wgDBprefix*/protected_titles ( pt_namespace int NOT NULL, - pt_title varchar(255) binary NOT NULL, + pt_title varbinary(255) NOT NULL, pt_user int unsigned NOT NULL, pt_reason tinyblob, pt_timestamp binary(14) NOT NULL, diff --git a/maintenance/archives/patch-pt_title-encoding.sql b/maintenance/archives/patch-pt_title-encoding.sql index b0a2393208..84d1cb389d 100644 --- a/maintenance/archives/patch-pt_title-encoding.sql +++ b/maintenance/archives/patch-pt_title-encoding.sql @@ -2,4 +2,4 @@ -- This might cause failures with JOINs, and could protect the wrong pages -- with different case variants or unrelated UTF-8 chars. ALTER TABLE /*$wgDBprefix*/protected_titles - CHANGE COLUMN pt_title pt_title varchar(255) binary NOT NULL; + CHANGE COLUMN pt_title pt_title varbinary(255) NOT NULL; diff --git a/maintenance/archives/patch-querycache.sql b/maintenance/archives/patch-querycache.sql index e6da79cc28..81f43c653d 100644 --- a/maintenance/archives/patch-querycache.sql +++ b/maintenance/archives/patch-querycache.sql @@ -9,7 +9,7 @@ CREATE TABLE /*$wgDBprefix*/querycache ( -- Target namespace+title qc_namespace int NOT NULL default '0', - qc_title varchar(255) binary NOT NULL default '', + qc_title varbinary(255) NOT NULL default '', KEY (qc_type,qc_value) diff --git a/maintenance/archives/patch-querycachetwo.sql b/maintenance/archives/patch-querycachetwo.sql index 01623bc717..2869d0c9a6 100644 --- a/maintenance/archives/patch-querycachetwo.sql +++ b/maintenance/archives/patch-querycachetwo.sql @@ -9,11 +9,11 @@ CREATE TABLE /*$wgDBprefix*/querycachetwo ( -- Target namespace+title qcc_namespace int NOT NULL default '0', - qcc_title varchar(255) binary NOT NULL default '', + qcc_title varbinary(255) NOT NULL default '', -- Target namespace+title2 qcc_namespacetwo int NOT NULL default '0', - qcc_titletwo varchar(255) binary NOT NULL default '', + qcc_titletwo varbinary(255) NOT NULL default '', KEY qcc_type (qcc_type,qcc_value), KEY qcc_title (qcc_type,qcc_namespace,qcc_title), diff --git a/maintenance/archives/patch-rc_type.sql b/maintenance/archives/patch-rc_type.sql index f1fb18e593..6dec72c8b2 100644 --- a/maintenance/archives/patch-rc_type.sql +++ b/maintenance/archives/patch-rc_type.sql @@ -3,7 +3,7 @@ ALTER TABLE /*$wgDBprefix*/recentchanges ADD rc_type tinyint unsigned NOT NULL default '0', ADD rc_moved_to_ns tinyint unsigned NOT NULL default '0', - ADD rc_moved_to_title varchar(255) binary NOT NULL default ''; + ADD rc_moved_to_title varbinary(255) NOT NULL default ''; UPDATE /*$wgDBprefix*/recentchanges SET rc_type=1 WHERE rc_new; UPDATE /*$wgDBprefix*/recentchanges SET rc_type=3 WHERE rc_namespace=4 AND (rc_title='Deletion_log' OR rc_title='Upload_log'); diff --git a/maintenance/archives/patch-rd_interwiki.sql b/maintenance/archives/patch-rd_interwiki.sql index a12f1a7d8e..5751122c42 100644 --- a/maintenance/archives/patch-rd_interwiki.sql +++ b/maintenance/archives/patch-rd_interwiki.sql @@ -1,6 +1,6 @@ -- Add interwiki and fragment columns to redirect table ALTER TABLE /*$wgDBprefix*/redirect - ADD rd_interwiki varchar(32) default NULL, - ADD rd_fragment varchar(255) binary default NULL; + ADD rd_interwiki varbinary(32) default NULL, + ADD rd_fragment varbinary(255) default NULL; diff --git a/maintenance/archives/patch-redirect.sql b/maintenance/archives/patch-redirect.sql index 5d7218bc08..3bf3c7a5a5 100644 --- a/maintenance/archives/patch-redirect.sql +++ b/maintenance/archives/patch-redirect.sql @@ -11,7 +11,7 @@ CREATE TABLE /*$wgDBprefix*/redirect ( -- and deletions may refer to different page records as time -- goes by. rd_namespace int NOT NULL default '0', - rd_title varchar(255) binary NOT NULL default '', + rd_title varbinary(255) NOT NULL default '', PRIMARY KEY rd_from (rd_from), KEY rd_ns_title (rd_namespace,rd_title,rd_from) diff --git a/maintenance/archives/patch-restructure.sql b/maintenance/archives/patch-restructure.sql index 7b638483b4..1041fd90ff 100644 --- a/maintenance/archives/patch-restructure.sql +++ b/maintenance/archives/patch-restructure.sql @@ -12,7 +12,7 @@ CREATE TABLE /*$wgDBprefix*/page ( page_id int unsigned NOT NULL auto_increment, page_namespace tinyint NOT NULL, - page_title varchar(255) binary NOT NULL, + page_title varbinary(255) NOT NULL, page_restrictions tinyblob NOT NULL, page_counter bigint unsigned NOT NULL default '0', page_is_redirect tinyint unsigned NOT NULL default '0', @@ -33,7 +33,7 @@ CREATE TABLE /*$wgDBprefix*/revision ( rev_page int unsigned NOT NULL, rev_comment tinyblob NOT NULL, rev_user int unsigned NOT NULL default '0', - rev_user_text varchar(255) binary NOT NULL default '', + rev_user_text varbinary(255) NOT NULL default '', rev_timestamp binary(14) NOT NULL default '', rev_minor_edit tinyint unsigned NOT NULL default '0', rev_deleted tinyint unsigned NOT NULL default '0', diff --git a/maintenance/archives/patch-searchindex.sql b/maintenance/archives/patch-searchindex.sql index 9b635a8fbd..c759e17ada 100644 --- a/maintenance/archives/patch-searchindex.sql +++ b/maintenance/archives/patch-searchindex.sql @@ -12,7 +12,7 @@ CREATE TABLE /*$wgDBprefix*/searchindex ( si_page int unsigned NOT NULL, -- Munged version of title - si_title varchar(255) NOT NULL default '', + si_title varbinary(255) NOT NULL default '', -- Munged version of body text si_text mediumtext NOT NULL, diff --git a/maintenance/archives/patch-templatelinks.sql b/maintenance/archives/patch-templatelinks.sql index a545b34e94..dae6c8aace 100644 --- a/maintenance/archives/patch-templatelinks.sql +++ b/maintenance/archives/patch-templatelinks.sql @@ -10,7 +10,7 @@ CREATE TABLE /*$wgDBprefix*/templatelinks ( -- and deletions may refer to different page records as time -- goes by. tl_namespace int NOT NULL default '0', - tl_title varchar(255) binary NOT NULL default '', + tl_title varbinary(255) NOT NULL default '', UNIQUE KEY tl_from(tl_from,tl_namespace,tl_title), KEY (tl_namespace,tl_title) diff --git a/maintenance/archives/patch-testrun.sql b/maintenance/archives/patch-testrun.sql index 8591d81df4..246dfc9fa7 100644 --- a/maintenance/archives/patch-testrun.sql +++ b/maintenance/archives/patch-testrun.sql @@ -13,7 +13,7 @@ drop table if exists /*$wgDBprefix*/testrun; create table /*$wgDBprefix*/testrun ( tr_id int not null auto_increment, - tr_date char(14) binary, + tr_date binary(14), tr_mw_version blob, tr_php_version blob, tr_db_version blob, @@ -24,7 +24,7 @@ create table /*$wgDBprefix*/testrun ( create table /*$wgDBprefix*/testitem ( ti_run int not null, - ti_name varchar(255), + ti_name varbinary(255), ti_success bool, unique key (ti_run, ti_name), diff --git a/maintenance/archives/patch-updatelog.sql b/maintenance/archives/patch-updatelog.sql index 168ad082eb..87c7c1a175 100644 --- a/maintenance/archives/patch-updatelog.sql +++ b/maintenance/archives/patch-updatelog.sql @@ -1,4 +1,4 @@ CREATE TABLE /*$wgDBprefix*/updatelog ( - ul_key varchar(255) NOT NULL, + ul_key varbinary(255) NOT NULL, PRIMARY KEY (ul_key) ) /*$wgDBTableOptions*/; diff --git a/maintenance/archives/patch-user-realname.sql b/maintenance/archives/patch-user-realname.sql index 96edaa4322..0f226070e5 100644 --- a/maintenance/archives/patch-user-realname.sql +++ b/maintenance/archives/patch-user-realname.sql @@ -2,4 +2,4 @@ -- used for author attribution or other places that real names matter. ALTER TABLE user - ADD (user_real_name varchar(255) binary NOT NULL default ''); + ADD (user_real_name varbinary(255) NOT NULL default ''); diff --git a/maintenance/archives/patch-val_ip.sql b/maintenance/archives/patch-val_ip.sql index 9214218dc5..f8b95c72b8 100644 --- a/maintenance/archives/patch-val_ip.sql +++ b/maintenance/archives/patch-val_ip.sql @@ -1,4 +1,4 @@ -- Column added 2005-05-24 ALTER TABLE /*$wgDBprefix*/validate - ADD COLUMN val_ip varchar(20) NOT NULL default ''; + ADD COLUMN val_ip varbinary(20) NOT NULL default ''; diff --git a/maintenance/archives/patch-validate.sql b/maintenance/archives/patch-validate.sql index 9701083c13..7b8a6966bb 100644 --- a/maintenance/archives/patch-validate.sql +++ b/maintenance/archives/patch-validate.sql @@ -7,7 +7,7 @@ CREATE TABLE /*$wgDBprefix*/validate ( `val_revision` int(11) unsigned NOT NULL default '0', `val_type` int(11) unsigned NOT NULL default '0', `val_value` int(11) default '0', - `val_comment` varchar(255) NOT NULL default '', - `val_ip` varchar(20) NOT NULL default '', + `val_comment` varbinary(255) NOT NULL default '', + `val_ip` varbinary(20) NOT NULL default '', KEY `val_user` (`val_user`,`val_revision`) ) /*$wgDBTableOptions*/; diff --git a/maintenance/archives/patch-watchlist.sql b/maintenance/archives/patch-watchlist.sql index 83826b72ef..475ea0dfe7 100644 --- a/maintenance/archives/patch-watchlist.sql +++ b/maintenance/archives/patch-watchlist.sql @@ -12,7 +12,7 @@ DROP TABLE IF EXISTS watchlist2; CREATE TABLE watchlist2 ( wl_user int unsigned NOT NULL, wl_namespace int unsigned NOT NULL default '0', - wl_title varchar(255) binary NOT NULL default '', + wl_title varbinary(255) NOT NULL default '', UNIQUE KEY (wl_user, wl_namespace, wl_title) ) /*$wgDBTableOptions*/; diff --git a/maintenance/tables.sql b/maintenance/tables.sql index fba27cd734..3d999dc530 100644 --- a/maintenance/tables.sql +++ b/maintenance/tables.sql @@ -58,10 +58,10 @@ CREATE TABLE /*_*/user ( -- conflicts. Spaces are allowed, and are _not_ converted -- to underscores like titles. See the User::newFromName() for -- the specific tests that usernames have to pass. - user_name varchar(255) binary NOT NULL default '', + user_name varbinary(255) NOT NULL default '', -- Optional 'real name' to be displayed in credit listings - user_real_name varchar(255) binary NOT NULL default '', + user_real_name varbinary(255) NOT NULL default '', -- Password hashes, see User::crypt() and User::comparePasswords() -- in User.php for the algorithm @@ -223,7 +223,7 @@ CREATE TABLE /*_*/page ( -- The rest of the title, as text. -- Spaces are transformed into underscores in title storage. - page_title varchar(255) binary NOT NULL, + page_title varbinary(255) NOT NULL, -- Comma-separated set of permission keys indicating who -- can move or edit the page. @@ -290,7 +290,7 @@ CREATE TABLE /*_*/revision ( rev_user int unsigned NOT NULL default 0, -- Text username or IP address of the editor. - rev_user_text varchar(255) binary NOT NULL default '', + rev_user_text varbinary(255) NOT NULL default '', -- Timestamp rev_timestamp binary(14) NOT NULL default '', @@ -360,7 +360,7 @@ CREATE TABLE /*_*/text ( -- CREATE TABLE /*_*/archive ( ar_namespace int NOT NULL default 0, - ar_title varchar(255) binary NOT NULL default '', + ar_title varbinary(255) NOT NULL default '', -- Newly deleted pages will not store text in this table, -- but will reference the separately existing text rows. @@ -373,7 +373,7 @@ CREATE TABLE /*_*/archive ( -- Basic revision stuff... ar_comment tinyblob NOT NULL, ar_user int unsigned NOT NULL default 0, - ar_user_text varchar(255) binary NOT NULL, + ar_user_text varbinary(255) NOT NULL, ar_timestamp binary(14) NOT NULL default '', ar_minor_edit tinyint NOT NULL default 0, @@ -434,7 +434,7 @@ CREATE TABLE /*_*/pagelinks ( -- and deletions may refer to different page records as time -- goes by. pl_namespace int NOT NULL default 0, - pl_title varchar(255) binary NOT NULL default '' + pl_title varbinary(255) NOT NULL default '' ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/pl_from ON /*_*/pagelinks (pl_from,pl_namespace,pl_title); @@ -453,7 +453,7 @@ CREATE TABLE /*_*/templatelinks ( -- and deletions may refer to different page records as time -- goes by. tl_namespace int NOT NULL default 0, - tl_title varchar(255) binary NOT NULL default '' + tl_title varbinary(255) NOT NULL default '' ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/tl_from ON /*_*/templatelinks (tl_from,tl_namespace,tl_title); @@ -472,7 +472,7 @@ CREATE TABLE /*_*/imagelinks ( -- Filename of target image. -- This is also the page_title of the file's description page; -- all such pages are in namespace 6 (NS_FILE). - il_to varchar(255) binary NOT NULL default '' + il_to varbinary(255) NOT NULL default '' ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/il_from ON /*_*/imagelinks (il_from,il_to); @@ -490,7 +490,7 @@ CREATE TABLE /*_*/categorylinks ( -- Name of the category. -- This is also the page_title of the category's description page; -- all such pages are in namespace 14 (NS_CATEGORY). - cl_to varchar(255) binary NOT NULL default '', + cl_to varbinary(255) NOT NULL default '', -- A binary string obtained by applying a sortkey generation algorithm -- (Collation::getSortKey()) to page_title, or cl_sortkey_prefix . "\n" @@ -504,7 +504,7 @@ CREATE TABLE /*_*/categorylinks ( -- collations without reparsing all pages. -- Note: If you change the length of this field, you also need to change -- code in LinksUpdate.php. See bug 25254. - cl_sortkey_prefix varchar(255) binary NOT NULL default '', + cl_sortkey_prefix varbinary(255) NOT NULL default '', -- This isn't really used at present. Provided for an optional -- sorting method by approximate addition time. @@ -549,7 +549,7 @@ CREATE TABLE /*_*/category ( -- Name of the category, in the same form as page_title (with underscores). -- If there is a category page corresponding to this category, by definition, -- it has this name (in the Category namespace). - cat_title varchar(255) binary NOT NULL, + cat_title varbinary(255) NOT NULL, -- The numbers of member pages (including categories and media), subcatego- -- ries, and Image: namespace members, respectively. These are signed to @@ -607,7 +607,7 @@ CREATE TABLE /*_*/external_user ( eu_local_id int unsigned NOT NULL PRIMARY KEY, -- Some opaque identifier provided by the external database - eu_external_id varchar(255) binary NOT NULL + eu_external_id varbinary(255) NOT NULL ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/eu_external_id ON /*_*/external_user (eu_external_id); @@ -624,7 +624,7 @@ CREATE TABLE /*_*/langlinks ( ll_lang varbinary(20) NOT NULL default '', -- Title of the target, including namespace - ll_title varchar(255) binary NOT NULL default '' + ll_title varbinary(255) NOT NULL default '' ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/ll_from ON /*_*/langlinks (ll_from, ll_lang); @@ -642,7 +642,7 @@ CREATE TABLE /*_*/iwlinks ( iwl_prefix varbinary(20) NOT NULL default '', -- Title of the target, including namespace - iwl_title varchar(255) binary NOT NULL default '' + iwl_title varbinary(255) NOT NULL default '' ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/iwl_from ON /*_*/iwlinks (iwl_from, iwl_prefix, iwl_title); @@ -720,7 +720,7 @@ CREATE TABLE /*_*/ipblocks ( ipb_by int unsigned NOT NULL default 0, -- User name of blocker - ipb_by_text varchar(255) binary NOT NULL default '', + ipb_by_text varbinary(255) NOT NULL default '', -- Text comment made by blocker. ipb_reason tinyblob NOT NULL, @@ -780,7 +780,7 @@ CREATE TABLE /*_*/image ( -- Filename. -- This is also the title of the associated description page, -- which will be in namespace 6 (NS_FILE). - img_name varchar(255) binary NOT NULL default '' PRIMARY KEY, + img_name varbinary(255) NOT NULL default '' PRIMARY KEY, -- File size in bytes. img_size int unsigned NOT NULL default 0, @@ -814,7 +814,7 @@ CREATE TABLE /*_*/image ( -- user_id and user_name of uploader. img_user int unsigned NOT NULL default 0, - img_user_text varchar(255) binary NOT NULL, + img_user_text varbinary(255) NOT NULL, -- Time of the upload. img_timestamp varbinary(14) NOT NULL default '', @@ -839,11 +839,11 @@ CREATE INDEX /*i*/img_sha1 ON /*_*/image (img_sha1); -- CREATE TABLE /*_*/oldimage ( -- Base filename: key to image.img_name - oi_name varchar(255) binary NOT NULL default '', + oi_name varbinary(255) NOT NULL default '', -- Filename of the archived file. -- This is generally a timestamp and '!' prepended to the base name. - oi_archive_name varchar(255) binary NOT NULL default '', + oi_archive_name varbinary(255) NOT NULL default '', -- Other fields as in image... oi_size int unsigned NOT NULL default 0, @@ -852,7 +852,7 @@ CREATE TABLE /*_*/oldimage ( oi_bits int NOT NULL default 0, oi_description tinyblob NOT NULL, oi_user int unsigned NOT NULL default 0, - oi_user_text varchar(255) binary NOT NULL, + oi_user_text varbinary(255) NOT NULL, oi_timestamp binary(14) NOT NULL default '', oi_metadata mediumblob NOT NULL, @@ -878,10 +878,10 @@ CREATE TABLE /*_*/filearchive ( fa_id int NOT NULL PRIMARY KEY AUTO_INCREMENT, -- Original base filename; key to image.img_name, page.page_title, etc - fa_name varchar(255) binary NOT NULL default '', + fa_name varbinary(255) NOT NULL default '', -- Filename of archived file, if an old revision - fa_archive_name varchar(255) binary default '', + fa_archive_name varbinary(255) default '', -- Which storage bin (directory tree or object store) the file data -- is stored in. Should be 'deleted' for files that have been deleted; @@ -911,7 +911,7 @@ CREATE TABLE /*_*/filearchive ( fa_minor_mime varbinary(100) default "unknown", fa_description tinyblob, fa_user int unsigned default 0, - fa_user_text varchar(255) binary, + fa_user_text varbinary(255), fa_timestamp binary(14) default '', -- Visibility of deleted revisions, bitfield @@ -940,14 +940,14 @@ CREATE TABLE /*_*/recentchanges ( -- As in revision rc_user int unsigned NOT NULL default 0, - rc_user_text varchar(255) binary NOT NULL, + rc_user_text varbinary(255) NOT NULL, -- When pages are renamed, their RC entries do _not_ change. rc_namespace int NOT NULL default 0, - rc_title varchar(255) binary NOT NULL default '', + rc_title varbinary(255) NOT NULL default '', -- as in revision... - rc_comment varchar(255) binary NOT NULL default '', + rc_comment varbinary(255) NOT NULL default '', rc_minor tinyint unsigned NOT NULL default 0, -- Edits by user accounts with the 'bot' rights key are @@ -971,7 +971,7 @@ CREATE TABLE /*_*/recentchanges ( -- These may no longer be used, with the new move log. rc_type tinyint unsigned NOT NULL default 0, rc_moved_to_ns tinyint unsigned NOT NULL default 0, - rc_moved_to_title varchar(255) binary NOT NULL default '', + rc_moved_to_title varbinary(255) NOT NULL default '', -- If the Recent Changes Patrol option is enabled, -- users may mark edits as having been reviewed to @@ -1018,7 +1018,7 @@ CREATE TABLE /*_*/watchlist ( -- Note that users may watch pages which do not exist yet, -- or existed in the past but have been deleted. wl_namespace int NOT NULL default 0, - wl_title varchar(255) binary NOT NULL default '', + wl_title varbinary(255) NOT NULL default '', -- Timestamp when user was last sent a notification e-mail; -- cleared when the user visits the page. @@ -1068,7 +1068,7 @@ CREATE TABLE /*_*/searchindex ( si_page int unsigned NOT NULL, -- Munged version of title - si_title varchar(255) NOT NULL default '', + si_title varbinary(255) NOT NULL default '', -- Munged version of body text si_text mediumtext NOT NULL @@ -1084,7 +1084,7 @@ CREATE FULLTEXT INDEX /*i*/si_text ON /*_*/searchindex (si_text); -- CREATE TABLE /*_*/interwiki ( -- The interwiki prefix, (e.g. "Meatball", or the language prefix "de") - iw_prefix varchar(32) NOT NULL, + iw_prefix varbinary(32) NOT NULL, -- The URL of the wiki, with "$1" as a placeholder for an article name. -- Any spaces in the name will be transformed to underscores before @@ -1095,7 +1095,7 @@ CREATE TABLE /*_*/interwiki ( iw_api blob NOT NULL, -- The name of the database (for a connection to be established with wfGetLB( 'wikiid' )) - iw_wikiid varchar(64) NOT NULL, + iw_wikiid varbinary(64) NOT NULL, -- A boolean value indicating whether the wiki is in this project -- (used, for example, to detect redirect loops) @@ -1120,7 +1120,7 @@ CREATE TABLE /*_*/querycache ( -- Target namespace+title qc_namespace int NOT NULL default 0, - qc_title varchar(255) binary NOT NULL default '' + qc_title varbinary(255) NOT NULL default '' ) /*$wgDBTableOptions*/; CREATE INDEX /*i*/qc_type ON /*_*/querycache (qc_type,qc_value); @@ -1166,16 +1166,16 @@ CREATE TABLE /*_*/logging ( log_user int unsigned NOT NULL default 0, -- Name of the user who performed this action - log_user_text varchar(255) binary NOT NULL default '', + log_user_text varbinary(255) NOT NULL default '', -- Key to the page affected. Where a user is the target, -- this will point to the user page. log_namespace int NOT NULL default 0, - log_title varchar(255) binary NOT NULL default '', + log_title varbinary(255) NOT NULL default '', log_page int unsigned NULL, -- Freeform text. Interpreted as edit history comments. - log_comment varchar(255) NOT NULL default '', + log_comment varbinary(255) NOT NULL default '', -- LF separated list of miscellaneous parameters log_params blob NOT NULL, @@ -1196,7 +1196,7 @@ CREATE TABLE /*_*/log_search ( -- The type of ID (rev ID, log ID, rev timestamp, username) ls_field varbinary(32) NOT NULL, -- The value of the ID - ls_value varchar(255) NOT NULL, + ls_value varbinary(255) NOT NULL, -- Key to log_id ls_log_id int unsigned NOT NULL default 0 ) /*$wgDBTableOptions*/; @@ -1207,10 +1207,10 @@ CREATE INDEX /*i*/ls_log_id ON /*_*/log_search (ls_log_id); CREATE TABLE /*_*/trackbacks ( tb_id int PRIMARY KEY AUTO_INCREMENT, tb_page int REFERENCES /*_*/page(page_id) ON DELETE CASCADE, - tb_title varchar(255) NOT NULL, + tb_title varbinary(255) NOT NULL, tb_url blob NOT NULL, tb_ex text, - tb_name varchar(255) + tb_name varbinary(255) ) /*$wgDBTableOptions*/; CREATE INDEX /*i*/tb_page ON /*_*/trackbacks (tb_page); @@ -1226,7 +1226,7 @@ CREATE TABLE /*_*/job ( -- Namespace and title to act on -- Should be 0 and '' if the command does not operate on a title job_namespace int NOT NULL, - job_title varchar(255) binary NOT NULL, + job_title varbinary(255) NOT NULL, -- Any other parameters to the command -- Stored as a PHP serialized array, or an empty string if there are no parameters @@ -1259,9 +1259,9 @@ CREATE TABLE /*_*/redirect ( -- and deletions may refer to different page records as time -- goes by. rd_namespace int NOT NULL default 0, - rd_title varchar(255) binary NOT NULL default '', - rd_interwiki varchar(32) default NULL, - rd_fragment varchar(255) binary default NULL + rd_title varbinary(255) NOT NULL default '', + rd_interwiki varbinary(32) default NULL, + rd_fragment varbinary(255) default NULL ) /*$wgDBTableOptions*/; CREATE INDEX /*i*/rd_ns_title ON /*_*/redirect (rd_namespace,rd_title,rd_from); @@ -1277,11 +1277,11 @@ CREATE TABLE /*_*/querycachetwo ( -- Target namespace+title qcc_namespace int NOT NULL default 0, - qcc_title varchar(255) binary NOT NULL default '', + qcc_title varbinary(255) NOT NULL default '', -- Target namespace+title2 qcc_namespacetwo int NOT NULL default 0, - qcc_titletwo varchar(255) binary NOT NULL default '' + qcc_titletwo varbinary(255) NOT NULL default '' ) /*$wgDBTableOptions*/; CREATE INDEX /*i*/qcc_type ON /*_*/querycachetwo (qcc_type,qcc_value); @@ -1316,7 +1316,7 @@ CREATE INDEX /*i*/pr_cascade ON /*_*/page_restrictions (pr_cascade); -- Protected titles - nonexistent pages that have been protected CREATE TABLE /*_*/protected_titles ( pt_namespace int NOT NULL, - pt_title varchar(255) binary NOT NULL, + pt_title varbinary(255) NOT NULL, pt_user int unsigned NOT NULL, pt_reason tinyblob, pt_timestamp binary(14) NOT NULL, @@ -1340,7 +1340,7 @@ CREATE UNIQUE INDEX /*i*/pp_page_propname ON /*_*/page_props (pp_page,pp_propnam -- A table to log updates, one text key row per update. CREATE TABLE /*_*/updatelog ( - ul_key varchar(255) NOT NULL PRIMARY KEY, + ul_key varbinary(255) NOT NULL PRIMARY KEY, ul_value blob ) /*$wgDBTableOptions*/; @@ -1354,7 +1354,7 @@ CREATE TABLE /*_*/change_tag ( -- REVID for the change ct_rev_id int NULL, -- Tag applied - ct_tag varchar(255) NOT NULL, + ct_tag varbinary(255) NOT NULL, -- Parameters for the tag, presently unused ct_params blob NULL ) /*$wgDBTableOptions*/; @@ -1385,7 +1385,7 @@ CREATE UNIQUE INDEX /*i*/tag_summary_rev_id ON /*_*/tag_summary (ts_rev_id); CREATE TABLE /*_*/valid_tag ( - vt_tag varchar(255) NOT NULL PRIMARY KEY + vt_tag varbinary(255) NOT NULL PRIMARY KEY ) /*$wgDBTableOptions*/; -- Table for storing localisation data @@ -1393,7 +1393,7 @@ CREATE TABLE /*_*/l10n_cache ( -- Language code lc_lang varbinary(32) NOT NULL, -- Cache key - lc_key varchar(255) NOT NULL, + lc_key varbinary(255) NOT NULL, -- Value lc_value mediumblob NOT NULL ) /*$wgDBTableOptions*/; -- 2.20.1