1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-21 21:22:27 +03:00

Add host name to session attributes.

This commit is contained in:
Xiangyu Hu
2018-05-10 03:53:29 +00:00
committed by Vladislav Vaintroub
parent 4a126bf3e1
commit ee8dfc688e

View File

@ -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, "_client_name");
rc+= mysql_options(mysql, MYSQL_OPT_CONNECT_ATTR_DELETE, "_os"); 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, "_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, "_pid");
rc+= mysql_options(mysql, MYSQL_OPT_CONNECT_ATTR_DELETE, "_thread"); rc+= mysql_options(mysql, MYSQL_OPT_CONNECT_ATTR_DELETE, "_thread");
rc+= mysql_options(mysql, MYSQL_OPT_CONNECT_ATTR_DELETE, "_client_version"); 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); "_os", SYSTEM_TYPE);
rc+= mysql_options4(mysql, MYSQL_OPT_CONNECT_ATTR_ADD, rc+= mysql_options4(mysql, MYSQL_OPT_CONNECT_ATTR_ADD,
"_platform", MACHINE_TYPE); "_platform", MACHINE_TYPE);
rc+= mysql_options4(mysql, MYSQL_OPT_CONNECT_ATTR_ADD,
"_host_name", mysql->host);
#ifdef __WIN__ #ifdef __WIN__
snprintf(buff, buf_len, "%lu", (ulong) GetCurrentProcessId()); snprintf(buff, buf_len, "%lu", (ulong) GetCurrentProcessId());
#else #else