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