diff options
author | Sergei Golubchik <serg@mariadb.org> | 2020-02-14 16:25:45 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2020-03-10 19:24:23 +0100 |
commit | d5a00697023d17b38b89d7b3c4d37fa98c1dd60b (patch) | |
tree | d3225ba5e01b5bf2f0bde9aca82ab6324dab701a /vio | |
parent | 00819d8116a4613a30ca72ed999ec387595a1783 (diff) | |
download | mariadb-git-d5a00697023d17b38b89d7b3c4d37fa98c1dd60b.tar.gz |
perfschema socket instrumentation related changes
Diffstat (limited to 'vio')
-rw-r--r-- | vio/viosocket.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/vio/viosocket.c b/vio/viosocket.c index 9ef703dee8d..c4d55901a16 100644 --- a/vio/viosocket.c +++ b/vio/viosocket.c @@ -645,6 +645,26 @@ enum enum_vio_type vio_type(Vio* vio) return vio->type; } +static const LEX_CSTRING vio_type_names[] = +{ + { STRING_WITH_LEN("Error") }, // cannot happen + { STRING_WITH_LEN("TCP/IP") }, + { STRING_WITH_LEN("Socket") }, + { STRING_WITH_LEN("Named Pipe") }, + { STRING_WITH_LEN("SSL/TLS") }, + { STRING_WITH_LEN("Shared Memory") } +}; + +const char *vio_type_name(enum enum_vio_type vio_type, size_t *len) +{ + int index= vio_type >= FIRST_VIO_TYPE && vio_type <= LAST_VIO_TYPE + ? vio_type : 0; + + *len= vio_type_names[index].length; + return vio_type_names[index].str; +} + + my_socket vio_fd(Vio* vio) { return mysql_socket_getfd(vio->mysql_socket); |