summaryrefslogtreecommitdiff
path: root/sql-common
diff options
context:
space:
mode:
authorXiangyu Hu <xiangyhu@microsoft.com>2018-05-10 03:53:29 +0000
committerVladislav Vaintroub <wlad@mariadb.com>2018-05-11 16:24:55 +0200
commitee8dfc688e863b68734f3f32c2a0846bb9c12b44 (patch)
tree1ce40c80c0187f0dd9fd9e9a838158cc8d7ecff3 /sql-common
parent4a126bf3e1846612852131ee698d6091c777625a (diff)
downloadmariadb-git-ee8dfc688e863b68734f3f32c2a0846bb9c12b44.tar.gz
Add host name to session attributes.
Diffstat (limited to 'sql-common')
-rw-r--r--sql-common/client.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sql-common/client.c b/sql-common/client.c
index aee3852eea5..f3858063fb7 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -3057,6 +3057,7 @@ set_connect_attributes(MYSQL *mysql, char *buff, size_t buf_len)
rc+= mysql_options(mysql, MYSQL_OPT_CONNECT_ATTR_DELETE, "_client_name");
rc+= mysql_options(mysql, MYSQL_OPT_CONNECT_ATTR_DELETE, "_os");
rc+= mysql_options(mysql, MYSQL_OPT_CONNECT_ATTR_DELETE, "_platform");
+ rc+= mysql_options(mysql, MYSQL_OPT_CONNECT_ATTR_DELETE, "_host_name");
rc+= mysql_options(mysql, MYSQL_OPT_CONNECT_ATTR_DELETE, "_pid");
rc+= mysql_options(mysql, MYSQL_OPT_CONNECT_ATTR_DELETE, "_thread");
rc+= mysql_options(mysql, MYSQL_OPT_CONNECT_ATTR_DELETE, "_client_version");
@@ -3072,6 +3073,8 @@ set_connect_attributes(MYSQL *mysql, char *buff, size_t buf_len)
"_os", SYSTEM_TYPE);
rc+= mysql_options4(mysql, MYSQL_OPT_CONNECT_ATTR_ADD,
"_platform", MACHINE_TYPE);
+ rc+= mysql_options4(mysql, MYSQL_OPT_CONNECT_ATTR_ADD,
+ "_host_name", mysql->host);
#ifdef __WIN__
snprintf(buff, buf_len, "%lu", (ulong) GetCurrentProcessId());
#else