Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
c4187750
Commit
c4187750
authored
Feb 10, 2005
by
jimw@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix all of the enum and set columns in privilege tables to be
case-insensitive. (Bug #7989)
parent
3d265e97
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
224 additions
and
156 deletions
+224
-156
mysql-test/r/system_mysql_db.result
mysql-test/r/system_mysql_db.result
+50
-50
scripts/mysql_create_system_tables.sh
scripts/mysql_create_system_tables.sh
+51
-51
scripts/mysql_fix_privilege_tables.sql
scripts/mysql_fix_privilege_tables.sql
+123
-55
No files found.
mysql-test/r/system_mysql_db.result
View file @
c4187750
...
@@ -21,18 +21,18 @@ db CREATE TABLE `db` (
...
@@ -21,18 +21,18 @@ db CREATE TABLE `db` (
`Host` char(60) collate utf8_bin NOT NULL default '',
`Host` char(60) collate utf8_bin NOT NULL default '',
`Db` char(64) collate utf8_bin NOT NULL default '',
`Db` char(64) collate utf8_bin NOT NULL default '',
`User` char(16) collate utf8_bin NOT NULL default '',
`User` char(16) collate utf8_bin NOT NULL default '',
`Select_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Select_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Insert_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Insert_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Update_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Update_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Delete_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Delete_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Create_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Create_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Drop_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Drop_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Grant_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Grant_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`References_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`References_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Index_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Index_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Alter_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Alter_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Create_tmp_table_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Create_tmp_table_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Lock_tables_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Lock_tables_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
PRIMARY KEY (`Host`,`Db`,`User`),
PRIMARY KEY (`Host`,`Db`,`User`),
KEY `User` (`User`)
KEY `User` (`User`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Database privileges'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Database privileges'
...
@@ -41,18 +41,18 @@ Table Create Table
...
@@ -41,18 +41,18 @@ Table Create Table
host CREATE TABLE `host` (
host CREATE TABLE `host` (
`Host` char(60) collate utf8_bin NOT NULL default '',
`Host` char(60) collate utf8_bin NOT NULL default '',
`Db` char(64) collate utf8_bin NOT NULL default '',
`Db` char(64) collate utf8_bin NOT NULL default '',
`Select_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Select_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Insert_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Insert_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Update_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Update_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Delete_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Delete_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Create_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Create_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Drop_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Drop_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Grant_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Grant_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`References_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`References_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Index_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Index_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Alter_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Alter_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Create_tmp_table_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Create_tmp_table_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Lock_tables_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Lock_tables_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
PRIMARY KEY (`Host`,`Db`)
PRIMARY KEY (`Host`,`Db`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Host privileges; Merged with database privileges'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Host privileges; Merged with database privileges'
show create table user;
show create table user;
...
@@ -61,28 +61,28 @@ user CREATE TABLE `user` (
...
@@ -61,28 +61,28 @@ user CREATE TABLE `user` (
`Host` varchar(60) collate utf8_bin NOT NULL default '',
`Host` varchar(60) collate utf8_bin NOT NULL default '',
`User` varchar(16) collate utf8_bin NOT NULL default '',
`User` varchar(16) collate utf8_bin NOT NULL default '',
`Password` varchar(41) collate utf8_bin NOT NULL default '',
`Password` varchar(41) collate utf8_bin NOT NULL default '',
`Select_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Select_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Insert_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Insert_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Update_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Update_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Delete_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Delete_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Create_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Create_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Drop_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Drop_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Reload_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Reload_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Shutdown_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Shutdown_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Process_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Process_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`File_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`File_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Grant_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Grant_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`References_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`References_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Index_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Index_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Alter_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Alter_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Show_db_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Show_db_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Super_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Super_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Create_tmp_table_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Create_tmp_table_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Lock_tables_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Lock_tables_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Execute_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Execute_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Repl_slave_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Repl_slave_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`Repl_client_priv` enum('N','Y') c
ollate utf8_bin
NOT NULL default 'N',
`Repl_client_priv` enum('N','Y') c
haracter set utf8
NOT NULL default 'N',
`ssl_type` enum('','ANY','X509','SPECIFIED') c
ollate utf8_bin
NOT NULL default '',
`ssl_type` enum('','ANY','X509','SPECIFIED') c
haracter set utf8
NOT NULL default '',
`ssl_cipher` blob NOT NULL,
`ssl_cipher` blob NOT NULL,
`x509_issuer` blob NOT NULL,
`x509_issuer` blob NOT NULL,
`x509_subject` blob NOT NULL,
`x509_subject` blob NOT NULL,
...
@@ -97,7 +97,7 @@ func CREATE TABLE `func` (
...
@@ -97,7 +97,7 @@ func CREATE TABLE `func` (
`name` char(64) collate utf8_bin NOT NULL default '',
`name` char(64) collate utf8_bin NOT NULL default '',
`ret` tinyint(1) NOT NULL default '0',
`ret` tinyint(1) NOT NULL default '0',
`dl` char(128) collate utf8_bin NOT NULL default '',
`dl` char(128) collate utf8_bin NOT NULL default '',
`type` enum('function','aggregate') c
ollate utf8_bin
NOT NULL default 'function',
`type` enum('function','aggregate') c
haracter set utf8
NOT NULL default 'function',
PRIMARY KEY (`name`)
PRIMARY KEY (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='User defined functions'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='User defined functions'
show create table tables_priv;
show create table tables_priv;
...
@@ -109,8 +109,8 @@ tables_priv CREATE TABLE `tables_priv` (
...
@@ -109,8 +109,8 @@ tables_priv CREATE TABLE `tables_priv` (
`Table_name` char(64) collate utf8_bin NOT NULL default '',
`Table_name` char(64) collate utf8_bin NOT NULL default '',
`Grantor` char(77) collate utf8_bin NOT NULL default '',
`Grantor` char(77) collate utf8_bin NOT NULL default '',
`Timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`Timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') c
ollate utf8_bin
NOT NULL default '',
`Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') c
haracter set utf8
NOT NULL default '',
`Column_priv` set('Select','Insert','Update','References') c
ollate utf8_bin
NOT NULL default '',
`Column_priv` set('Select','Insert','Update','References') c
haracter set utf8
NOT NULL default '',
PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`),
PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`),
KEY `Grantor` (`Grantor`)
KEY `Grantor` (`Grantor`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Table privileges'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Table privileges'
...
@@ -123,7 +123,7 @@ columns_priv CREATE TABLE `columns_priv` (
...
@@ -123,7 +123,7 @@ columns_priv CREATE TABLE `columns_priv` (
`Table_name` char(64) collate utf8_bin NOT NULL default '',
`Table_name` char(64) collate utf8_bin NOT NULL default '',
`Column_name` char(64) collate utf8_bin NOT NULL default '',
`Column_name` char(64) collate utf8_bin NOT NULL default '',
`Timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`Timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`Column_priv` set('Select','Insert','Update','References') c
ollate utf8_bin
NOT NULL default '',
`Column_priv` set('Select','Insert','Update','References') c
haracter set utf8
NOT NULL default '',
PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`,`Column_name`)
PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`,`Column_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Column privileges'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Column privileges'
show tables;
show tables;
...
...
scripts/mysql_create_system_tables.sh
View file @
c4187750
...
@@ -54,18 +54,18 @@ then
...
@@ -54,18 +54,18 @@ then
c_d
=
"
$c_d
Host char(60) binary DEFAULT '' NOT NULL,"
c_d
=
"
$c_d
Host char(60) binary DEFAULT '' NOT NULL,"
c_d
=
"
$c_d
Db char(64) binary DEFAULT '' NOT NULL,"
c_d
=
"
$c_d
Db char(64) binary DEFAULT '' NOT NULL,"
c_d
=
"
$c_d
User char(16) binary DEFAULT '' NOT NULL,"
c_d
=
"
$c_d
User char(16) binary DEFAULT '' NOT NULL,"
c_d
=
"
$c_d
Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_d
=
"
$c_d
Select_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_d
=
"
$c_d
Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_d
=
"
$c_d
Insert_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_d
=
"
$c_d
Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_d
=
"
$c_d
Update_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_d
=
"
$c_d
Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_d
=
"
$c_d
Delete_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_d
=
"
$c_d
Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_d
=
"
$c_d
Create_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_d
=
"
$c_d
Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_d
=
"
$c_d
Drop_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_d
=
"
$c_d
Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_d
=
"
$c_d
Grant_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_d
=
"
$c_d
References_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_d
=
"
$c_d
References_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_d
=
"
$c_d
Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_d
=
"
$c_d
Index_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_d
=
"
$c_d
Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_d
=
"
$c_d
Alter_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_d
=
"
$c_d
Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_d
=
"
$c_d
Create_tmp_table_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_d
=
"
$c_d
Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_d
=
"
$c_d
Lock_tables_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_d
=
"
$c_d
PRIMARY KEY Host (Host,Db,User),"
c_d
=
"
$c_d
PRIMARY KEY Host (Host,Db,User),"
c_d
=
"
$c_d
KEY User (User)"
c_d
=
"
$c_d
KEY User (User)"
c_d
=
"
$c_d
) engine=MyISAM"
c_d
=
"
$c_d
) engine=MyISAM"
...
@@ -85,18 +85,18 @@ then
...
@@ -85,18 +85,18 @@ then
c_h
=
"
$c_h
CREATE TABLE host ("
c_h
=
"
$c_h
CREATE TABLE host ("
c_h
=
"
$c_h
Host char(60) binary DEFAULT '' NOT NULL,"
c_h
=
"
$c_h
Host char(60) binary DEFAULT '' NOT NULL,"
c_h
=
"
$c_h
Db char(64) binary DEFAULT '' NOT NULL,"
c_h
=
"
$c_h
Db char(64) binary DEFAULT '' NOT NULL,"
c_h
=
"
$c_h
Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_h
=
"
$c_h
Select_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_h
=
"
$c_h
Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_h
=
"
$c_h
Insert_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_h
=
"
$c_h
Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_h
=
"
$c_h
Update_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_h
=
"
$c_h
Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_h
=
"
$c_h
Delete_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_h
=
"
$c_h
Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_h
=
"
$c_h
Create_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_h
=
"
$c_h
Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_h
=
"
$c_h
Drop_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_h
=
"
$c_h
Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_h
=
"
$c_h
Grant_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_h
=
"
$c_h
References_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_h
=
"
$c_h
References_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_h
=
"
$c_h
Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_h
=
"
$c_h
Index_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_h
=
"
$c_h
Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_h
=
"
$c_h
Alter_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_h
=
"
$c_h
Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_h
=
"
$c_h
Create_tmp_table_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_h
=
"
$c_h
Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_h
=
"
$c_h
Lock_tables_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_h
=
"
$c_h
PRIMARY KEY Host (Host,Db)"
c_h
=
"
$c_h
PRIMARY KEY Host (Host,Db)"
c_h
=
"
$c_h
) engine=MyISAM"
c_h
=
"
$c_h
) engine=MyISAM"
c_h
=
"
$c_h
CHARACTER SET utf8 COLLATE utf8_bin"
c_h
=
"
$c_h
CHARACTER SET utf8 COLLATE utf8_bin"
...
@@ -113,28 +113,28 @@ then
...
@@ -113,28 +113,28 @@ then
c_u
=
"
$c_u
Host char(60) binary DEFAULT '' NOT NULL,"
c_u
=
"
$c_u
Host char(60) binary DEFAULT '' NOT NULL,"
c_u
=
"
$c_u
User char(16) binary DEFAULT '' NOT NULL,"
c_u
=
"
$c_u
User char(16) binary DEFAULT '' NOT NULL,"
c_u
=
"
$c_u
Password char(41) binary DEFAULT '' NOT NULL,"
c_u
=
"
$c_u
Password char(41) binary DEFAULT '' NOT NULL,"
c_u
=
"
$c_u
Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Select_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Insert_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Update_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Delete_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Create_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Drop_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Reload_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Shutdown_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Process_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Process_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
File_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
File_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Grant_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
References_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
References_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Index_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Alter_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Show_db_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Super_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Super_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Create_tmp_table_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Lock_tables_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Execute_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Repl_slave_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
Repl_client_priv enum('N','Y')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_u
=
"
$c_u
ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL,"
c_u
=
"
$c_u
ssl_type enum('','ANY','X509', 'SPECIFIED')
COLLATE utf8_general_ci
DEFAULT '' NOT NULL,"
c_u
=
"
$c_u
ssl_cipher BLOB NOT NULL,"
c_u
=
"
$c_u
ssl_cipher BLOB NOT NULL,"
c_u
=
"
$c_u
x509_issuer BLOB NOT NULL,"
c_u
=
"
$c_u
x509_issuer BLOB NOT NULL,"
c_u
=
"
$c_u
x509_subject BLOB NOT NULL,"
c_u
=
"
$c_u
x509_subject BLOB NOT NULL,"
...
@@ -180,7 +180,7 @@ then
...
@@ -180,7 +180,7 @@ then
c_f
=
"
$c_f
name char(64) binary DEFAULT '' NOT NULL,"
c_f
=
"
$c_f
name char(64) binary DEFAULT '' NOT NULL,"
c_f
=
"
$c_f
ret tinyint(1) DEFAULT '0' NOT NULL,"
c_f
=
"
$c_f
ret tinyint(1) DEFAULT '0' NOT NULL,"
c_f
=
"
$c_f
dl char(128) DEFAULT '' NOT NULL,"
c_f
=
"
$c_f
dl char(128) DEFAULT '' NOT NULL,"
c_f
=
"
$c_f
type enum ('function','aggregate') NOT NULL,"
c_f
=
"
$c_f
type enum ('function','aggregate')
COLLATE utf8_general_ci
NOT NULL,"
c_f
=
"
$c_f
PRIMARY KEY (name)"
c_f
=
"
$c_f
PRIMARY KEY (name)"
c_f
=
"
$c_f
) engine=MyISAM"
c_f
=
"
$c_f
) engine=MyISAM"
c_f
=
"
$c_f
CHARACTER SET utf8 COLLATE utf8_bin"
c_f
=
"
$c_f
CHARACTER SET utf8 COLLATE utf8_bin"
...
@@ -200,8 +200,8 @@ then
...
@@ -200,8 +200,8 @@ then
c_t
=
"
$c_t
Table_name char(64) binary DEFAULT '' NOT NULL,"
c_t
=
"
$c_t
Table_name char(64) binary DEFAULT '' NOT NULL,"
c_t
=
"
$c_t
Grantor char(77) DEFAULT '' NOT NULL,"
c_t
=
"
$c_t
Grantor char(77) DEFAULT '' NOT NULL,"
c_t
=
"
$c_t
Timestamp timestamp(14),"
c_t
=
"
$c_t
Timestamp timestamp(14),"
c_t
=
"
$c_t
Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL,"
c_t
=
"
$c_t
Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter')
COLLATE utf8_general_ci
DEFAULT '' NOT NULL,"
c_t
=
"
$c_t
Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL,"
c_t
=
"
$c_t
Column_priv set('Select','Insert','Update','References')
COLLATE utf8_general_ci
DEFAULT '' NOT NULL,"
c_t
=
"
$c_t
PRIMARY KEY (Host,Db,User,Table_name),"
c_t
=
"
$c_t
PRIMARY KEY (Host,Db,User,Table_name),"
c_t
=
"
$c_t
KEY Grantor (Grantor)"
c_t
=
"
$c_t
KEY Grantor (Grantor)"
c_t
=
"
$c_t
) engine=MyISAM"
c_t
=
"
$c_t
) engine=MyISAM"
...
@@ -222,7 +222,7 @@ then
...
@@ -222,7 +222,7 @@ then
c_c
=
"
$c_c
Table_name char(64) binary DEFAULT '' NOT NULL,"
c_c
=
"
$c_c
Table_name char(64) binary DEFAULT '' NOT NULL,"
c_c
=
"
$c_c
Column_name char(64) binary DEFAULT '' NOT NULL,"
c_c
=
"
$c_c
Column_name char(64) binary DEFAULT '' NOT NULL,"
c_c
=
"
$c_c
Timestamp timestamp(14),"
c_c
=
"
$c_c
Timestamp timestamp(14),"
c_c
=
"
$c_c
Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL,"
c_c
=
"
$c_c
Column_priv set('Select','Insert','Update','References')
COLLATE utf8_general_ci
DEFAULT '' NOT NULL,"
c_c
=
"
$c_c
PRIMARY KEY (Host,Db,User,Table_name,Column_name)"
c_c
=
"
$c_c
PRIMARY KEY (Host,Db,User,Table_name,Column_name)"
c_c
=
"
$c_c
) engine=MyISAM"
c_c
=
"
$c_c
) engine=MyISAM"
c_c
=
"
$c_c
CHARACTER SET utf8 COLLATE utf8_bin"
c_c
=
"
$c_c
CHARACTER SET utf8 COLLATE utf8_bin"
...
@@ -330,7 +330,7 @@ then
...
@@ -330,7 +330,7 @@ then
c_tz
=
"
$c_tz
CREATE TABLE time_zone ("
c_tz
=
"
$c_tz
CREATE TABLE time_zone ("
c_tz
=
"
$c_tz
Time_zone_id int unsigned NOT NULL auto_increment,"
c_tz
=
"
$c_tz
Time_zone_id int unsigned NOT NULL auto_increment,"
c_tz
=
"
$c_tz
Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL,"
c_tz
=
"
$c_tz
Use_leap_seconds enum('Y','N')
COLLATE utf8_general_ci
DEFAULT 'N' NOT NULL,"
c_tz
=
"
$c_tz
PRIMARY KEY TzId (Time_zone_id)"
c_tz
=
"
$c_tz
PRIMARY KEY TzId (Time_zone_id)"
c_tz
=
"
$c_tz
) engine=MyISAM CHARACTER SET utf8"
c_tz
=
"
$c_tz
) engine=MyISAM CHARACTER SET utf8"
c_tz
=
"
$c_tz
comment='Time zones';"
c_tz
=
"
$c_tz
comment='Time zones';"
...
...
scripts/mysql_fix_privilege_tables.sql
View file @
c4187750
...
@@ -9,54 +9,23 @@
...
@@ -9,54 +9,23 @@
-- this sql script.
-- this sql script.
-- On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql'
-- On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql'
-- Convert all tables to UTF-8 with binary collation
-- and reset all char columns to correct width
ALTER
TABLE
user
MODIFY
Host
char
(
60
)
NOT
NULL
default
''
,
MODIFY
User
char
(
16
)
NOT
NULL
default
''
,
MODIFY
Password
char
(
41
)
NOT
NULL
default
''
,
ENGINE
=
MyISAM
,
CONVERT
TO
CHARACTER
SET
utf8
COLLATE
utf8_bin
;
ALTER
TABLE
db
MODIFY
Host
char
(
60
)
NOT
NULL
default
''
,
MODIFY
Db
char
(
64
)
NOT
NULL
default
''
,
MODIFY
User
char
(
16
)
NOT
NULL
default
''
,
ENGINE
=
MyISAM
,
CONVERT
TO
CHARACTER
SET
utf8
COLLATE
utf8_bin
;
ALTER
TABLE
host
MODIFY
Host
char
(
60
)
NOT
NULL
default
''
,
MODIFY
Db
char
(
64
)
NOT
NULL
default
''
,
ENGINE
=
MyISAM
,
CONVERT
TO
CHARACTER
SET
utf8
COLLATE
utf8_bin
;
ALTER
TABLE
func
ENGINE
=
MyISAM
,
CONVERT
TO
CHARACTER
SET
utf8
COLLATE
utf8_bin
;
ALTER
TABLE
columns_priv
MODIFY
Host
char
(
60
)
NOT
NULL
default
''
,
MODIFY
Db
char
(
64
)
NOT
NULL
default
''
,
MODIFY
User
char
(
16
)
NOT
NULL
default
''
,
MODIFY
Table_name
char
(
64
)
NOT
NULL
default
''
,
MODIFY
Column_name
char
(
64
)
NOT
NULL
default
''
,
ENGINE
=
MyISAM
,
CONVERT
TO
CHARACTER
SET
utf8
COLLATE
utf8_bin
;
ALTER
TABLE
tables_priv
MODIFY
Host
char
(
60
)
NOT
NULL
default
''
,
MODIFY
Db
char
(
64
)
NOT
NULL
default
''
,
MODIFY
User
char
(
16
)
NOT
NULL
default
''
,
MODIFY
Table_name
char
(
64
)
NOT
NULL
default
''
,
MODIFY
Grantor
char
(
77
)
NOT
NULL
default
''
,
ENGINE
=
MyISAM
,
CONVERT
TO
CHARACTER
SET
utf8
COLLATE
utf8_bin
;
ALTER
TABLE
user
add
File_priv
enum
(
'N'
,
'Y'
)
NOT
NULL
;
CREATE
TABLE
IF
NOT
EXISTS
func
(
CREATE
TABLE
IF
NOT
EXISTS
func
(
name
char
(
64
)
binary
DEFAULT
''
NOT
NULL
,
name
char
(
64
)
binary
DEFAULT
''
NOT
NULL
,
ret
tinyint
(
1
)
DEFAULT
'0'
NOT
NULL
,
ret
tinyint
(
1
)
DEFAULT
'0'
NOT
NULL
,
dl
char
(
128
)
DEFAULT
''
NOT
NULL
,
dl
char
(
128
)
DEFAULT
''
NOT
NULL
,
type
enum
(
'function'
,
'aggregate'
)
NOT
NULL
,
type
enum
(
'function'
,
'aggregate'
)
COLLATE
utf8_general_ci
NOT
NULL
,
PRIMARY
KEY
(
name
)
PRIMARY
KEY
(
name
)
)
CHARACTER
SET
utf8
COLLATE
utf8_bin
;
)
CHARACTER
SET
utf8
COLLATE
utf8_bin
;
ALTER
TABLE
user
add
File_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
NOT
NULL
;
-- Detect whether or not we had the Grant_priv column
-- Detect whether or not we had the Grant_priv column
SET
@
hadGrantPriv
:
=
0
;
SET
@
hadGrantPriv
:
=
0
;
SELECT
@
hadGrantPriv
:
=
1
FROM
user
WHERE
Grant_priv
LIKE
'%'
;
SELECT
@
hadGrantPriv
:
=
1
FROM
user
WHERE
Grant_priv
LIKE
'%'
;
ALTER
TABLE
user
add
Grant_priv
enum
(
'N'
,
'Y'
)
NOT
NULL
,
add
References_priv
enum
(
'N'
,
'Y'
)
NOT
NULL
,
add
Index_priv
enum
(
'N'
,
'Y'
)
NOT
NULL
,
add
Alter_priv
enum
(
'N'
,
'Y'
)
NOT
NULL
;
ALTER
TABLE
user
add
Grant_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
NOT
NULL
,
add
References_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
NOT
NULL
,
add
Index_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
NOT
NULL
,
add
Alter_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
NOT
NULL
;
ALTER
TABLE
host
add
Grant_priv
enum
(
'N'
,
'Y'
)
NOT
NULL
,
add
References_priv
enum
(
'N'
,
'Y'
)
NOT
NULL
,
add
Index_priv
enum
(
'N'
,
'Y'
)
NOT
NULL
,
add
Alter_priv
enum
(
'N'
,
'Y'
)
NOT
NULL
;
ALTER
TABLE
host
add
Grant_priv
enum
(
'N'
,
'Y'
)
NOT
NULL
,
add
References_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
NOT
NULL
,
add
Index_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
NOT
NULL
,
add
Alter_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
NOT
NULL
;
ALTER
TABLE
db
add
Grant_priv
enum
(
'N'
,
'Y'
)
NOT
NULL
,
add
References_priv
enum
(
'N'
,
'Y'
)
NOT
NULL
,
add
Index_priv
enum
(
'N'
,
'Y'
)
NOT
NULL
,
add
Alter_priv
enum
(
'N'
,
'Y'
)
NOT
NULL
;
ALTER
TABLE
db
add
Grant_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
NOT
NULL
,
add
References_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
NOT
NULL
,
add
Index_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
NOT
NULL
,
add
Alter_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
NOT
NULL
;
--- Fix privileges for old tables
--- Fix privileges for old tables
UPDATE
user
SET
Grant_priv
=
File_priv
,
References_priv
=
Create_priv
,
Index_priv
=
Create_priv
,
Alter_priv
=
Create_priv
WHERE
@
hadGrantPriv
=
0
;
UPDATE
user
SET
Grant_priv
=
File_priv
,
References_priv
=
Create_priv
,
Index_priv
=
Create_priv
,
Alter_priv
=
Create_priv
WHERE
@
hadGrantPriv
=
0
;
...
@@ -68,7 +37,7 @@ UPDATE host SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Cr
...
@@ -68,7 +37,7 @@ UPDATE host SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Cr
-- Adding columns needed by GRANT .. REQUIRE (openssl)"
-- Adding columns needed by GRANT .. REQUIRE (openssl)"
ALTER
TABLE
user
ALTER
TABLE
user
ADD
ssl_type
enum
(
''
,
'ANY'
,
'X509'
,
'SPECIFIED'
)
NOT
NULL
,
ADD
ssl_type
enum
(
''
,
'ANY'
,
'X509'
,
'SPECIFIED'
)
COLLATE
utf8_general_ci
NOT
NULL
,
ADD
ssl_cipher
BLOB
NOT
NULL
,
ADD
ssl_cipher
BLOB
NOT
NULL
,
ADD
x509_issuer
BLOB
NOT
NULL
,
ADD
x509_issuer
BLOB
NOT
NULL
,
ADD
x509_subject
BLOB
NOT
NULL
;
ADD
x509_subject
BLOB
NOT
NULL
;
...
@@ -85,10 +54,14 @@ CREATE TABLE IF NOT EXISTS tables_priv (
...
@@ -85,10 +54,14 @@ CREATE TABLE IF NOT EXISTS tables_priv (
Table_name
char
(
64
)
binary
DEFAULT
''
NOT
NULL
,
Table_name
char
(
64
)
binary
DEFAULT
''
NOT
NULL
,
Grantor
char
(
77
)
DEFAULT
''
NOT
NULL
,
Grantor
char
(
77
)
DEFAULT
''
NOT
NULL
,
Timestamp
timestamp
(
14
),
Timestamp
timestamp
(
14
),
Table_priv
set
(
'Select'
,
'Insert'
,
'Update'
,
'Delete'
,
'Create'
,
'Drop'
,
'Grant'
,
'References'
,
'Index'
,
'Alter'
)
DEFAULT
''
NOT
NULL
,
Table_priv
set
(
'Select'
,
'Insert'
,
'Update'
,
'Delete'
,
'Create'
,
'Drop'
,
'Grant'
,
'References'
,
'Index'
,
'Alter'
)
COLLATE
utf8_general_ci
DEFAULT
''
NOT
NULL
,
Column_priv
set
(
'Select'
,
'Insert'
,
'Update'
,
'References'
)
DEFAULT
''
NOT
NULL
,
Column_priv
set
(
'Select'
,
'Insert'
,
'Update'
,
'References'
)
COLLATE
utf8_general_ci
DEFAULT
''
NOT
NULL
,
PRIMARY
KEY
(
Host
,
Db
,
User
,
Table_name
)
PRIMARY
KEY
(
Host
,
Db
,
User
,
Table_name
)
)
CHARACTER
SET
utf8
COLLATE
utf8_bin
;
)
CHARACTER
SET
utf8
COLLATE
utf8_bin
;
-- Fix collation of set fields
ALTER
TABLE
tables_priv
modify
Table_priv
set
(
'Select'
,
'Insert'
,
'Update'
,
'Delete'
,
'Create'
,
'Drop'
,
'Grant'
,
'References'
,
'Index'
,
'Alter'
)
COLLATE
utf8_general_ci
DEFAULT
''
NOT
NULL
,
modify
Column_priv
set
(
'Select'
,
'Insert'
,
'Update'
,
'References'
)
COLLATE
utf8_general_ci
DEFAULT
''
NOT
NULL
;
CREATE
TABLE
IF
NOT
EXISTS
columns_priv
(
CREATE
TABLE
IF
NOT
EXISTS
columns_priv
(
Host
char
(
60
)
DEFAULT
''
NOT
NULL
,
Host
char
(
60
)
DEFAULT
''
NOT
NULL
,
...
@@ -97,22 +70,25 @@ CREATE TABLE IF NOT EXISTS columns_priv (
...
@@ -97,22 +70,25 @@ CREATE TABLE IF NOT EXISTS columns_priv (
Table_name
char
(
60
)
DEFAULT
''
NOT
NULL
,
Table_name
char
(
60
)
DEFAULT
''
NOT
NULL
,
Column_name
char
(
59
)
DEFAULT
''
NOT
NULL
,
Column_name
char
(
59
)
DEFAULT
''
NOT
NULL
,
Timestamp
timestamp
(
14
),
Timestamp
timestamp
(
14
),
Column_priv
set
(
'Select'
,
'Insert'
,
'Update'
,
'References'
)
DEFAULT
''
NOT
NULL
,
Column_priv
set
(
'Select'
,
'Insert'
,
'Update'
,
'References'
)
COLLATE
utf8_general_ci
DEFAULT
''
NOT
NULL
,
PRIMARY
KEY
(
Host
,
Db
,
User
,
Table_name
,
Column_name
)
PRIMARY
KEY
(
Host
,
Db
,
User
,
Table_name
,
Column_name
)
)
CHARACTER
SET
utf8
COLLATE
utf8_bin
;
)
CHARACTER
SET
utf8
COLLATE
utf8_bin
;
-- Fix collation of set fields
ALTER
TABLE
columns_priv
MODIFY
Column_priv
set
(
'Select'
,
'Insert'
,
'Update'
,
'References'
)
COLLATE
utf8_general_ci
DEFAULT
''
NOT
NULL
;
--
--
-- Name change of Type -> Column_priv from MySQL 3.22.12
-- Name change of Type -> Column_priv from MySQL 3.22.12
--
--
ALTER
TABLE
columns_priv
change
Type
Column_priv
set
(
'Select'
,
'Insert'
,
'Update'
,
'References'
)
DEFAULT
''
NOT
NULL
;
ALTER
TABLE
columns_priv
change
Type
Column_priv
set
(
'Select'
,
'Insert'
,
'Update'
,
'References'
)
COLLATE
utf8_general_ci
DEFAULT
''
NOT
NULL
;
--
--
-- Add the new 'type' column to the func table.
-- Add the new 'type' column to the func table.
--
--
ALTER
TABLE
func
add
type
enum
(
'function'
,
'aggregate'
)
NOT
NULL
;
ALTER
TABLE
func
add
type
enum
(
'function'
,
'aggregate'
)
COLLATE
utf8_general_ci
NOT
NULL
;
--
--
-- Change the user,db and host tables to MySQL 4.0 format
-- Change the user,db and host tables to MySQL 4.0 format
...
@@ -123,13 +99,13 @@ SET @hadShowDbPriv:=0;
...
@@ -123,13 +99,13 @@ SET @hadShowDbPriv:=0;
SELECT
@
hadShowDbPriv
:
=
1
FROM
user
WHERE
Show_db_priv
LIKE
'%'
;
SELECT
@
hadShowDbPriv
:
=
1
FROM
user
WHERE
Show_db_priv
LIKE
'%'
;
ALTER
TABLE
user
ALTER
TABLE
user
ADD
Show_db_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
AFTER
Alter_priv
,
ADD
Show_db_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
AFTER
Alter_priv
,
ADD
Super_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
AFTER
Show_db_priv
,
ADD
Super_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
AFTER
Show_db_priv
,
ADD
Create_tmp_table_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
AFTER
Super_priv
,
ADD
Create_tmp_table_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
AFTER
Super_priv
,
ADD
Lock_tables_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
AFTER
Create_tmp_table_priv
,
ADD
Lock_tables_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
AFTER
Create_tmp_table_priv
,
ADD
Execute_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
AFTER
Lock_tables_priv
,
ADD
Execute_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
AFTER
Lock_tables_priv
,
ADD
Repl_slave_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
AFTER
Execute_priv
,
ADD
Repl_slave_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
AFTER
Execute_priv
,
ADD
Repl_client_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
AFTER
Repl_slave_priv
;
ADD
Repl_client_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
AFTER
Repl_slave_priv
;
-- Convert privileges so that users have similar privileges as before
-- Convert privileges so that users have similar privileges as before
...
@@ -150,11 +126,11 @@ ADD max_connections int(11) unsigned NOT NULL AFTER max_updates;
...
@@ -150,11 +126,11 @@ ADD max_connections int(11) unsigned NOT NULL AFTER max_updates;
--
--
ALTER
TABLE
db
ALTER
TABLE
db
ADD
Create_tmp_table_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
ADD
Create_tmp_table_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
ADD
Lock_tables_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
;
ADD
Lock_tables_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
;
ALTER
TABLE
host
ALTER
TABLE
host
ADD
Create_tmp_table_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
,
ADD
Create_tmp_table_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
ADD
Lock_tables_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
;
ADD
Lock_tables_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
;
alter
table
db
change
Db
Db
char
(
64
)
binary
DEFAULT
''
NOT
NULL
;
alter
table
db
change
Db
Db
char
(
64
)
binary
DEFAULT
''
NOT
NULL
;
alter
table
host
change
Db
Db
char
(
64
)
binary
DEFAULT
''
NOT
NULL
;
alter
table
host
change
Db
Db
char
(
64
)
binary
DEFAULT
''
NOT
NULL
;
...
@@ -170,6 +146,95 @@ alter table func comment='User defined functions';
...
@@ -170,6 +146,95 @@ alter table func comment='User defined functions';
alter
table
tables_priv
comment
=
'Table privileges'
;
alter
table
tables_priv
comment
=
'Table privileges'
;
alter
table
columns_priv
comment
=
'Column privileges'
;
alter
table
columns_priv
comment
=
'Column privileges'
;
-- Convert all tables to UTF-8 with binary collation
-- and reset all char columns to correct width
ALTER
TABLE
user
MODIFY
Host
char
(
60
)
NOT
NULL
default
''
,
MODIFY
User
char
(
16
)
NOT
NULL
default
''
,
MODIFY
Password
char
(
41
)
NOT
NULL
default
''
,
ENGINE
=
MyISAM
,
CONVERT
TO
CHARACTER
SET
utf8
COLLATE
utf8_bin
;
ALTER
TABLE
user
MODIFY
Select_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Insert_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Update_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Delete_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Create_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Drop_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Reload_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Shutdown_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Process_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
File_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Grant_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
References_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Index_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Alter_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Show_db_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Super_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Create_tmp_table_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Lock_tables_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Execute_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Repl_slave_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Repl_client_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
ssl_type
enum
(
''
,
'ANY'
,
'X509'
,
'SPECIFIED'
)
COLLATE
utf8_general_ci
DEFAULT
''
NOT
NULL
;
ALTER
TABLE
db
MODIFY
Host
char
(
60
)
NOT
NULL
default
''
,
MODIFY
Db
char
(
64
)
NOT
NULL
default
''
,
MODIFY
User
char
(
16
)
NOT
NULL
default
''
,
ENGINE
=
MyISAM
,
CONVERT
TO
CHARACTER
SET
utf8
COLLATE
utf8_bin
;
ALTER
TABLE
db
MODIFY
Select_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Insert_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Update_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Delete_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Create_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Drop_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Grant_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
References_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Index_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Alter_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Create_tmp_table_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Lock_tables_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
;
ALTER
TABLE
host
MODIFY
Host
char
(
60
)
NOT
NULL
default
''
,
MODIFY
Db
char
(
64
)
NOT
NULL
default
''
,
ENGINE
=
MyISAM
,
CONVERT
TO
CHARACTER
SET
utf8
COLLATE
utf8_bin
;
ALTER
TABLE
host
MODIFY
Select_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Insert_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Update_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Delete_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Create_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Drop_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Grant_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
References_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Index_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Alter_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Create_tmp_table_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
MODIFY
Lock_tables_priv
enum
(
'N'
,
'Y'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
;
ALTER
TABLE
func
ENGINE
=
MyISAM
,
CONVERT
TO
CHARACTER
SET
utf8
COLLATE
utf8_bin
;
ALTER
TABLE
func
MODIFY
type
enum
(
'function'
,
'aggregate'
)
COLLATE
utf8_general_ci
NOT
NULL
;
ALTER
TABLE
columns_priv
MODIFY
Host
char
(
60
)
NOT
NULL
default
''
,
MODIFY
Db
char
(
64
)
NOT
NULL
default
''
,
MODIFY
User
char
(
16
)
NOT
NULL
default
''
,
MODIFY
Table_name
char
(
64
)
NOT
NULL
default
''
,
MODIFY
Column_name
char
(
64
)
NOT
NULL
default
''
,
ENGINE
=
MyISAM
,
CONVERT
TO
CHARACTER
SET
utf8
COLLATE
utf8_bin
;
ALTER
TABLE
columns_priv
MODIFY
Column_priv
set
(
'Select'
,
'Insert'
,
'Update'
,
'References'
)
COLLATE
utf8_general_ci
DEFAULT
''
NOT
NULL
;
ALTER
TABLE
tables_priv
MODIFY
Host
char
(
60
)
NOT
NULL
default
''
,
MODIFY
Db
char
(
64
)
NOT
NULL
default
''
,
MODIFY
User
char
(
16
)
NOT
NULL
default
''
,
MODIFY
Table_name
char
(
64
)
NOT
NULL
default
''
,
MODIFY
Grantor
char
(
77
)
NOT
NULL
default
''
,
ENGINE
=
MyISAM
,
CONVERT
TO
CHARACTER
SET
utf8
COLLATE
utf8_bin
;
ALTER
TABLE
tables_priv
MODIFY
Table_priv
set
(
'Select'
,
'Insert'
,
'Update'
,
'Delete'
,
'Create'
,
'Drop'
,
'Grant'
,
'References'
,
'Index'
,
'Alter'
)
COLLATE
utf8_general_ci
DEFAULT
''
NOT
NULL
,
MODIFY
Column_priv
set
(
'Select'
,
'Insert'
,
'Update'
,
'References'
)
COLLATE
utf8_general_ci
DEFAULT
''
NOT
NULL
;
#
#
#
Create
some
possible
missing
tables
#
Create
some
possible
missing
tables
#
#
...
@@ -217,9 +282,12 @@ PRIMARY KEY Name (Name)
...
@@ -217,9 +282,12 @@ PRIMARY KEY Name (Name)
CREATE
TABLE
IF
NOT
EXISTS
time_zone
(
CREATE
TABLE
IF
NOT
EXISTS
time_zone
(
Time_zone_id
int
unsigned
NOT
NULL
auto_increment
,
Time_zone_id
int
unsigned
NOT
NULL
auto_increment
,
Use_leap_seconds
enum
(
'Y'
,
'N'
)
DEFAULT
'N'
NOT
NULL
,
Use_leap_seconds
enum
(
'Y'
,
'N'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
,
PRIMARY
KEY
TzId
(
Time_zone_id
)
PRIMARY
KEY
TzId
(
Time_zone_id
)
)
CHARACTER
SET
utf8
comment
=
'Time zones'
;
)
CHARACTER
SET
utf8
comment
=
'Time zones'
;
-- Make enum field case-insensitive
ALTER
TABLE
time_zone
MODIFY
Use_leap_seconds
enum
(
'Y'
,
'N'
)
COLLATE
utf8_general_ci
DEFAULT
'N'
NOT
NULL
;
CREATE
TABLE
IF
NOT
EXISTS
time_zone_transition
(
CREATE
TABLE
IF
NOT
EXISTS
time_zone_transition
(
Time_zone_id
int
unsigned
NOT
NULL
,
Time_zone_id
int
unsigned
NOT
NULL
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment