summaryrefslogtreecommitdiff
path: root/sql/sql_acl.cc
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2004-05-05 21:24:21 +0300
committerunknown <monty@mysql.com>2004-05-05 21:24:21 +0300
commit000f76cfb844eeda1c1c0092d4ab97f3f3acb6cb (patch)
tree7237dcd91649e057a85eb3caca141f3df5892db8 /sql/sql_acl.cc
parentcd21f7ce40ac4c7d415544a5b2aa07b1278419ac (diff)
downloadmariadb-git-000f76cfb844eeda1c1c0092d4ab97f3f3acb6cb.tar.gz
after merge fixes
client/mysqldump.c: Fixed problem with multiple tables (--skip-quote didn't work properly for second table) myisam/myisamchk.c: after merge fix
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r--sql/sql_acl.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 625068e655c..27aaf06d872 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -3015,6 +3015,12 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--skip-grant-tables");
DBUG_RETURN(-1);
}
+
+ if (!lex_user->host.str)
+ {
+ lex_user->host.str= (char*) "%";
+ lex_user->host.length=1;
+ }
if (lex_user->host.length > HOSTNAME_LENGTH ||
lex_user->user.length > USERNAME_LENGTH)
{
@@ -3215,7 +3221,7 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
/* Add table & column access */
for (index=0 ; index < column_priv_hash.records ; index++)
{
- const char *user,*host;
+ const char *user;
GRANT_TABLE *grant_table= (GRANT_TABLE*) hash_element(&column_priv_hash,
index);
@@ -3223,7 +3229,8 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
user= "";
if (!strcmp(lex_user->user.str,user) &&
- !my_strcasecmp(&my_charset_latin1, lex_user->host.str, host))
+ !my_strcasecmp(&my_charset_latin1, lex_user->host.str,
+ grant_table->orig_host))
{
ulong table_access= grant_table->privs;
if ((table_access | grant_table->cols) != 0)