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