Commit 0af8b980 authored by unknown's avatar unknown

Merge with 3.23

parents a91b55ce 15cb9cae
This diff is collapsed.
...@@ -1607,6 +1607,7 @@ class GRANT_TABLE :public Sql_alloc ...@@ -1607,6 +1607,7 @@ class GRANT_TABLE :public Sql_alloc
public: public:
char *host,*db,*user,*tname, *hash_key; char *host,*db,*user,*tname, *hash_key;
ulong privs, cols; ulong privs, cols;
ulong sort;
uint key_length; uint key_length;
HASH hash_columns; HASH hash_columns;
GRANT_TABLE (const char *h, const char *d,const char *u, const char *t, GRANT_TABLE (const char *h, const char *d,const char *u, const char *t,
...@@ -1616,6 +1617,7 @@ class GRANT_TABLE :public Sql_alloc ...@@ -1616,6 +1617,7 @@ class GRANT_TABLE :public Sql_alloc
host = strdup_root(&memex,h); host = strdup_root(&memex,h);
db = strdup_root(&memex,d); db = strdup_root(&memex,d);
user = strdup_root(&memex,u); user = strdup_root(&memex,u);
sort= get_sort(3,host,db,user);
tname= strdup_root(&memex,t); tname= strdup_root(&memex,t);
if (lower_case_table_names) if (lower_case_table_names)
{ {
...@@ -1638,6 +1640,7 @@ class GRANT_TABLE :public Sql_alloc ...@@ -1638,6 +1640,7 @@ class GRANT_TABLE :public Sql_alloc
user = get_field(&memex,form,2); user = get_field(&memex,form,2);
if (!user) if (!user)
user=(char*) ""; user=(char*) "";
sort= get_sort(3,host,db,user);
tname = get_field(&memex,form,3); tname = get_field(&memex,form,3);
if (!host || !db || !tname) if (!host || !db || !tname)
{ {
...@@ -1745,9 +1748,10 @@ static GRANT_TABLE *table_hash_search(const char *host,const char* ip, ...@@ -1745,9 +1748,10 @@ static GRANT_TABLE *table_hash_search(const char *host,const char* ip,
} }
else else
{ {
if ((host && !wild_case_compare(host,grant_table->host)) || if (((host && !wild_case_compare(host,grant_table->host)) ||
(ip && !wild_case_compare(ip,grant_table->host))) (ip && !wild_case_compare(ip,grant_table->host))) &&
found=grant_table; // Host ok (!found || found->sort < grant_table->sort))
found=grant_table;
} }
} }
return found; return found;
......
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