1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-02 09:41:40 +03:00

WL#5571 - Audit interface: MYSQL_AUDIT_GENERAL_STATUS event

This commit is contained in:
Sergey Vojtovich
2010-12-14 17:34:23 +03:00
parent f09e9efe85
commit 9b6ba6a99a
7 changed files with 141 additions and 3 deletions

View File

@@ -42,6 +42,8 @@ struct mysql_event
LOG events occurs before emitting to the general query log.
ERROR events occur before transmitting errors to the user.
RESULT events occur after transmitting a resultset to the user.
STATUS events occur after transmitting a resultset or errors
to the user.
*/
#define MYSQL_AUDIT_GENERAL_CLASS 0
@@ -49,6 +51,7 @@ struct mysql_event
#define MYSQL_AUDIT_GENERAL_LOG 0
#define MYSQL_AUDIT_GENERAL_ERROR 1
#define MYSQL_AUDIT_GENERAL_RESULT 2
#define MYSQL_AUDIT_GENERAL_STATUS 3
struct mysql_event_general
{
@@ -68,6 +71,43 @@ struct mysql_event_general
};
/*
AUDIT CLASS : CONNECTION
CONNECT occurs after authentication phase is completed.
DISCONNECT occurs after connection is terminated.
CHANGE_USER occurs after COM_CHANGE_USER RPC is completed.
*/
#define MYSQL_AUDIT_CONNECTION_CLASS 1
#define MYSQL_AUDIT_CONNECTION_CLASSMASK (1 << MYSQL_AUDIT_CONNECTION_CLASS)
#define MYSQL_AUDIT_CONNECTION_CONNECT 0
#define MYSQL_AUDIT_CONNECTION_DISCONNECT 1
#define MYSQL_AUDIT_CONNECTION_CHANGE_USER 2
struct mysql_event_connection
{
unsigned int event_class;
unsigned int event_subclass;
int status;
unsigned long thread_id;
const char *user;
unsigned int user_length;
const char *priv_user;
unsigned int priv_user_length;
const char *external_user;
unsigned int external_user_length;
const char *proxy_user;
unsigned int proxy_user_length;
const char *host;
unsigned int host_length;
const char *ip;
unsigned int ip_length;
const char *database;
unsigned int database_length;
};
/*************************************************************************
Here we define the descriptor structure, that is referred from
st_mysql_plugin.

View File

@@ -208,6 +208,27 @@ struct mysql_event_general
unsigned long long general_time;
unsigned long long general_rows;
};
struct mysql_event_connection
{
unsigned int event_class;
unsigned int event_subclass;
int status;
unsigned long thread_id;
const char *user;
unsigned int user_length;
const char *priv_user;
unsigned int priv_user_length;
const char *external_user;
unsigned int external_user_length;
const char *proxy_user;
unsigned int proxy_user_length;
const char *host;
unsigned int host_length;
const char *ip;
unsigned int ip_length;
const char *database;
unsigned int database_length;
};
struct st_mysql_audit
{
int interface_version;