diff options
author | Georgi Kodinov <joro@sun.com> | 2009-11-27 12:32:15 +0200 |
---|---|---|
committer | Georgi Kodinov <joro@sun.com> | 2009-11-27 12:32:15 +0200 |
commit | 96ffcff0592c4e67ff201848019ecc674e84b775 (patch) | |
tree | fbc183ff75ed1cc0f31743484dcba573cd03d1ef /sql/sql_acl.cc | |
parent | f343afe02baa293fad82fb6051e31affb8b0f496 (diff) | |
parent | 0ed9d7e76c23afbb3774f6fcc9c70a23a049f8d5 (diff) | |
download | mariadb-git-96ffcff0592c4e67ff201848019ecc674e84b775.tar.gz |
merge
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r-- | sql/sql_acl.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index ed9adbd96e1..77c72066429 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -2444,14 +2444,17 @@ static GRANT_NAME *name_hash_search(HASH *name_hash, const char *host,const char* ip, const char *db, const char *user, const char *tname, - bool exact) + bool exact, bool name_tolower) { - char helping [NAME_LEN*2+USERNAME_LENGTH+3]; + char helping [NAME_LEN*2+USERNAME_LENGTH+3], *name_ptr; uint len; GRANT_NAME *grant_name,*found=0; HASH_SEARCH_STATE state; - len = (uint) (strmov(strmov(strmov(helping,user)+1,db)+1,tname)-helping)+ 1; + name_ptr= strmov(strmov(helping, user) + 1, db) + 1; + len = (uint) (strmov(name_ptr, tname) - helping) + 1; + if (name_tolower) + my_casedn_str(files_charset_info, name_ptr); for (grant_name= (GRANT_NAME*) hash_first(name_hash, (uchar*) helping, len, &state); grant_name ; @@ -2484,7 +2487,7 @@ routine_hash_search(const char *host, const char *ip, const char *db, { return (GRANT_TABLE*) name_hash_search(proc ? &proc_priv_hash : &func_priv_hash, - host, ip, db, user, tname, exact); + host, ip, db, user, tname, exact, TRUE); } @@ -2493,7 +2496,7 @@ table_hash_search(const char *host, const char *ip, const char *db, const char *user, const char *tname, bool exact) { return (GRANT_TABLE*) name_hash_search(&column_priv_hash, host, ip, db, - user, tname, exact); + user, tname, exact, FALSE); } |