Commit 439b84af authored by monty@mashka.mysql.fi's avatar monty@mashka.mysql.fi

Merge with 3.23

parents 75b2c4a6 a6e3ee6b
This diff is collapsed.
......@@ -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;
......
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