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