summaryrefslogtreecommitdiff
path: root/scripts/mysql_fix_privilege_tables.sql
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/mysql_fix_privilege_tables.sql')
-rw-r--r--scripts/mysql_fix_privilege_tables.sql50
1 files changed, 34 insertions, 16 deletions
diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql
index 7956287b6c2..bc9da056758 100644
--- a/scripts/mysql_fix_privilege_tables.sql
+++ b/scripts/mysql_fix_privilege_tables.sql
@@ -260,6 +260,11 @@ ALTER TABLE host ADD Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAUL
ALTER TABLE user ADD Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv;
#
+# Show/Create views table privileges (v5.0)
+#
+ALTER TABLE tables_priv MODIFY Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view') COLLATE utf8_general_ci DEFAULT '' NOT NULL;
+
+#
# Assign create/show view privileges to people who have create provileges
#
UPDATE user SET Create_view_priv=Create_priv, Show_view_priv=Create_priv where user<>"" AND @hadCreateViewPriv = 0;
@@ -406,22 +411,22 @@ PRIMARY KEY TranTime (Transition_time)
#
CREATE TABLE IF NOT EXISTS proc (
- db char(64) binary DEFAULT '' NOT NULL,
+ db char(64) collate utf8_bin DEFAULT '' NOT NULL,
name char(64) DEFAULT '' NOT NULL,
type enum('FUNCTION','PROCEDURE') NOT NULL,
specific_name char(64) DEFAULT '' NOT NULL,
language enum('SQL') DEFAULT 'SQL' NOT NULL,
sql_data_access enum('CONTAINS_SQL',
- 'NO_SQL',
- 'READS_SQL_DATA',
- 'MODIFIES_SQL_DATA'
- ) DEFAULT 'CONTAINS_SQL' NOT NULL,
+ 'NO_SQL',
+ 'READS_SQL_DATA',
+ 'MODIFIES_SQL_DATA'
+ ) DEFAULT 'CONTAINS_SQL' NOT NULL,
is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL,
security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL,
param_list blob DEFAULT '' NOT NULL,
returns char(64) DEFAULT '' NOT NULL,
body blob DEFAULT '' NOT NULL,
- definer char(77) binary DEFAULT '' NOT NULL,
+ definer char(77) collate utf8_bin DEFAULT '' NOT NULL,
created timestamp,
modified timestamp,
sql_mode set(
@@ -455,20 +460,22 @@ CREATE TABLE IF NOT EXISTS proc (
'TRADITIONAL',
'NO_AUTO_CREATE_USER',
'HIGH_NOT_PRECEDENCE'
- ) DEFAULT 0 NOT NULL,
- comment char(64) binary DEFAULT '' NOT NULL,
+ ) DEFAULT '' NOT NULL,
+ comment char(64) collate utf8_bin DEFAULT '' NOT NULL,
PRIMARY KEY (db,name,type)
-) comment='Stored Procedures';
+) engine=MyISAM
+ character set utf8
+ comment='Stored Procedures';
# Correct the name fields to not binary, and expand sql_data_access
ALTER TABLE proc MODIFY name char(64) DEFAULT '' NOT NULL,
MODIFY specific_name char(64) DEFAULT '' NOT NULL,
- MODIFY sql_data_access
- enum('CONTAINS_SQL',
- 'NO_SQL',
- 'READS_SQL_DATA',
- 'MODIFIES_SQL_DATA'
- ) DEFAULT 'CONTAINS_SQL' NOT NULL,
+ MODIFY sql_data_access
+ enum('CONTAINS_SQL',
+ 'NO_SQL',
+ 'READS_SQL_DATA',
+ 'MODIFIES_SQL_DATA'
+ ) DEFAULT 'CONTAINS_SQL' NOT NULL,
MODIFY sql_mode
set('REAL_AS_FLOAT',
'PIPES_AS_CONCAT',
@@ -500,4 +507,15 @@ ALTER TABLE proc MODIFY name char(64) DEFAULT '' NOT NULL,
'TRADITIONAL',
'NO_AUTO_CREATE_USER',
'HIGH_NOT_PRECEDENCE'
- ) DEFAULT 0 NOT NULL;
+ ) DEFAULT '' NOT NULL
+ DEFAULT CHARACTER SET utf8;
+
+# Correct the character set and collation
+ALTER TABLE proc CONVERT TO CHARACTER SET utf8;
+# Reset some fields after the conversion
+ALTER TABLE proc MODIFY db
+ char(64) collate utf8_bin DEFAULT '' NOT NULL,
+ MODIFY definer
+ char(77) collate utf8_bin DEFAULT '' NOT NULL,
+ MODIFY comment
+ char(64) collate utf8_bin DEFAULT '' NOT NULL;