diff options
author | unknown <bell@sanja.is.com.ua> | 2005-10-18 21:42:26 +0300 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2005-10-18 21:42:26 +0300 |
commit | 89a5b23dc4589a1268e9d651b1b8651d83e60667 (patch) | |
tree | 3ad6f48c1f1fc9e6154a4680d67a70181cbf0f85 | |
parent | 9e3df6cc173bac95a5cbed45963bf3a577c7a9ab (diff) | |
download | mariadb-git-89a5b23dc4589a1268e9d651b1b8651d83e60667.tar.gz |
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()
-rw-r--r-- | mysql-test/r/skip_grants.result | 4 | ||||
-rw-r--r-- | mysql-test/t/skip_grants.test | 8 | ||||
-rw-r--r-- | sql/sql_acl.cc | 5 |
3 files changed, 17 insertions, 0 deletions
diff --git a/mysql-test/r/skip_grants.result b/mysql-test/r/skip_grants.result index c1c31eb91c9..4d723f8e12a 100644 --- a/mysql-test/r/skip_grants.result +++ b/mysql-test/r/skip_grants.result @@ -8,3 +8,7 @@ ERROR HY000: View definer is not fully qualified drop table t1; create procedure f1() select 1; 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; diff --git a/mysql-test/t/skip_grants.test b/mysql-test/t/skip_grants.test index 156547ea6aa..7a729f98661 100644 --- a/mysql-test/t/skip_grants.test +++ b/mysql-test/t/skip_grants.test @@ -19,3 +19,11 @@ drop table t1; # create procedure f1() select 1; 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; diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 771cb93ed9c..b28c3be0167 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1487,6 +1487,11 @@ end: bool is_acl_user(const char *host, const char *user) { bool res; + + /* --skip-grants */ + if (!initialized) + return TRUE; + VOID(pthread_mutex_lock(&acl_cache->lock)); res= find_acl_user(host, user, TRUE) != NULL; VOID(pthread_mutex_unlock(&acl_cache->lock)); |