summaryrefslogtreecommitdiff
path: root/sql/sql_acl.cc
diff options
context:
space:
mode:
authorunknown <bar@bar.intranet.mysql.r18.ru>2004-05-14 12:16:27 +0500
committerunknown <bar@bar.intranet.mysql.r18.ru>2004-05-14 12:16:27 +0500
commit3226b9fae557cc8ef952acbe47ceb744cc4eabdc (patch)
treeae5376700da6c012ef58ebe0cfe89c4062aa4f06 /sql/sql_acl.cc
parent6f0946d6dd0568c36d33f34e548b5ac8e26842ad (diff)
downloadmariadb-git-3226b9fae557cc8ef952acbe47ceb744cc4eabdc.tar.gz
Bug #3403 Wrong encoding in SHOW GRANTS, EPLAIN SELECT output
This change fixes SHOW GRANTS problem, while EXPLAIN will be fixed in a separate patch.
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r--sql/sql_acl.cc18
1 files changed, 11 insertions, 7 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 9c7fe3e2993..880b6eb74ee 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -3064,7 +3064,7 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
/* Add first global access grants */
{
- String global(buff,sizeof(buff),&my_charset_latin1);
+ String global(buff,sizeof(buff),system_charset_info);
global.length(0);
global.append("GRANT ",6);
@@ -3089,7 +3089,8 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
}
}
global.append (" ON *.* TO '",12);
- global.append(lex_user->user.str,lex_user->user.length);
+ global.append(lex_user->user.str, lex_user->user.length,
+ system_charset_info);
global.append ("'@'",3);
global.append(lex_user->host.str,lex_user->host.length);
global.append ('\'');
@@ -3177,7 +3178,7 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
want_access=acl_db->access;
if (want_access)
{
- String db(buff,sizeof(buff),&my_charset_latin1);
+ String db(buff,sizeof(buff),system_charset_info);
db.length(0);
db.append("GRANT ",6);
@@ -3203,7 +3204,8 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
db.append (" ON ",4);
append_identifier(thd, &db, acl_db->db, strlen(acl_db->db));
db.append (".* TO '",7);
- db.append(lex_user->user.str,lex_user->user.length);
+ db.append(lex_user->user.str, lex_user->user.length,
+ system_charset_info);
db.append ("'@'",3);
db.append(lex_user->host.str, lex_user->host.length);
db.append ('\'');
@@ -3237,7 +3239,7 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
ulong table_access= grant_table->privs;
if ((table_access | grant_table->cols) != 0)
{
- String global(buff,sizeof(buff),&my_charset_latin1);
+ String global(buff, sizeof(buff), system_charset_info);
ulong test_access= (table_access | grant_table->cols) & ~GRANT_ACL;
global.length(0);
@@ -3291,7 +3293,8 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
else
global.append(", ",2);
global.append(grant_column->column,
- grant_column->key_length);
+ grant_column->key_length,
+ system_charset_info);
}
}
if (found_col)
@@ -3307,7 +3310,8 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
append_identifier(thd, &global, grant_table->tname,
strlen(grant_table->tname));
global.append(" TO '",5);
- global.append(lex_user->user.str,lex_user->user.length);
+ global.append(lex_user->user.str, lex_user->user.length,
+ system_charset_info);
global.append("'@'",3);
global.append(lex_user->host.str,lex_user->host.length);
global.append('\'');