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