summaryrefslogtreecommitdiff
path: root/sql/sql_acl.cc
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2005-03-26 20:15:18 +0100
committerunknown <serg@serg.mylan>2005-03-26 20:15:18 +0100
commitca5845ea162bc2ce81644fd79341d37ec1536572 (patch)
treea2a4112d51a4ea7ae5841d4eb1d63bc84f409892 /sql/sql_acl.cc
parent68717638d572dac02b82511809d3b5f9023c0872 (diff)
parent606ee28d2a34159295a5f587d306f684fb68e27b (diff)
downloadmariadb-git-ca5845ea162bc2ce81644fd79341d37ec1536572.tar.gz
merged
myisam/mi_create.c: Auto merged sql/sql_acl.cc: Auto merged sql/sql_parse.cc: merged with ul
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r--sql/sql_acl.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 0c3f2a52fd2..02da05d195f 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -994,6 +994,9 @@ static void acl_insert_db(const char *user, const char *host, const char *db,
/*
Get privilege for a host, user and db combination
+
+ as db_is_pattern changes the semantics of comparison,
+ acl_cache is not used if db_is_pattern is set.
*/
ulong acl_get(const char *host, const char *ip,
@@ -1013,7 +1016,7 @@ ulong acl_get(const char *host, const char *ip,
db=tmp_db;
}
key_length=(uint) (end-key);
- if ((entry=(acl_entry*) acl_cache->search(key,key_length)))
+ if (!db_is_pattern && (entry=(acl_entry*) acl_cache->search(key,key_length)))
{
db_access=entry->access;
VOID(pthread_mutex_unlock(&acl_cache->lock));
@@ -1062,7 +1065,8 @@ ulong acl_get(const char *host, const char *ip,
}
exit:
/* Save entry in cache for quick retrieval */
- if ((entry= (acl_entry*) malloc(sizeof(acl_entry)+key_length)))
+ if (!db_is_pattern &&
+ (entry= (acl_entry*) malloc(sizeof(acl_entry)+key_length)))
{
entry->access=(db_access & host_access);
entry->length=key_length;