summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.cc
diff options
context:
space:
mode:
authorunknown <dlenev@mysql.com>2005-09-22 23:03:53 +0400
committerunknown <dlenev@mysql.com>2005-09-22 23:03:53 +0400
commit17feba98d47e477210a98fb44c2c95cf342571f7 (patch)
tree578034f4f2b8a75060886d9d9adf77911870297b /sql/item_strfunc.cc
parentd2fc3bd4245f8c212046e88151da4a66d1b048b3 (diff)
downloadmariadb-git-17feba98d47e477210a98fb44c2c95cf342571f7.tar.gz
Fix for bug #13407 "Remote connecting crashes server" and couple of similar
problems which were introduced during work on WL#2787 "Add view definer/owner to the view definition (.frm) to check privileges on used tables and stored routines when using a VIEW." In some cases it is better to use value from Security_context::host_or_ip instead of value from Security_context::host since the latter can be NULL in certain situations (When we can't resolve hostname or we have not done this yet). mysql-test/r/skip_name_resolve.result: Added test for bug #13407 "Remote connecting crashes server". mysql-test/t/skip_name_resolve.test: Added test for bug #13407 "Remote connecting crashes server". sql/item_strfunc.cc: Item_func_user::val_str(): It is better to use value from Security_context::host_or_ip instead of value from Security_context::host in the result of USER() function since the latter can be NULL in certain situations (When we can't resolve hostname or we have not done this yet. Reverted back to old code). sql/mysqld.cc: handle_connections_shared_memory(): THD::host member has moved to the Security_context class. New THD::security_ctx member points to active security context. sql/sql_show.cc: mysqld_list_processes(): It is better to use value from Security_context::host_or_ip instead of value from Security_context::host in the processlist since the latter can be NULL in certain situations (When we can't resolve hostname or we have not done this yet. Reverted back to old code).
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r--sql/item_strfunc.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 54c476ce176..f0486246a65 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -1608,7 +1608,7 @@ String *Item_func_user::val_str(String *str)
else
{
user= thd->main_security_ctx.user;
- host= thd->main_security_ctx.host;
+ host= thd->main_security_ctx.host_or_ip;
}
// For system threads (e.g. replication SQL thread) user may be empty