MySQL 8.0.39
Source Code Documentation
|
TABLE SESSION_CONNECT (abstract). More...
#include "storage/perfschema/table_session_connect.h"
#include <assert.h>
#include "my_compiler.h"
#include "my_inttypes.h"
#include "sql/field.h"
#include "sql/table.h"
#include "storage/perfschema/pfs_buffer_container.h"
Functions | |
static bool | parse_length_encoded_string (const char **ptr, char *dest, uint dest_size, uint *copied_len, const char *start_ptr, uint input_length, const CHARSET_INFO *from_cs, uint nchars_max) |
Take a length encoded string. More... | |
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... | |
TABLE SESSION_CONNECT (abstract).
|
static |
Take a length encoded string.
dest
ptr
is encoded true | parsing failed |
false | parsing succeeded |
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.
connect_attrs | pointer to the connect attributes blob | |
connect_attrs_length | length of connect_attrs | |
connect_attrs_cs | character set used to encode connect_attrs | |
ordinal | index of the attribute we need | |
[out] | attr_name | buffer to receive the attribute name |
max_attr_name | max size of attr_name in bytes | |
[out] | attr_name_length | number of bytes written in attr_name |
[out] | attr_value | buffer to receive the attribute name |
max_attr_value | max size of attr_value in bytes | |
[out] | attr_value_length | number of bytes written in attr_value |
true | requested attribute pair is found and copied |
false | error. Either because of parsing or too few attributes. |