summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2005-07-05 13:36:36 +0300
committerunknown <bell@sanja.is.com.ua>2005-07-05 13:36:36 +0300
commit200f03fdd4b5a6272789c18a1250f1d790b9e177 (patch)
tree19204b6be884c68d59c350d709658364aa6ca45c /scripts
parentbf851ae2a0d3fc1b45a81739046ab05d7285b666 (diff)
downloadmariadb-git-200f03fdd4b5a6272789c18a1250f1d790b9e177.tar.gz
added processing of view grants to table grants (BUG#9795)
mysql-test/r/grant.result: test of new table privileges mysql-test/r/system_mysql_db.result: added new table priveleges mysql-test/r/view_grant.result: error changed mysql-test/t/grant.test: test of new table privileges mysql-test/t/view_grant.test: error changed scripts/mysql_create_system_tables.sh: add new table privileges scripts/mysql_fix_privilege_tables.sql: fixed system tables fix script sql/sql_acl.h: fixed coding/decoding new tables grants
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mysql_create_system_tables.sh2
-rw-r--r--scripts/mysql_fix_privilege_tables.sql5
2 files changed, 6 insertions, 1 deletions
diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh
index a8f6c02b057..bc07d857c4b 100644
--- a/scripts/mysql_create_system_tables.sh
+++ b/scripts/mysql_create_system_tables.sh
@@ -215,7 +215,7 @@ then
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 Timestamp timestamp(14),"
- 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 Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view') COLLATE utf8_general_ci 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 KEY Grantor (Grantor)"
diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql
index 68b31cf1519..3da2f7504a1 100644
--- a/scripts/mysql_fix_privilege_tables.sql
+++ b/scripts/mysql_fix_privilege_tables.sql
@@ -261,6 +261,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;