MySQL 8.3.0
Source Code Documentation
table_session_connect.h File Reference

TABLE SESSION_CONNECT (abstract) More...

Go to the source code of this file.

Classes

struct  row_session_connect_attrs
 A row of PERFORMANCE_SCHEMA.SESSION_CONNECT_ATTRS and PERFORMANCE_SCHEMA.SESSION_ACCOUNT_CONNECT_ATTRS. More...
 
class  PFS_index_session_connect
 
class  table_session_connect
 Abstract table PERFORMANCE_SCHEMA.SESSION_CONNECT_ATTRS. More...
 

Macros

#define MAX_ATTR_NAME_CHARS   32
 
#define MAX_ATTR_VALUE_CHARS   1024
 
#define MAX_UTF8MB4_BYTES   4
 

Enumerations

enum  field_offsets { FO_PROCESS_ID , FO_ATTR_NAME , FO_ATTR_VALUE , FO_ORDINAL_POSITION }
 symbolic names for field offsets, keep in sync with field_types More...
 

Functions

bool read_nth_attr (const char *connect_attrs, uint connect_attrs_length, const CHARSET_INFO *connect_attrs_cs, uint ordinal, char *attr_name, uint max_attr_name, uint *attr_name_length, char *attr_value, uint max_attr_value, uint *attr_value_length)
 Take the nth attribute name/value pair. More...
 

Detailed Description

TABLE SESSION_CONNECT (abstract)

Macro Definition Documentation

◆ MAX_ATTR_NAME_CHARS

#define MAX_ATTR_NAME_CHARS   32

◆ MAX_ATTR_VALUE_CHARS

#define MAX_ATTR_VALUE_CHARS   1024

◆ MAX_UTF8MB4_BYTES

#define MAX_UTF8MB4_BYTES   4

Enumeration Type Documentation

◆ field_offsets

symbolic names for field offsets, keep in sync with field_types

Enumerator
FO_PROCESS_ID 
FO_ATTR_NAME 
FO_ATTR_VALUE 
FO_ORDINAL_POSITION 

Function Documentation

◆ read_nth_attr()

bool read_nth_attr ( const char *  connect_attrs,
uint  connect_attrs_length,
const CHARSET_INFO connect_attrs_cs,
uint  ordinal,
char *  attr_name,
uint  max_attr_name,
uint *  attr_name_length,
char *  attr_value,
uint  max_attr_value,
uint *  attr_value_length 
)

Take the nth attribute name/value pair.

Parse the attributes blob form the beginning, skipping the attributes whose number is lower than the one we seek. When we reach the attribute at an index we're looking for the values are copied to the output parameters. If parsing fails or no more attributes are found the function stops and returns an error code.

Parameters
connect_attrspointer to the connect attributes blob
connect_attrs_lengthlength of connect_attrs
connect_attrs_cscharacter set used to encode connect_attrs
ordinalindex of the attribute we need
[out]attr_namebuffer to receive the attribute name
max_attr_namemax size of attr_name in bytes
[out]attr_name_lengthnumber of bytes written in attr_name
[out]attr_valuebuffer to receive the attribute name
max_attr_valuemax size of attr_value in bytes
[out]attr_value_lengthnumber of bytes written in attr_value
Returns
status
Return values
truerequested attribute pair is found and copied
falseerror. Either because of parsing or too few attributes.