summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-10-10 18:51:02 +0300
committerunknown <bell@sanja.is.com.ua>2004-10-10 18:51:02 +0300
commit65ed693681b17414fc001099ee734f36de847f13 (patch)
tree901ad7e3c884e13bd67e9f1ef562c080bc838fea
parent8b026230fff314a3a36132024611138cc2b605ae (diff)
downloadmariadb-git-65ed693681b17414fc001099ee734f36de847f13.tar.gz
fix privileges for old style privileges tables on fly (as it do mysql_fix_privilege_tables dut if we have not it run)
fixed forgoten test mysql-test/r/ps_1general.result: SHOW TABLE putput changed sql/sql_acl.cc: fix privileges for old style privileges tables on fly (as it do mysql_fix_privilege_tables dut if we have not it run)
-rw-r--r--mysql-test/r/ps_1general.result4
-rw-r--r--sql/sql_acl.cc6
2 files changed, 8 insertions, 2 deletions
diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result
index f4939592363..91028d7531c 100644
--- a/mysql-test/r/ps_1general.result
+++ b/mysql-test/r/ps_1general.result
@@ -252,8 +252,8 @@ mysql
test
prepare stmt4 from ' show tables from test like ''t2%'' ';
execute stmt4;
-Tables_in_test (t2%) table_type
-t2 BASE TABLE
+Tables_in_test (t2%)
+t2
prepare stmt4 from ' show columns from t2 from test like ''a%'' ';
execute stmt4;
Field Type Null Key Default Extra
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 4a970b6f018..51768922f6d 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -301,6 +301,12 @@ my_bool acl_init(THD *org_thd, bool dont_read_acl_tables)
{
uint next_field;
user.access= get_access(table,3,&next_field) & GLOBAL_ACLS;
+ /*
+ if it is pre 5.0.1 privilege table then map CREATE privilege on
+ CREATE VIEW & SHOW VIEW privileges
+ */
+ if (table->fields <= 31 && (user.access & CREATE_ACL))
+ user.access|= (CREATE_VIEW_ACL | SHOW_VIEW_ACL);
user.sort= get_sort(2,user.host.hostname,user.user);
user.hostname_length= (user.host.hostname ?
(uint) strlen(user.host.hostname) : 0);