Commit 89a5b23d authored by unknown's avatar unknown

check of ACL initialization in is_acl_user() (BUG#13504)


mysql-test/r/skip_grants.result:
  creation view with DEFINER clause if --skip-grant-tables
mysql-test/t/skip_grants.test:
  creation view with DEFINER clause if --skip-grant-tables
sql/sql_acl.cc:
  check of ACL initialization in is_acl_user()
parent 9e3df6cc
...@@ -8,3 +8,7 @@ ERROR HY000: View definer is not fully qualified ...@@ -8,3 +8,7 @@ ERROR HY000: View definer is not fully qualified
drop table t1; drop table t1;
create procedure f1() select 1; create procedure f1() select 1;
drop procedure f1; drop procedure f1;
create table t1 (a int);
create definer='user'@'host' sql security definer view v1 as select * from t1;
drop view v1;
drop table t1;
...@@ -19,3 +19,11 @@ drop table t1; ...@@ -19,3 +19,11 @@ drop table t1;
# #
create procedure f1() select 1; create procedure f1() select 1;
drop procedure f1; drop procedure f1;
#
# BUG#13504: creation view with DEFINER clause if --skip-grant-tables
#
create table t1 (a int);
create definer='user'@'host' sql security definer view v1 as select * from t1;
drop view v1;
drop table t1;
...@@ -1487,6 +1487,11 @@ bool change_password(THD *thd, const char *host, const char *user, ...@@ -1487,6 +1487,11 @@ bool change_password(THD *thd, const char *host, const char *user,
bool is_acl_user(const char *host, const char *user) bool is_acl_user(const char *host, const char *user)
{ {
bool res; bool res;
/* --skip-grants */
if (!initialized)
return TRUE;
VOID(pthread_mutex_lock(&acl_cache->lock)); VOID(pthread_mutex_lock(&acl_cache->lock));
res= find_acl_user(host, user, TRUE) != NULL; res= find_acl_user(host, user, TRUE) != NULL;
VOID(pthread_mutex_unlock(&acl_cache->lock)); VOID(pthread_mutex_unlock(&acl_cache->lock));
......
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