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