Commit 09e9651a authored by bell@sanja.is.com.ua's avatar bell@sanja.is.com.ua

fix privileges for old style privileges tables on fly (as it do...

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
parent 29593da2
...@@ -252,8 +252,8 @@ mysql ...@@ -252,8 +252,8 @@ mysql
test test
prepare stmt4 from ' show tables from test like ''t2%'' '; prepare stmt4 from ' show tables from test like ''t2%'' ';
execute stmt4; execute stmt4;
Tables_in_test (t2%) table_type Tables_in_test (t2%)
t2 BASE TABLE t2
prepare stmt4 from ' show columns from t2 from test like ''a%'' '; prepare stmt4 from ' show columns from t2 from test like ''a%'' ';
execute stmt4; execute stmt4;
Field Type Null Key Default Extra Field Type Null Key Default Extra
......
...@@ -301,6 +301,12 @@ my_bool acl_init(THD *org_thd, bool dont_read_acl_tables) ...@@ -301,6 +301,12 @@ my_bool acl_init(THD *org_thd, bool dont_read_acl_tables)
{ {
uint next_field; uint next_field;
user.access= get_access(table,3,&next_field) & GLOBAL_ACLS; 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.sort= get_sort(2,user.host.hostname,user.user);
user.hostname_length= (user.host.hostname ? user.hostname_length= (user.host.hostname ?
(uint) strlen(user.host.hostname) : 0); (uint) strlen(user.host.hostname) : 0);
......
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