1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Hack to ensure that CHAR's created in 5.0 are not converted to VARCHAR even if

the row type is dynamic (For 4.1 tables old 'VARCHAR' fields are converted to
true VARCHAR in the next ALTER TABLE)
      
This ensures that one can use MySQL 5.0 privilege tables with MySQL 4.1.

(Fix imported from main 5.0 tree to 5.0.3 build tree.)
This commit is contained in:
jimw@mysql.com
2005-03-22 21:52:01 +01:00
parent df015d61d6
commit 3ef3c59ed0
11 changed files with 87 additions and 51 deletions

View File

@ -319,19 +319,19 @@ KEY Grantor (Grantor)
CREATE TABLE IF NOT EXISTS help_topic (
help_topic_id int unsigned not null,
name varchar(64) not null,
name char(64) not null,
help_category_id smallint unsigned not null,
description text not null,
example text not null,
url varchar(128) not null,
url char(128) not null,
primary key (help_topic_id), unique index (name)
) CHARACTER SET utf8 comment='help topics';
CREATE TABLE IF NOT EXISTS help_category (
help_category_id smallint unsigned not null,
name varchar(64) not null,
name char(64) not null,
parent_category_id smallint unsigned null,
url varchar(128) not null,
url char(128) not null,
primary key (help_category_id),
unique index (name)
) CHARACTER SET utf8 comment='help categories';
@ -344,7 +344,7 @@ primary key (help_keyword_id, help_topic_id)
CREATE TABLE IF NOT EXISTS help_keyword (
help_keyword_id int unsigned not null,
name varchar(64) not null,
name char(64) not null,
primary key (help_keyword_id),
unique index (name)
) CHARACTER SET utf8 comment='help keywords';
@ -491,3 +491,35 @@ ALTER TABLE proc MODIFY name char(64) DEFAULT '' NOT NULL,
'NO_AUTO_CREATE_USER',
'HIGH_NOT_PRECEDENCE'
) DEFAULT 0 NOT NULL;
#
# Change all varchar fields in privilege tables to CHAR, to ensure that
# we can use the privilege tables in MySQL 4.1
# Note that for this hack to work, we must change all CHAR() columns at
# the same time
#
ALTER TABLE mysql.user
modify Host char(60) binary DEFAULT '' NOT NULL,
modify User char(16) binary DEFAULT '' NOT NULL,
modify Password char(41) binary DEFAULT '' NOT NULL;
ALTER TABLE mysql.db
modify Host char(60) binary DEFAULT '' NOT NULL,
modify Db char(64) binary DEFAULT '' NOT NULL,
modify User char(16) binary DEFAULT '' NOT NULL;
ALTER TABLE mysql.host
modify Host char(60) binary DEFAULT '' NOT NULL,
modify Db char(64) binary DEFAULT '' NOT NULL;
ALTER TABLE help_topic
modify name char(64) not null,
modify url char(128) not null;
ALTER TABLE help_category
modify name char(64) not null,
modify url char(128) not null;
ALTER TABLE help_keyword
modify name char(64) not null;