MySQL 8.0.39
Source Code Documentation
service_srv_session_info.h File Reference

Service providing setters and getters for some properties of a session. More...

#include "mysql/service_srv_session.h"
#include <stdint.h>
#include "m_string.h"
#include "my_thread.h"
#include "my_thread_local.h"
#include "mysql_com.h"
#include "plugin.h"

Go to the source code of this file.

Classes

struct  srv_session_info_service_st
 

Functions

MYSQL_THD srv_session_info_get_thd (MYSQL_SESSION session)
 Returns the THD of a session. More...
 
my_thread_id srv_session_info_get_session_id (MYSQL_SESSION session)
 Returns the ID of a session. More...
 
LEX_CSTRING srv_session_info_get_current_db (MYSQL_SESSION session)
 Returns the current database of a session. More...
 
uint16_t srv_session_info_get_client_port (MYSQL_SESSION session)
 Returns the client port of a session. More...
 
int srv_session_info_set_client_port (MYSQL_SESSION session, uint16_t port)
 Sets the client port of a session. More...
 
int srv_session_info_set_connection_type (MYSQL_SESSION session, enum enum_vio_type type)
 Sets the connection type of a session. More...
 
int srv_session_info_killed (MYSQL_SESSION session)
 Returns whether the session was killed. More...
 
unsigned int srv_session_info_session_count ()
 Returns the number opened sessions in thread initialized by srv_session service. More...
 
unsigned int srv_session_info_thread_count (const void *plugin)
 Returns the number opened sessions in thread initialized by srv_session service. More...
 

Variables

enum enum_vio_type int struct srv_session_info_service_stsrv_session_info_service
 

Detailed Description

Service providing setters and getters for some properties of a session.

Function Documentation

◆ srv_session_info_get_client_port()

uint16_t srv_session_info_get_client_port ( MYSQL_SESSION  session)

Returns the client port of a session.

Note
The client port in SHOW PROCESSLIST, INFORMATION_SCHEMA.PROCESSLIST. This port is NOT shown in PERFORMANCE_SCHEMA.THREADS.
Parameters
sessionSession

◆ srv_session_info_get_current_db()

LEX_CSTRING srv_session_info_get_current_db ( MYSQL_SESSION  session)

Returns the current database of a session.

Note
{NULL, 0} is returned case of no current database or session is NULL
Parameters
sessionSession

◆ srv_session_info_get_session_id()

my_thread_id srv_session_info_get_session_id ( MYSQL_SESSION  session)

Returns the ID of a session.

Parameters
sessionSession

◆ srv_session_info_get_thd()

MYSQL_THD srv_session_info_get_thd ( MYSQL_SESSION  session)

Returns the THD of a session.

Parameters
sessionSession
Returns
address of the THD

◆ srv_session_info_killed()

int srv_session_info_killed ( MYSQL_SESSION  session)

Returns whether the session was killed.

Parameters
sessionSession
Returns
0 not killed 1 killed

◆ srv_session_info_session_count()

unsigned int srv_session_info_session_count ( )

Returns the number opened sessions in thread initialized by srv_session service.

◆ srv_session_info_set_client_port()

int srv_session_info_set_client_port ( MYSQL_SESSION  session,
uint16_t  port 
)

Sets the client port of a session.

Note
The client port in SHOW PROCESSLIST, INFORMATION_SCHEMA.PROCESSLIST. This port is NOT shown in PERFORMANCE_SCHEMA.THREADS.
Parameters
sessionSession
portPort number
Returns
0 success 1 failure

◆ srv_session_info_set_connection_type()

int srv_session_info_set_connection_type ( MYSQL_SESSION  session,
enum enum_vio_type  type 
)

Sets the connection type of a session.

See also
enum_vio_type
Note
The type is shown in PERFORMANCE_SCHEMA.THREADS. The value is translated from the enum to a string according to
See also
vio_type_names array in vio/vio.c
Note
If NO_VIO_TYPE passed as type the call will fail.
Returns
0 success 1 failure

◆ srv_session_info_thread_count()

unsigned int srv_session_info_thread_count ( const void *  plugin)

Returns the number opened sessions in thread initialized by srv_session service.

Parameters
pluginPointer to the plugin structure, passed to the plugin over the plugin init function.

Variable Documentation

◆ srv_session_info_service

enum enum_vio_type int struct srv_session_info_service_st * srv_session_info_service