Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
3.3.1
-
None
Description
Currently the API functions mysql_session_track_get_first/get_next() provide access to session tracking data sent by server in it's OK packet.
It would be more convenient to offer the possibility to register a callback function, which will be called if the server sends session track information to the client.
Callback function:
void session_track_cb(void *userdata, enum enum_session_state_type type, |
char *val1, size_t len1, char *val2, size_t len2) |
{
|
switch (type) { |
case SESSION_TRACK_SCHEMA: |
printf("New schema: %.*s\n", len1, val1); |
break; |
case SESSION_TRACK_SYSTEM_VARIABLES: |
printf("Variable: "%.*s Value: %.*s\n", len1, val1, len2, val2); |
break; |
}
|
}
|
Registering the callback function:
if (mysql_optionsv(handle, MARIADB_OPT_SESSION_TRACK_CALLBACK, session_track_cb, data)) |
{
|
printf("Error: %s\n", mysql_error(handle)); |
}
|
Attachments
Issue Links
- blocks
-
CONPY-210 Disallow changing client_character set
- Closed