summaryrefslogtreecommitdiff
path: root/mysql-test/t/skip_name_resolve.test
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
commit351d8e39ca6cc8f76b6163593624e13e8f33b30a (patch)
tree578034f4f2b8a75060886d9d9adf77911870297b /mysql-test/t/skip_name_resolve.test
parentb2f7c99db726e6bf97465020fcf830db70e635f0 (diff)
downloadmariadb-git-351d8e39ca6cc8f76b6163593624e13e8f33b30a.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 'mysql-test/t/skip_name_resolve.test')
-rw-r--r--mysql-test/t/skip_name_resolve.test10
1 files changed, 10 insertions, 0 deletions
diff --git a/mysql-test/t/skip_name_resolve.test b/mysql-test/t/skip_name_resolve.test
index 02339ca14c5..b67869692d2 100644
--- a/mysql-test/t/skip_name_resolve.test
+++ b/mysql-test/t/skip_name_resolve.test
@@ -8,3 +8,13 @@ REVOKE ALL ON test.* FROM mysqltest_1@'127.0.0.1/255.255.255.255';
DROP USER mysqltest_1@'127.0.0.1/255.255.255.255';
# End of 4.1 tests
+
+# Bug #13407 "Remote connecting crashes server".
+# Server crashed when one used USER() function in connection for which
+# was impossible to obtain peer hostname.
+connect (con1, 127.0.0.1, root, , test, $MASTER_MYPORT, );
+--replace_column 1 #
+select user();
+--replace_column 1 # 6 # 3 #
+show processlist;
+connection default;