MySQL 8.0.40
Source Code Documentation
plugin_audit.h
Go to the documentation of this file.
1/* Copyright (c) 2007, 2024, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is designed to work with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef _my_audit_h
25#define _my_audit_h
26
27/**
28 @file include/mysql/plugin_audit.h
29*/
30
32#include "plugin.h"
33#ifndef MYSQL_ABI_CHECK
34#include "m_string.h"
35#endif
37#include "my_command.h"
38#include "my_sqlcommand.h"
40
41#define MYSQL_AUDIT_INTERFACE_VERSION 0x0401
42
43/**
44 @enum mysql_event_class_t
45
46 Audit event classes.
47*/
48typedef enum {
62 /* This item must be last in the list. */
65
66/**
67 @struct st_mysql_audit
68
69 The descriptor structure that is referred from st_mysql_plugin.
70*/
72 /**
73 Interface version.
74 */
76
77 /**
78 Event occurs when the event class consumer is to be
79 disassociated from the specified THD.This would typically occur
80 before some operation which may require sleeping - such as when
81 waiting for the next query from the client.
82 */
84
85 /**
86 Invoked whenever an event occurs which is of any
87 class for which the plugin has interest.The second argument
88 indicates the specific event class and the third argument is data
89 as required for that class.
90 */
92
93 /**
94 An array of bits used to indicate what event classes
95 that this plugin wants to receive.
96 */
98};
99
100/**
101 @typedef enum_sql_command_t
102
103 SQL command type definition.
104*/
106
107/**
108 @enum mysql_event_general_subclass_t
109
110 Events for the MYSQL_AUDIT_GENERAL_CLASS event class.
111*/
112typedef enum {
113 /** occurs before emitting to the general query log. */
115 /** occurs before transmitting errors to the user. */
117 /** occurs after transmitting a resultset to the user. */
119 /** occurs after transmitting a resultset or errors */
122
123#define MYSQL_AUDIT_GENERAL_ALL \
124 (MYSQL_AUDIT_GENERAL_LOG | MYSQL_AUDIT_GENERAL_ERROR | \
125 MYSQL_AUDIT_GENERAL_RESULT | MYSQL_AUDIT_GENERAL_STATUS)
126/**
127 @struct mysql_event_general
128
129 Structure for the MYSQL_AUDIT_GENERAL_CLASS event class.
130*/
134 unsigned long general_thread_id;
139 unsigned long long general_time;
140 unsigned long long general_rows;
145};
146
147#define MYSQL_AUDIT_CONNECTION_ALL \
148 (MYSQL_AUDIT_CONNECTION_CONNECT | MYSQL_AUDIT_CONNECTION_DISCONNECT | \
149 MYSQL_AUDIT_CONNECTION_CHANGE_USER | \
150 MYSQL_AUDIT_CONNECTION_PRE_AUTHENTICATE)
151/**
152 @struct mysql_event_connection
153
154 Structure for the MYSQL_AUDIT_CONNECTION_CLASS event class.
155*/
157 /** Event subclass. */
159 /** Current status of the connection. */
161 /** Connection id. */
162 unsigned long connection_id;
163 /** User name of this connection. */
165 /** Priv user name. */
167 /** External user name. */
169 /** Proxy user used for this connection. */
171 /** Connection host. */
173 /** IP of the connection. */
175 /** Database name specified at connection time. */
177 /** Connection type:
178 - 0 Undefined
179 - 1 TCP/IP
180 - 2 Socket
181 - 3 Named pipe
182 - 4 SSL
183 - 5 Shared memory
184 */
186};
187
188/**
189@enum mysql_event_parse_subclass_t
190
191Events for MYSQL_AUDIT_PARSE_CLASS event class.
192*/
193typedef enum {
194 /** occurs before the query parsing. */
196 /** occurs after the query parsing. */
199
200#define MYSQL_AUDIT_PARSE_ALL \
201 (MYSQL_AUDIT_PARSE_PREPARSE | MYSQL_AUDIT_PARSE_POSTPARSE)
202
203typedef enum {
205 /// mysql_event_parse::flags Must be set by a plugin if the query is
206 /// rewritten.
208 /// mysql_event_parse::flags Is set by the server if the query is prepared
209 /// statement.
212
213/** Data for the MYSQL_AUDIT_PARSE events */
215 /** MYSQL_AUDIT_[PRE|POST]_PARSE event id */
217
218 /** one of FLAG_REWRITE_PLUGIN_* */
220
221 /** input: the original query text */
223
224 /** output: returns the null-terminated rewritten query allocated by
225 * my_malloc() */
227};
228
229/**
230 @enum mysql_event_authorization_subclass_t
231
232 Events for MYSQL_AUDIT_AUTHORIZATION_CLASS event class.
233*/
234typedef enum {
236 /** Occurs when database privilege is checked. */
238 /** Occurs when table privilege is checked. */
240 /** Occurs when column privilege is checked. */
242 /** Occurs when procedure privilege is checked. */
244 /** Occurs when proxy privilege is checked. */
247
248#define MYSQL_AUDIT_AUTHORIZATION_ALL \
249 (MYSQL_AUDIT_AUTHORIZATION_USER | MYSQL_AUDIT_AUTHORIZATION_DB | \
250 MYSQL_AUDIT_AUTHORIZATION_TABLE | MYSQL_AUDIT_AUTHORIZATION_COLUMN | \
251 MYSQL_AUDIT_AUTHORIZATION_PROCEDURE | MYSQL_AUDIT_AUTHORIZATION_PROXY)
252/**
253 @struct mysql_event_authorization
254
255 Structure for MYSQL_AUDIT_AUTHORIZATION_CLASS event class.
256*/
258 /** Event subclass. */
260 /** Event status. */
262 /** Connection id. */
263 unsigned int connection_id;
264 /** SQL command id. */
266 /** SQL query text. */
268 /** SQL query charset. */
270 /** Database name. */
272 /** Table name. */
274 /** Other name associated with the event. */
276 /** Requested authorization privileges. */
277 unsigned long requested_privilege;
278 /** Currently granted authorization privileges. */
279 unsigned long granted_privilege;
280};
281
282/**
283 Events for MYSQL_AUDIT_TABLE_ACCESS_CLASS event class.
284*/
286 /** Occurs when table data are read. */
288 /** Occurs when table data are inserted. */
290 /** Occurs when table data are updated. */
292 /** Occurs when table data are deleted. */
295
298
299#define MYSQL_AUDIT_TABLE_ACCESS_ALL \
300 (MYSQL_AUDIT_TABLE_ACCESS_READ | MYSQL_AUDIT_TABLE_ACCESS_INSERT | \
301 MYSQL_AUDIT_TABLE_ACCESS_UPDATE | MYSQL_AUDIT_TABLE_ACCESS_DELETE)
302
303/**
304 @struct mysql_event_table_row_access
305
306 Structure for MYSQL_AUDIT_TABLE_ACCES_CLASS event class.
307*/
309 /** Event subclass. */
311 /** Connection id. */
312 unsigned long connection_id;
313 /** SQL command id. */
315 /** SQL query. */
317 /** SQL query charset. */
319 /** Database name. */
321 /** Table name. */
323};
324
325/**
326 @enum mysql_event_global_variable_subclass_t
327
328 Events for MYSQL_AUDIT_GLOBAL_VARIABLE_CLASS event class.
329*/
330typedef enum {
331 /** Occurs when global variable is retrieved. */
333 /** Occurs when global variable is set. */
336
337#define MYSQL_AUDIT_GLOBAL_VARIABLE_ALL \
338 (MYSQL_AUDIT_GLOBAL_VARIABLE_GET | MYSQL_AUDIT_GLOBAL_VARIABLE_SET)
339
340/** Events for MYSQL_AUDIT_GLOBAL_VARIABLE_CLASS event class. */
342 /** Event subclass. */
344 /** Connection id. */
345 unsigned long connection_id;
346 /** SQL command id. */
348 /** Variable name. */
350 /** Variable value. */
352};
353
354/**
355 @enum mysql_event_server_startup_subclass_t
356
357 Events for MYSQL_AUDIT_SERVER_STARTUP_CLASS event class.
358*/
359typedef enum {
360 /** Occurs after all subsystem are initialized during system start. */
363
364#define MYSQL_AUDIT_SERVER_STARTUP_ALL (MYSQL_AUDIT_SERVER_STARTUP_STARTUP)
365
366/**
367 @struct mysql_event_server_startup
368
369 Structure for MYSQL_AUDIT_SERVER_STARTUP_CLASS event class.
370*/
372 /** Event subclass. */
374 /** Command line arguments. */
375 const char **argv;
376 /** Command line arguments count. */
377 unsigned int argc;
378};
379
380/**
381 @enum mysql_event_server_shutdown_subclass_t
382
383 Events for MYSQL_AUDIT_SERVER_SHUTDOWN_CLASS event class.
384*/
385typedef enum {
386 /** Occurs when global variable is set. */
389
390#define MYSQL_AUDIT_SERVER_SHUTDOWN_ALL (MYSQL_AUDIT_SERVER_SHUTDOWN_SHUTDOWN)
391
392/**
393 @enum mysql_server_shutdown_reason_t
394
395 Server shutdown reason.
396*/
397typedef enum {
398 /** User requested shut down. */
400 /** The server aborts. */
403
404/**
405 @struct mysql_event_server_shutdown
406
407 Structure for MYSQL_AUDIT_SERVER_SHUTDOWN_CLASS event class.
408*/
410 /** Shutdown event. */
412 /** Exit code associated with the shutdown event. */
414 /** Shutdown reason. */
416};
417
418/**
419 @enum mysql_event_command_subclass_t
420
421 Events for MYSQL_AUDIT_COMMAND_CLASS event class.
422*/
423typedef enum {
424 /** Command start event. */
426 /** Command end event. */
429
430#define MYSQL_AUDIT_COMMAND_ALL \
431 (MYSQL_AUDIT_COMMAND_START | MYSQL_AUDIT_COMMAND_END)
432/**
433 @typedef enum_server_command_t
434
435 Server command type definition.
436*/
438
439/**
440 @struct mysql_event_command
441
442 Event for MYSQL_AUDIT_COMMAND_CLASS event class.
443 Events generated as a result of RPC command requests.
444*/
446 /** Command event subclass. */
448 /** Command event status. */
450 /** Connection id. */
451 unsigned long connection_id;
452 /** Command id. */
454};
455
456/**
457 @enum mysql_event_query_subclass_t
458
459 Events for MYSQL_AUDIT_QUERY_CLASS event class.
460*/
461typedef enum {
462 /** Query start event. */
464 /** Nested query start event. */
466 /** Query post parse event. */
468 /** Nested query status end event. */
471
472#define MYSQL_AUDIT_QUERY_ALL \
473 (MYSQL_AUDIT_QUERY_START | MYSQL_AUDIT_QUERY_NESTED_START | \
474 MYSQL_AUDIT_QUERY_STATUS_END | MYSQL_AUDIT_QUERY_NESTED_STATUS_END)
475/**
476 @struct mysql_event_command
477
478 Event for MYSQL_AUDIT_COMMAND_CLASS event class.
479*/
481 /** Event subclass. */
483 /** Event status. */
485 /** Connection id. */
486 unsigned long connection_id;
487 /** SQL command id. */
489 /** SQL query. */
491 /** SQL query charset. */
493};
494
495/**
496 @enum mysql_event_stored_program_subclass_t
497
498 Events for MYSQL_AUDIT_STORED_PROGRAM_CLASS event class.
499*/
500typedef enum {
501 /** Stored program execution event. */
504
505#define MYSQL_AUDIT_STORED_PROGRAM_ALL (MYSQL_AUDIT_STORED_PROGRAM_EXECUTE)
506
507/**
508 @struct mysql_event_command
509
510Event for MYSQL_AUDIT_COMMAND_CLASS event class.
511*/
513 /** Event subclass. */
515 /** Connection id. */
516 unsigned long connection_id;
517 /** SQL command id. */
519 /** SQL query text. */
521 /** SQL query charset. */
523 /** The Database the procedure is defined in. */
525 /** Name of the stored program. */
527 /** Stored program parameters. */
529};
530
531/**
532 @enum mysql_event_authentication_subclass_t
533
534 Events for MYSQL_AUDIT_AUTHENTICATION_CLASS event class.
535
536 Event handler can not terminate an event unless stated
537 explicitly.
538*/
539typedef enum {
540 /** Generated after FLUSH PRIVILEGES */
542 /** Generated after CREATE USER | CREATE ROLE */
544 /**
545 Generated after credential change through:
546 - SET PASSWORD
547 - ALTER USER
548 - GRANT
549 */
551 /** Generated after RENAME USER */
553 /** Generated after DROP USER */
556
557#define MYSQL_AUDIT_AUTHENTICATION_ALL \
558 (MYSQL_AUDIT_AUTHENTICATION_FLUSH | \
559 MYSQL_AUDIT_AUTHENTICATION_AUTHID_CREATE | \
560 MYSQL_AUDIT_AUTHENTICATION_CREDENTIAL_CHANGE | \
561 MYSQL_AUDIT_AUTHENTICATION_AUTHID_RENAME | \
562 MYSQL_AUDIT_AUTHENTICATION_AUTHID_DROP)
563
564/**
565 @struct mysql_event_authentication
566
567 Structure for MYSQL_AUDIT_AUTHENTICATION_CLASS event class.
568*/
570 /** Event subclass. */
572 /** Event status */
574 /** Connection id. */
575 unsigned int connection_id;
576 /** SQL command id. */
578 /** SQL query text. */
580 /** SQL query charset. */
582 /** User name */
584 /** Host name */
586 /** Authentication plugin */
588 /** New user name */
590 /** New host name */
592 /** AuthorizationID type */
594};
595
596#define MYSQL_AUDIT_MESSAGE_ALL \
597 (MYSQL_AUDIT_MESSAGE_INTERNAL | MYSQL_AUDIT_MESSAGE_USER)
598
599/**
600 @struct mysql_event_message
601
602 Structure for MYSQL_AUDIT_MESSAGE_CLASS event class.
603*/
605 /** Event subclass. */
607 /** Component. */
609 /** Producer */
611 /** Message */
613 /** Key value map pointer. */
615 /** Key value map length. */
617};
618
619#endif
#define MYSQL_THD
Definition: backup_page_tracker.h:38
enum_server_command
A list of all MySQL protocol commands.
Definition: my_command.h:48
enum_sql_command
Definition: my_sqlcommand.h:46
enum enum_sql_command enum_sql_command_t
SQL command type definition.
Definition: plugin_audit.h:105
enum enum_server_command enum_server_command_t
Server command type definition.
Definition: plugin_audit.h:437
mysql_event_global_variable_subclass_t
Events for MYSQL_AUDIT_GLOBAL_VARIABLE_CLASS event class.
Definition: plugin_audit.h:330
@ MYSQL_AUDIT_GLOBAL_VARIABLE_SET
Occurs when global variable is set.
Definition: plugin_audit.h:334
@ MYSQL_AUDIT_GLOBAL_VARIABLE_GET
Occurs when global variable is retrieved.
Definition: plugin_audit.h:332
mysql_event_server_startup_subclass_t
Events for MYSQL_AUDIT_SERVER_STARTUP_CLASS event class.
Definition: plugin_audit.h:359
@ MYSQL_AUDIT_SERVER_STARTUP_STARTUP
Occurs after all subsystem are initialized during system start.
Definition: plugin_audit.h:361
mysql_event_general_subclass_t
Events for the MYSQL_AUDIT_GENERAL_CLASS event class.
Definition: plugin_audit.h:112
@ MYSQL_AUDIT_GENERAL_ERROR
occurs before transmitting errors to the user.
Definition: plugin_audit.h:116
@ MYSQL_AUDIT_GENERAL_STATUS
occurs after transmitting a resultset or errors
Definition: plugin_audit.h:120
@ MYSQL_AUDIT_GENERAL_LOG
occurs before emitting to the general query log.
Definition: plugin_audit.h:114
@ MYSQL_AUDIT_GENERAL_RESULT
occurs after transmitting a resultset to the user.
Definition: plugin_audit.h:118
mysql_event_command_subclass_t
Events for MYSQL_AUDIT_COMMAND_CLASS event class.
Definition: plugin_audit.h:423
@ MYSQL_AUDIT_COMMAND_START
Command start event.
Definition: plugin_audit.h:425
@ MYSQL_AUDIT_COMMAND_END
Command end event.
Definition: plugin_audit.h:427
mysql_event_table_access_subclass_t
Events for MYSQL_AUDIT_TABLE_ACCESS_CLASS event class.
Definition: plugin_audit.h:285
@ MYSQL_AUDIT_TABLE_ACCESS_READ
Occurs when table data are read.
Definition: plugin_audit.h:287
@ MYSQL_AUDIT_TABLE_ACCESS_DELETE
Occurs when table data are deleted.
Definition: plugin_audit.h:293
@ MYSQL_AUDIT_TABLE_ACCESS_UPDATE
Occurs when table data are updated.
Definition: plugin_audit.h:291
@ MYSQL_AUDIT_TABLE_ACCESS_INSERT
Occurs when table data are inserted.
Definition: plugin_audit.h:289
mysql_event_authentication_subclass_t
Events for MYSQL_AUDIT_AUTHENTICATION_CLASS event class.
Definition: plugin_audit.h:539
@ MYSQL_AUDIT_AUTHENTICATION_AUTHID_CREATE
Generated after CREATE USER | CREATE ROLE.
Definition: plugin_audit.h:543
@ MYSQL_AUDIT_AUTHENTICATION_AUTHID_RENAME
Generated after RENAME USER.
Definition: plugin_audit.h:552
@ MYSQL_AUDIT_AUTHENTICATION_CREDENTIAL_CHANGE
Generated after credential change through:
Definition: plugin_audit.h:550
@ MYSQL_AUDIT_AUTHENTICATION_FLUSH
Generated after FLUSH PRIVILEGES.
Definition: plugin_audit.h:541
@ MYSQL_AUDIT_AUTHENTICATION_AUTHID_DROP
Generated after DROP USER.
Definition: plugin_audit.h:554
mysql_event_authorization_subclass_t
Events for MYSQL_AUDIT_AUTHORIZATION_CLASS event class.
Definition: plugin_audit.h:234
@ MYSQL_AUDIT_AUTHORIZATION_TABLE
Occurs when table privilege is checked.
Definition: plugin_audit.h:239
@ MYSQL_AUDIT_AUTHORIZATION_PROXY
Occurs when proxy privilege is checked.
Definition: plugin_audit.h:245
@ MYSQL_AUDIT_AUTHORIZATION_COLUMN
Occurs when column privilege is checked.
Definition: plugin_audit.h:241
@ MYSQL_AUDIT_AUTHORIZATION_USER
Definition: plugin_audit.h:235
@ MYSQL_AUDIT_AUTHORIZATION_DB
Occurs when database privilege is checked.
Definition: plugin_audit.h:237
@ MYSQL_AUDIT_AUTHORIZATION_PROCEDURE
Occurs when procedure privilege is checked.
Definition: plugin_audit.h:243
mysql_event_query_subclass_t
Events for MYSQL_AUDIT_QUERY_CLASS event class.
Definition: plugin_audit.h:461
@ MYSQL_AUDIT_QUERY_START
Query start event.
Definition: plugin_audit.h:463
@ MYSQL_AUDIT_QUERY_NESTED_STATUS_END
Nested query status end event.
Definition: plugin_audit.h:469
@ MYSQL_AUDIT_QUERY_NESTED_START
Nested query start event.
Definition: plugin_audit.h:465
@ MYSQL_AUDIT_QUERY_STATUS_END
Query post parse event.
Definition: plugin_audit.h:467
mysql_event_parse_rewrite_plugin_flag
Definition: plugin_audit.h:203
@ MYSQL_AUDIT_PARSE_REWRITE_PLUGIN_QUERY_REWRITTEN
mysql_event_parse::flags Must be set by a plugin if the query is rewritten.
Definition: plugin_audit.h:207
@ MYSQL_AUDIT_PARSE_REWRITE_PLUGIN_IS_PREPARED_STATEMENT
mysql_event_parse::flags Is set by the server if the query is prepared statement.
Definition: plugin_audit.h:210
@ MYSQL_AUDIT_PARSE_REWRITE_PLUGIN_NONE
Definition: plugin_audit.h:204
mysql_event_server_shutdown_subclass_t
Events for MYSQL_AUDIT_SERVER_SHUTDOWN_CLASS event class.
Definition: plugin_audit.h:385
@ MYSQL_AUDIT_SERVER_SHUTDOWN_SHUTDOWN
Occurs when global variable is set.
Definition: plugin_audit.h:387
mysql_event_parse_subclass_t
Events for MYSQL_AUDIT_PARSE_CLASS event class.
Definition: plugin_audit.h:193
@ MYSQL_AUDIT_PARSE_POSTPARSE
occurs after the query parsing.
Definition: plugin_audit.h:197
@ MYSQL_AUDIT_PARSE_PREPARSE
occurs before the query parsing.
Definition: plugin_audit.h:195
mysql_event_class_t
Audit event classes.
Definition: plugin_audit.h:48
@ MYSQL_AUDIT_SERVER_SHUTDOWN_CLASS
Definition: plugin_audit.h:56
@ MYSQL_AUDIT_AUTHENTICATION_CLASS
Definition: plugin_audit.h:60
@ MYSQL_AUDIT_STORED_PROGRAM_CLASS
Definition: plugin_audit.h:59
@ MYSQL_AUDIT_MESSAGE_CLASS
Definition: plugin_audit.h:61
@ MYSQL_AUDIT_GENERAL_CLASS
Definition: plugin_audit.h:49
@ MYSQL_AUDIT_SERVER_STARTUP_CLASS
Definition: plugin_audit.h:55
@ MYSQL_AUDIT_PARSE_CLASS
Definition: plugin_audit.h:51
@ MYSQL_AUDIT_CLASS_MASK_SIZE
Definition: plugin_audit.h:63
@ MYSQL_AUDIT_QUERY_CLASS
Definition: plugin_audit.h:58
@ MYSQL_AUDIT_COMMAND_CLASS
Definition: plugin_audit.h:57
@ MYSQL_AUDIT_AUTHORIZATION_CLASS
Definition: plugin_audit.h:52
@ MYSQL_AUDIT_GLOBAL_VARIABLE_CLASS
Definition: plugin_audit.h:54
@ MYSQL_AUDIT_TABLE_ACCESS_CLASS
Definition: plugin_audit.h:53
@ MYSQL_AUDIT_CONNECTION_CLASS
Definition: plugin_audit.h:50
mysql_server_shutdown_reason_t
Server shutdown reason.
Definition: plugin_audit.h:397
@ MYSQL_AUDIT_SERVER_SHUTDOWN_REASON_ABORT
The server aborts.
Definition: plugin_audit.h:401
@ MYSQL_AUDIT_SERVER_SHUTDOWN_REASON_SHUTDOWN
User requested shut down.
Definition: plugin_audit.h:399
mysql_event_stored_program_subclass_t
Events for MYSQL_AUDIT_STORED_PROGRAM_CLASS event class.
Definition: plugin_audit.h:500
@ MYSQL_AUDIT_STORED_PROGRAM_EXECUTE
Stored program execution event.
Definition: plugin_audit.h:502
mysql_event_connection_subclass_t
Events for MYSQL_AUDIT_CONNECTION_CLASS event class.
Definition: plugin_audit_connection_types.h:37
mysql_event_message_subclass_t
Events for MYSQL_AUDIT_MESSAGE_CLASS event class.
Definition: plugin_audit_message_types.h:41
Definition: m_ctype.h:385
Definition: mysql_lex_string.h:40
Structure for MYSQL_AUDIT_AUTHENTICATION_CLASS event class.
Definition: plugin_audit.h:569
mysql_event_authentication_subclass_t event_subclass
Event subclass.
Definition: plugin_audit.h:571
enum_sql_command_t sql_command_id
SQL command id.
Definition: plugin_audit.h:577
bool is_role
AuthorizationID type.
Definition: plugin_audit.h:593
const CHARSET_INFO * query_charset
SQL query charset.
Definition: plugin_audit.h:581
MYSQL_LEX_CSTRING new_user
New user name.
Definition: plugin_audit.h:589
MYSQL_LEX_CSTRING query
SQL query text.
Definition: plugin_audit.h:579
MYSQL_LEX_CSTRING user
User name.
Definition: plugin_audit.h:583
MYSQL_LEX_CSTRING new_host
New host name.
Definition: plugin_audit.h:591
int status
Event status.
Definition: plugin_audit.h:573
MYSQL_LEX_CSTRING host
Host name.
Definition: plugin_audit.h:585
unsigned int connection_id
Connection id.
Definition: plugin_audit.h:575
MYSQL_LEX_CSTRING authentication_plugin
Authentication plugin.
Definition: plugin_audit.h:587
Structure for MYSQL_AUDIT_AUTHORIZATION_CLASS event class.
Definition: plugin_audit.h:257
unsigned int connection_id
Connection id.
Definition: plugin_audit.h:263
MYSQL_LEX_CSTRING database
Database name.
Definition: plugin_audit.h:271
MYSQL_LEX_CSTRING table
Table name.
Definition: plugin_audit.h:273
MYSQL_LEX_CSTRING query
SQL query text.
Definition: plugin_audit.h:267
int status
Event status.
Definition: plugin_audit.h:261
const CHARSET_INFO * query_charset
SQL query charset.
Definition: plugin_audit.h:269
unsigned long requested_privilege
Requested authorization privileges.
Definition: plugin_audit.h:277
mysql_event_authorization_subclass_t event_subclass
Event subclass.
Definition: plugin_audit.h:259
enum_sql_command_t sql_command_id
SQL command id.
Definition: plugin_audit.h:265
MYSQL_LEX_CSTRING object
Other name associated with the event.
Definition: plugin_audit.h:275
unsigned long granted_privilege
Currently granted authorization privileges.
Definition: plugin_audit.h:279
Event for MYSQL_AUDIT_COMMAND_CLASS event class.
Definition: plugin_audit.h:445
unsigned long connection_id
Connection id.
Definition: plugin_audit.h:451
enum_server_command_t command_id
Command id.
Definition: plugin_audit.h:453
int status
Command event status.
Definition: plugin_audit.h:449
mysql_event_command_subclass_t event_subclass
Command event subclass.
Definition: plugin_audit.h:447
Structure for the MYSQL_AUDIT_CONNECTION_CLASS event class.
Definition: plugin_audit.h:156
int connection_type
Connection type:
Definition: plugin_audit.h:185
MYSQL_LEX_CSTRING user
User name of this connection.
Definition: plugin_audit.h:164
MYSQL_LEX_CSTRING ip
IP of the connection.
Definition: plugin_audit.h:174
mysql_event_connection_subclass_t event_subclass
Event subclass.
Definition: plugin_audit.h:158
MYSQL_LEX_CSTRING external_user
External user name.
Definition: plugin_audit.h:168
MYSQL_LEX_CSTRING priv_user
Priv user name.
Definition: plugin_audit.h:166
MYSQL_LEX_CSTRING proxy_user
Proxy user used for this connection.
Definition: plugin_audit.h:170
MYSQL_LEX_CSTRING host
Connection host.
Definition: plugin_audit.h:172
MYSQL_LEX_CSTRING database
Database name specified at connection time.
Definition: plugin_audit.h:176
int status
Current status of the connection.
Definition: plugin_audit.h:160
unsigned long connection_id
Connection id.
Definition: plugin_audit.h:162
Structure for the MYSQL_AUDIT_GENERAL_CLASS event class.
Definition: plugin_audit.h:131
int general_error_code
Definition: plugin_audit.h:133
MYSQL_LEX_CSTRING general_external_user
Definition: plugin_audit.h:143
mysql_event_general_subclass_t event_subclass
Definition: plugin_audit.h:132
unsigned long general_thread_id
Definition: plugin_audit.h:134
unsigned long long general_time
Definition: plugin_audit.h:139
MYSQL_LEX_CSTRING general_host
Definition: plugin_audit.h:141
MYSQL_LEX_CSTRING general_user
Definition: plugin_audit.h:135
MYSQL_LEX_CSTRING general_ip
Definition: plugin_audit.h:144
MYSQL_LEX_CSTRING general_command
Definition: plugin_audit.h:136
MYSQL_LEX_CSTRING general_sql_command
Definition: plugin_audit.h:142
unsigned long long general_rows
Definition: plugin_audit.h:140
CHARSET_INFO * general_charset
Definition: plugin_audit.h:138
MYSQL_LEX_CSTRING general_query
Definition: plugin_audit.h:137
Events for MYSQL_AUDIT_GLOBAL_VARIABLE_CLASS event class.
Definition: plugin_audit.h:341
unsigned long connection_id
Connection id.
Definition: plugin_audit.h:345
mysql_event_global_variable_subclass_t event_subclass
Event subclass.
Definition: plugin_audit.h:343
MYSQL_LEX_CSTRING variable_value
Variable value.
Definition: plugin_audit.h:351
enum_sql_command_t sql_command_id
SQL command id.
Definition: plugin_audit.h:347
MYSQL_LEX_CSTRING variable_name
Variable name.
Definition: plugin_audit.h:349
Structure that stores key-value pair of the MYSQL_AUDIT_MESSAGE_CLASS event class.
Definition: plugin_audit_message_types.h:64
Structure for MYSQL_AUDIT_MESSAGE_CLASS event class.
Definition: plugin_audit.h:604
mysql_event_message_key_value_t * key_value_map
Key value map pointer.
Definition: plugin_audit.h:614
size_t key_value_map_length
Key value map length.
Definition: plugin_audit.h:616
mysql_event_message_subclass_t event_subclass
Event subclass.
Definition: plugin_audit.h:606
MYSQL_LEX_CSTRING message
Message.
Definition: plugin_audit.h:612
MYSQL_LEX_CSTRING component
Component.
Definition: plugin_audit.h:608
MYSQL_LEX_CSTRING producer
Producer.
Definition: plugin_audit.h:610
Data for the MYSQL_AUDIT_PARSE events.
Definition: plugin_audit.h:214
MYSQL_LEX_CSTRING query
input: the original query text
Definition: plugin_audit.h:222
mysql_event_parse_subclass_t event_subclass
MYSQL_AUDIT_[PRE|POST]_PARSE event id.
Definition: plugin_audit.h:216
MYSQL_LEX_CSTRING * rewritten_query
output: returns the null-terminated rewritten query allocated by my_malloc()
Definition: plugin_audit.h:226
mysql_event_parse_rewrite_plugin_flag * flags
one of FLAG_REWRITE_PLUGIN_*
Definition: plugin_audit.h:219
Definition: plugin_audit.h:480
const CHARSET_INFO * query_charset
SQL query charset.
Definition: plugin_audit.h:492
int status
Event status.
Definition: plugin_audit.h:484
mysql_event_query_subclass_t event_subclass
Event subclass.
Definition: plugin_audit.h:482
enum_sql_command_t sql_command_id
SQL command id.
Definition: plugin_audit.h:488
MYSQL_LEX_CSTRING query
SQL query.
Definition: plugin_audit.h:490
unsigned long connection_id
Connection id.
Definition: plugin_audit.h:486
Structure for MYSQL_AUDIT_SERVER_SHUTDOWN_CLASS event class.
Definition: plugin_audit.h:409
mysql_event_server_shutdown_subclass_t event_subclass
Shutdown event.
Definition: plugin_audit.h:411
int exit_code
Exit code associated with the shutdown event.
Definition: plugin_audit.h:413
mysql_server_shutdown_reason_t reason
Shutdown reason.
Definition: plugin_audit.h:415
Structure for MYSQL_AUDIT_SERVER_STARTUP_CLASS event class.
Definition: plugin_audit.h:371
unsigned int argc
Command line arguments count.
Definition: plugin_audit.h:377
const char ** argv
Command line arguments.
Definition: plugin_audit.h:375
mysql_event_server_startup_subclass_t event_subclass
Event subclass.
Definition: plugin_audit.h:373
Definition: plugin_audit.h:512
MYSQL_LEX_CSTRING query
SQL query text.
Definition: plugin_audit.h:520
MYSQL_LEX_CSTRING name
Name of the stored program.
Definition: plugin_audit.h:526
const CHARSET_INFO * query_charset
SQL query charset.
Definition: plugin_audit.h:522
enum_sql_command_t sql_command_id
SQL command id.
Definition: plugin_audit.h:518
unsigned long connection_id
Connection id.
Definition: plugin_audit.h:516
mysql_event_stored_program_subclass_t event_subclass
Event subclass.
Definition: plugin_audit.h:514
MYSQL_LEX_CSTRING database
The Database the procedure is defined in.
Definition: plugin_audit.h:524
void * parameters
Stored program parameters.
Definition: plugin_audit.h:528
Definition: plugin_audit.h:308
MYSQL_LEX_CSTRING query
SQL query.
Definition: plugin_audit.h:316
const CHARSET_INFO * query_charset
SQL query charset.
Definition: plugin_audit.h:318
mysql_event_table_access_subclass_t event_subclass
Event subclass.
Definition: plugin_audit.h:310
unsigned long connection_id
Connection id.
Definition: plugin_audit.h:312
enum_sql_command_t sql_command_id
SQL command id.
Definition: plugin_audit.h:314
MYSQL_LEX_CSTRING table_name
Table name.
Definition: plugin_audit.h:322
MYSQL_LEX_CSTRING table_database
Database name.
Definition: plugin_audit.h:320
The descriptor structure that is referred from st_mysql_plugin.
Definition: plugin_audit.h:71
unsigned long class_mask[MYSQL_AUDIT_CLASS_MASK_SIZE]
An array of bits used to indicate what event classes that this plugin wants to receive.
Definition: plugin_audit.h:97
void(* release_thd)(MYSQL_THD)
Event occurs when the event class consumer is to be disassociated from the specified THD....
Definition: plugin_audit.h:83
int(* event_notify)(MYSQL_THD, mysql_event_class_t, const void *)
Invoked whenever an event occurs which is of any class for which the plugin has interest....
Definition: plugin_audit.h:91
int interface_version
Interface version.
Definition: plugin_audit.h:75