diff options
author | unknown <monty@mashka.mysql.fi> | 2003-09-05 06:56:28 +0300 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2003-09-05 06:56:28 +0300 |
commit | 0af8b9805b195d3100870fbecbd4fa8fd4d199c1 (patch) | |
tree | 1ece95922da2cd3095ac879a5a3a20adac10bd54 /sql/sql_acl.cc | |
parent | a91b55ce48ca9e4472eecdaefaa584af890821e4 (diff) | |
parent | 15cb9caea6c34d05cf7d42d6d155e6f89fadbceb (diff) | |
download | mariadb-git-0af8b9805b195d3100870fbecbd4fa8fd4d199c1.tar.gz |
Merge with 3.23
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r-- | sql/sql_acl.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 3b5e9983b80..b76bbe8c730 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1607,6 +1607,7 @@ class GRANT_TABLE :public Sql_alloc public: char *host,*db,*user,*tname, *hash_key; ulong privs, cols; + ulong sort; uint key_length; HASH hash_columns; GRANT_TABLE (const char *h, const char *d,const char *u, const char *t, @@ -1616,6 +1617,7 @@ public: host = strdup_root(&memex,h); db = strdup_root(&memex,d); user = strdup_root(&memex,u); + sort= get_sort(3,host,db,user); tname= strdup_root(&memex,t); if (lower_case_table_names) { @@ -1638,6 +1640,7 @@ public: user = get_field(&memex,form,2); if (!user) user=(char*) ""; + sort= get_sort(3,host,db,user); tname = get_field(&memex,form,3); if (!host || !db || !tname) { @@ -1745,9 +1748,10 @@ static GRANT_TABLE *table_hash_search(const char *host,const char* ip, } else { - if ((host && !wild_case_compare(host,grant_table->host)) || - (ip && !wild_case_compare(ip,grant_table->host))) - found=grant_table; // Host ok + if (((host && !wild_case_compare(host,grant_table->host)) || + (ip && !wild_case_compare(ip,grant_table->host))) && + (!found || found->sort < grant_table->sort)) + found=grant_table; } } return found; |