Commit 5d7848d8 authored by unknown's avatar unknown

fixed privilege system upgrade script, to allow VIEW privileges for used who...

fixed privilege system upgrade script, to allow VIEW privileges for used who have CREATE privilege (BUG#5329)


scripts/mysql_fix_privilege_tables.sql:
  fixed privilege system upgrade script, to allow VIEW privileges for used who have CREATE privilege
parent 8ad470e2
...@@ -144,6 +144,13 @@ alter table user comment='Users and global privileges'; ...@@ -144,6 +144,13 @@ alter table user comment='Users and global privileges';
alter table func comment='User defined functions'; 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';
#
# Detect whether we had Create_view_priv
#
SET @hadCreateViewPriv:=0;
SELECT @hadCreateViewPriv:=1 FROM user WHERE Create_view_priv LIKE '%';
# #
# Create VIEWs privileges (v5.0) # Create VIEWs privileges (v5.0)
# #
...@@ -158,6 +165,11 @@ ALTER TABLE db ADD Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Creat ...@@ -158,6 +165,11 @@ ALTER TABLE db ADD Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Creat
ALTER TABLE host ADD Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_view_priv; ALTER TABLE host ADD Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_view_priv;
ALTER TABLE user ADD Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_view_priv; ALTER TABLE user ADD Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_view_priv;
#
# 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;
# #
# Create some possible missing tables # Create some possible missing tables
# #
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment