From 000f76cfb844eeda1c1c0092d4ab97f3f3acb6cb Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 May 2004 21:24:21 +0300 Subject: 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 --- sql/sql_acl.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'sql/sql_acl.cc') 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) -- cgit v1.2.1