MySQL  8.0.19
Source Code Documentation
sql_admin.h
Go to the documentation of this file.
1 /* Copyright (c) 2010, 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 SQL_TABLE_MAINTENANCE_H
24 #define SQL_TABLE_MAINTENANCE_H
25 
26 #include <stddef.h>
27 #include <set>
28 
29 #include "lex_string.h"
30 #include "my_dbug.h"
31 #include "my_sqlcommand.h"
33 #include "sql/memroot_allocator.h"
34 #include "sql/sql_cmd.h" // Sql_cmd
35 #include "sql/sql_cmd_ddl_table.h" // Sql_cmd_ddl_table
36 #include "sql/sql_plugin_ref.h"
37 
38 class Clone_handler;
39 class String;
40 class THD;
41 
42 struct TABLE_LIST;
43 template <class T>
44 class List;
45 
46 struct KEY_CACHE;
47 struct LEX_USER;
48 
50  bool operator()(const String *lhs, const String *rhs) const;
51 };
52 
53 /* Must be able to hold ALTER TABLE t PARTITION BY ... KEY ALGORITHM = 1 ... */
54 #define SQL_ADMIN_MSG_TEXT_SIZE 128 * 1024
55 
56 /**
57  Sql_cmd_analyze_table represents the ANALYZE TABLE statement.
58 
59  Also this class is a base class for Sql_cmd_alter_table_analyze_partition
60  which represents the ALTER TABLE ... ANALYZE PARTITION statement.
61 */
63  public:
64  /**
65  Specifies which (if any) of the commands UPDATE HISTOGRAM or DROP HISTOGRAM
66  that is specified after ANALYZE TABLE tbl.
67  */
68  enum class Histogram_command {
69  NONE, ///< Neither UPDATE or DROP histogram is specified
70  UPDATE_HISTOGRAM, ///< UPDATE HISTOGRAM ... is specified after ANALYZE
71  ///< TABLE
72  DROP_HISTOGRAM ///< DROP HISTOGRAM ... is specified after ANALYZE TABLE
73  };
74 
75  /**
76  Constructor, used to represent a ANALYZE TABLE statement.
77  */
78  Sql_cmd_analyze_table(THD *thd, Alter_info *alter_info,
79  Histogram_command histogram_command,
80  int histogram_buckets);
81 
82  bool execute(THD *thd) override;
83 
84  enum_sql_command sql_command_code() const override { return SQLCOM_ANALYZE; }
85 
86  /**
87  Set which fields to (try and) create/update or delete histogram statistics
88  for.
89  */
90  bool set_histogram_fields(List<String> *fields);
91 
92  private:
93  using columns_set =
94  std::set<String *, Column_name_comparator, Memroot_allocator<String *>>;
95 
96  /// Which histogram command (if any) is specified
98 
99  /// The fields specified by the user in UPDATE/DROP HISTOGRAM
101 
102  /// The number of buckets specified by the user in UPDATE HISTOGRAM
104 
105  /// @return The histogram command specified, if any.
107  return m_histogram_command;
108  }
109 
110  /// @return The number of buckets specified in UPDATE HISTOGRAM.
112 
113  /// @return The fields specified in UPDATE/DROP HISTOGRAM
115 
116  /**
117  Send the result of histogram operations back to the client as a result set.
118 
119  @param thd Thread handle.
120  @param results The messages to send back to the client.
121  @param table The table the operations was performed on.
122 
123  @return false on success, true otherwise.
124  */
125  bool send_histogram_results(THD *thd, const histograms::results_map &results,
126  const TABLE_LIST *table);
127 
128  /**
129  Update one or more histograms
130 
131  This is invoked by running the command "ANALYZE TABLE tbl UPDATE HISTOGRAM
132  ON col1, col2 WITH n BUCKETS". Note that the function expects exactly one
133  table to be specified, but multiple columns can be specified.
134 
135  @param thd Thread handler.
136  @param table The table specified in ANALYZE TABLE
137  @param results A map where the results of the operations will be stored.
138 
139  @return false on success, true on error.
140  */
141  bool update_histogram(THD *thd, TABLE_LIST *table,
142  histograms::results_map &results);
143 
144  /**
145  Drops one or more histograms
146 
147  This is invoked by running the command "ANALYZE TABLE tbl DROP HISTOGRAM ON
148  col1, col2;". Note that the function expects exactly one table to be
149  specified, but multiple columns can be specified.
150 
151  @param thd Thread handler.
152  @param table The table specified in ANALYZE TABLE
153  @param results A map where the results of the operations will be stored.
154 
155  @return false on success, true on error.
156  */
157  bool drop_histogram(THD *thd, TABLE_LIST *table,
158  histograms::results_map &results);
159 
160  bool handle_histogram_command(THD *thd, TABLE_LIST *table);
161 };
162 
163 /**
164  Sql_cmd_check_table represents the CHECK TABLE statement.
165 
166  Also this is a base class of Sql_cmd_alter_table_check_partition which
167  represents the ALTER TABLE ... CHECK PARTITION statement.
168 */
170  public:
172 
173  bool execute(THD *thd);
174 
175  virtual enum_sql_command sql_command_code() const { return SQLCOM_CHECK; }
176 };
177 
178 /**
179  Sql_cmd_optimize_table represents the OPTIMIZE TABLE statement.
180 
181  Also this is a base class of Sql_cmd_alter_table_optimize_partition.
182  represents the ALTER TABLE ... CHECK PARTITION statement.
183 */
185  public:
187 
188  bool execute(THD *thd);
189 
191 };
192 
193 /**
194  Sql_cmd_repair_table represents the REPAIR TABLE statement.
195 
196  Also this is a base class of Sql_cmd_alter_table_repair_partition which
197  represents the ALTER TABLE ... REPAIR PARTITION statement.
198 */
200  public:
202 
203  bool execute(THD *thd);
204 
205  virtual enum_sql_command sql_command_code() const { return SQLCOM_REPAIR; }
206 };
207 
208 /**
209  Sql_cmd_shutdown represents the SHUTDOWN statement.
210 */
211 class Sql_cmd_shutdown : public Sql_cmd {
212  public:
213  virtual bool execute(THD *thd);
215 };
216 
218 
219 /**
220  Sql_cmd_set_role represetns the SET ROLE ... statement.
221 */
222 class Sql_cmd_set_role : public Sql_cmd {
223  friend class PT_set_role;
224 
228 
229  public:
231  const List<LEX_USER> *except_roles_arg)
232  : role_type(role_type_arg),
233  role_list(NULL),
234  except_roles(except_roles_arg) {
239  }
240  explicit Sql_cmd_set_role(const List<LEX_USER> *role_arg)
241  : role_type(role_enum::ROLE_NAME), role_list(role_arg) {}
242 
243  virtual bool execute(THD *thd);
245 };
246 
247 /**
248  Sql_cmd_create_role represetns the CREATE ROLE ... statement.
249 */
250 class Sql_cmd_create_role : public Sql_cmd {
251  friend class PT_create_role;
252 
253  const bool if_not_exists;
255 
256  public:
257  explicit Sql_cmd_create_role(bool if_not_exists_arg,
258  const List<LEX_USER> *roles_arg)
259  : if_not_exists(if_not_exists_arg), roles(roles_arg) {}
260 
261  virtual bool execute(THD *thd);
263  return SQLCOM_CREATE_ROLE;
264  }
265 };
266 
267 /**
268  Sql_cmd_drop_role represetns the DROP ROLE ... statement.
269 */
270 class Sql_cmd_drop_role : public Sql_cmd {
271  friend class PT_drop_role;
272 
275 
276  public:
277  explicit Sql_cmd_drop_role(bool ignore_errors_arg,
278  const List<LEX_USER> *roles_arg)
279  : ignore_errors(ignore_errors_arg), roles(roles_arg) {}
280 
281  virtual bool execute(THD *thd);
283 };
284 
285 /**
286  Sql_cmd_grant_roles represents the GRANT role-list TO ... statement.
287 */
288 class Sql_cmd_grant_roles : public Sql_cmd {
291  const bool with_admin_option;
292 
293  public:
294  explicit Sql_cmd_grant_roles(const List<LEX_USER> *roles_arg,
295  const List<LEX_USER> *users_arg,
296  bool with_admin_option_arg)
297  : roles(roles_arg),
298  users(users_arg),
299  with_admin_option(with_admin_option_arg) {}
300 
301  virtual bool execute(THD *thd);
303  return SQLCOM_GRANT_ROLE;
304  }
305 };
306 
307 /**
308  Sql_cmd_revoke_roles represents the REVOKE [role list] TO ... statement.
309 */
313 
314  public:
315  explicit Sql_cmd_revoke_roles(const List<LEX_USER> *roles_arg,
316  const List<LEX_USER> *users_arg)
317  : roles(roles_arg), users(users_arg) {}
318 
319  virtual bool execute(THD *thd);
321  return SQLCOM_REVOKE_ROLE;
322  }
323 };
324 
325 /**
326  Sql_cmd_alter_user_default_role ALTER USER ... DEFAULT ROLE ... statement.
327 */
330 
331  const bool if_exists;
335 
336  public:
337  explicit Sql_cmd_alter_user_default_role(bool if_exists_arg,
338  const List<LEX_USER> *users_arg,
339  const List<LEX_USER> *roles_arg,
340  const role_enum role_type_arg)
341  : if_exists(if_exists_arg),
342  users(users_arg),
343  roles(roles_arg),
344  role_type(role_type_arg) {}
345 
346  virtual bool execute(THD *thd);
349  }
350 };
351 
352 /**
353  Sql_cmd_show_grants SHOW GRANTS ... statement.
354 */
355 class Sql_cmd_show_grants : public Sql_cmd {
356  friend class PT_show_grants;
357 
360 
361  public:
362  Sql_cmd_show_grants(const LEX_USER *for_user_arg,
363  const List<LEX_USER> *using_users_arg)
364  : for_user(for_user_arg), using_users(using_users_arg) {}
365 
366  virtual bool execute(THD *thd);
368  return SQLCOM_SHOW_GRANTS;
369  }
370 };
371 
377  LAST_MASTER_KEY /* Add new master key type before this */
378 };
379 
380 /**
381  Sql_cmd_alter_instance represents the ROTATE alter_instance_action MASTER KEY
382  statement.
383 */
384 class Alter_instance;
385 
387  friend class PT_alter_instance;
390 
391  public:
393  enum alter_instance_action_enum alter_instance_action_arg)
394  : alter_instance_action(alter_instance_action_arg),
395  alter_instance(NULL) {}
396 
397  virtual bool execute(THD *thd);
399  return SQLCOM_ALTER_INSTANCE;
400  }
401 };
402 
403 /**
404  Sql_cmd_clone implements CLONE ... statement.
405 */
406 
407 class Sql_cmd_clone : public Sql_cmd {
408  public:
409  /** Construct clone command for clone server */
410  explicit Sql_cmd_clone()
411  : m_host(),
412  m_port(),
413  m_user(),
414  m_passwd(),
415  m_data_dir(),
416  m_clone(),
417  m_is_local(false) {}
418 
419  /** Construct clone command for clone client
420  @param[in] user_info user, password and remote host information
421  @param[in] port port for remote server
422  @param[in] data_dir data directory to clone */
423  explicit Sql_cmd_clone(LEX_USER *user_info, ulong port, LEX_CSTRING data_dir);
424 
425  /** Construct clone command for local clone
426  @param[in] data_dir data directory to clone */
427  explicit Sql_cmd_clone(LEX_CSTRING data_dir)
428  : m_host(),
429  m_port(),
430  m_user(),
431  m_passwd(),
432  m_data_dir(data_dir),
433  m_clone(),
434  m_is_local(true) {}
435 
436  virtual enum_sql_command sql_command_code() const { return SQLCOM_CLONE; }
437 
438  virtual bool execute(THD *thd);
439 
440  /** Execute clone server.
441  @param[in] thd server session
442  @return true, if error */
443  bool execute_server(THD *thd);
444 
445  /** Load clone plugin for clone server.
446  @param[in] thd server session
447  @return true, if error */
448  bool load(THD *thd);
449 
450  /** Re-write clone statement to hide password.
451  @param[in,out] thd server session */
452  void rewrite(THD *thd);
453 
454  /** @return true, if it is local clone command */
455  bool is_local() const { return (m_is_local); }
456 
457  private:
458  /** Remote server IP */
460 
461  /** Remote server port */
462  const ulong m_port;
463 
464  /** User name for remote connection */
466 
467  /** Password for remote connection */
469 
470  /** Data directory for cloned data */
472 
473  /** Clone handle in server */
475 
476  /** Loaded clone plugin reference */
478 
479  /** If it is local clone operation */
481 };
482 
483 /**
484  Sql_cmd_show represents the SHOW COLUMNS/SHOW INDEX statements.
485 */
486 class Sql_cmd_show : public Sql_cmd {
487  public:
488  Sql_cmd_show(enum_sql_command sql_command) : m_sql_command(sql_command) {}
489  virtual bool execute(THD *thd);
490  virtual enum_sql_command sql_command_code() const { return m_sql_command; }
491  virtual bool prepare(THD *thd);
492 
493  private:
495 };
496 #endif
Sql_cmd_check_table::execute
bool execute(THD *thd)
Execute this SQL statement.
Definition: sql_admin.cc:1564
MYSQL_LEX_CSTRING
Definition: mysql_lex_string.h:39
Sql_cmd_clone::execute_server
bool execute_server(THD *thd)
Execute clone server.
Definition: sql_admin.cc:1861
THD
Definition: sql_class.h:764
histograms::results_map
std::map< std::string, Message, std::less< std::string >, Histogram_key_allocator< std::pair< const std::string, Message > >> results_map
Definition: histogram.h:112
Sql_cmd_ddl_table
A base class for CREATE/ALTER TABLE commands and friends.
Definition: sql_cmd_ddl_table.h:49
memroot_allocator.h
Sql_cmd_create_role::if_not_exists
const bool if_not_exists
Definition: sql_admin.h:253
Sql_cmd_grant_roles::execute
virtual bool execute(THD *thd)
Execute this SQL statement.
Definition: sql_admin.cc:2054
Sql_cmd_clone::m_is_local
bool m_is_local
If it is local clone operation.
Definition: sql_admin.h:480
Alter_info
Data describing the table being created by CREATE TABLE or altered by ALTER TABLE.
Definition: sql_alter.h:189
NULL
#define NULL
Definition: types.h:55
user_info
PasswdValue user_info
Definition: mysqld.cc:1651
SQLCOM_SHUTDOWN
@ SQLCOM_SHUTDOWN
Definition: my_sqlcommand.h:183
Sql_cmd_repair_table
Sql_cmd_repair_table represents the REPAIR TABLE statement.
Definition: sql_admin.h:199
Sql_cmd_alter_user_default_role::sql_command_code
virtual enum_sql_command sql_command_code() const
Return the command code for this statement.
Definition: sql_admin.h:347
Sql_cmd_revoke_roles
Sql_cmd_revoke_roles represents the REVOKE [role list] TO ...
Definition: sql_admin.h:310
Sql_cmd_alter_instance::execute
virtual bool execute(THD *thd)
Execute this SQL statement.
Definition: sql_admin.cc:1686
histogram.h
Sql_cmd_clone::execute
virtual bool execute(THD *thd)
Execute this SQL statement.
Definition: sql_admin.cc:1733
my_sqlcommand.h
Sql_cmd_clone::m_clone
Clone_handler * m_clone
Clone handle in server.
Definition: sql_admin.h:474
Sql_cmd_clone::is_local
bool is_local() const
Definition: sql_admin.h:455
Sql_cmd_analyze_table::get_histogram_fields
const columns_set & get_histogram_fields() const
Definition: sql_admin.h:114
Sql_cmd_set_role::role_type
const role_enum role_type
Definition: sql_admin.h:225
Sql_cmd_alter_user_default_role::users
const List< LEX_USER > * users
Definition: sql_admin.h:332
my_dbug.h
Sql_cmd_set_role::except_roles
const List< LEX_USER > * except_roles
Definition: sql_admin.h:227
role_enum::ROLE_DEFAULT
@ ROLE_DEFAULT
String
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:164
Sql_cmd_show::prepare
virtual bool prepare(THD *thd)
Prepare this SQL statement.
Definition: sql_admin.cc:2138
Sql_cmd_analyze_table::Histogram_command::NONE
@ NONE
Neither UPDATE or DROP histogram is specified.
Sql_cmd_set_role::Sql_cmd_set_role
Sql_cmd_set_role(role_enum role_type_arg, const List< LEX_USER > *except_roles_arg)
Definition: sql_admin.h:230
Sql_cmd_check_table::sql_command_code
virtual enum_sql_command sql_command_code() const
Return the command code for this statement.
Definition: sql_admin.h:175
SQLCOM_ALTER_INSTANCE
@ SQLCOM_ALTER_INSTANCE
Definition: my_sqlcommand.h:185
Sql_cmd_create_role::execute
virtual bool execute(THD *thd)
Execute this SQL statement.
Definition: sql_admin.cc:1946
SQLCOM_REPAIR
@ SQLCOM_REPAIR
Definition: my_sqlcommand.h:85
Sql_cmd_drop_role::Sql_cmd_drop_role
Sql_cmd_drop_role(bool ignore_errors_arg, const List< LEX_USER > *roles_arg)
Definition: sql_admin.h:277
Sql_cmd_analyze_table::m_histogram_fields
columns_set m_histogram_fields
The fields specified by the user in UPDATE/DROP HISTOGRAM.
Definition: sql_admin.h:100
LEX_USER
Definition: table.h:2366
role_enum::ROLE_NAME
@ ROLE_NAME
Sql_cmd_revoke_roles::Sql_cmd_revoke_roles
Sql_cmd_revoke_roles(const List< LEX_USER > *roles_arg, const List< LEX_USER > *users_arg)
Definition: sql_admin.h:315
role_enum::ROLE_NONE
@ ROLE_NONE
true
#define true
Definition: config_static.h:44
Sql_cmd_drop_role::roles
const List< LEX_USER > * roles
Definition: sql_admin.h:274
Sql_cmd_optimize_table
Sql_cmd_optimize_table represents the OPTIMIZE TABLE statement.
Definition: sql_admin.h:184
Sql_cmd_alter_instance::sql_command_code
virtual enum_sql_command sql_command_code() const
Return the command code for this statement.
Definition: sql_admin.h:398
Sql_cmd_show_grants::Sql_cmd_show_grants
Sql_cmd_show_grants(const LEX_USER *for_user_arg, const List< LEX_USER > *using_users_arg)
Definition: sql_admin.h:362
role_enum::ROLE_ALL
@ ROLE_ALL
role_enum
role_enum
Definition: sql_admin.h:217
Sql_cmd_create_role::roles
const List< LEX_USER > * roles
Definition: sql_admin.h:254
Sql_cmd_analyze_table::Sql_cmd_analyze_table
Sql_cmd_analyze_table(THD *thd, Alter_info *alter_info, Histogram_command histogram_command, int histogram_buckets)
Constructor, used to represent a ANALYZE TABLE statement.
Definition: sql_admin.cc:289
sql_cmd.h
SQLCOM_CHECK
@ SQLCOM_CHECK
Definition: my_sqlcommand.h:92
Column_name_comparator
Definition: sql_admin.h:49
Sql_cmd_analyze_table::send_histogram_results
bool send_histogram_results(THD *thd, const histograms::results_map &results, const TABLE_LIST *table)
Send the result of histogram operations back to the client as a result set.
Definition: sql_admin.cc:343
Sql_cmd_grant_roles::sql_command_code
virtual enum_sql_command sql_command_code() const
Return the command code for this statement.
Definition: sql_admin.h:302
Sql_cmd_show::Sql_cmd_show
Sql_cmd_show(enum_sql_command sql_command)
Definition: sql_admin.h:488
ALTER_INSTANCE_RELOAD_TLS_ROLLBACK_ON_ERROR
@ ALTER_INSTANCE_RELOAD_TLS_ROLLBACK_ON_ERROR
Definition: sql_admin.h:375
Sql_cmd_revoke_roles::execute
virtual bool execute(THD *thd)
Execute this SQL statement.
Definition: sql_admin.cc:2066
Sql_cmd_revoke_roles::roles
const List< LEX_USER > * roles
Definition: sql_admin.h:311
PT_alter_instance
Top-level node for the ALTER INSTANCE statement.
Definition: parse_tree_nodes.h:2025
Sql_cmd_shutdown::sql_command_code
virtual enum_sql_command sql_command_code() const
Return the command code for this statement.
Definition: sql_admin.h:214
Sql_cmd_revoke_roles::users
const List< LEX_USER > * users
Definition: sql_admin.h:312
Sql_cmd_alter_instance::Sql_cmd_alter_instance
Sql_cmd_alter_instance(enum alter_instance_action_enum alter_instance_action_arg)
Definition: sql_admin.h:392
PT_alter_user_default_role
Definition: parse_tree_nodes.h:3005
Sql_cmd_repair_table::execute
bool execute(THD *thd)
Execute this SQL statement.
Definition: sql_admin.cc:1613
Sql_cmd_grant_roles::with_admin_option
const bool with_admin_option
Definition: sql_admin.h:291
ROTATE_INNODB_MASTER_KEY
@ ROTATE_INNODB_MASTER_KEY
Definition: sql_admin.h:373
Sql_cmd_analyze_table::m_histogram_command
Histogram_command m_histogram_command
Which histogram command (if any) is specified.
Definition: sql_admin.h:97
KEY_CACHE
Definition: keycache.h:70
Sql_cmd_clone::load
bool load(THD *thd)
Load clone plugin for clone server.
Definition: sql_admin.cc:1838
Sql_cmd_create_role
Sql_cmd_create_role represetns the CREATE ROLE ...
Definition: sql_admin.h:250
Sql_cmd_alter_user_default_role
Sql_cmd_alter_user_default_role ALTER USER ...
Definition: sql_admin.h:328
Sql_cmd_analyze_table::columns_set
std::set< String *, Column_name_comparator, Memroot_allocator< String * > > columns_set
Definition: sql_admin.h:94
LAST_MASTER_KEY
@ LAST_MASTER_KEY
Definition: sql_admin.h:377
Sql_cmd_clone::rewrite
void rewrite(THD *thd)
Re-write clone statement to hide password.
Definition: sql_admin.cc:1899
Sql_cmd_analyze_table::drop_histogram
bool drop_histogram(THD *thd, TABLE_LIST *table, histograms::results_map &results)
Drops one or more histograms.
Definition: sql_admin.cc:298
Sql_cmd_show::execute
virtual bool execute(THD *thd)
Execute this SQL statement.
Definition: sql_admin.cc:2127
Sql_cmd_ddl_table::Sql_cmd_ddl_table
Sql_cmd_ddl_table(Alter_info *alter_info)
Definition: sql_cmd_ddl_table.cc:65
enum_sql_command
enum_sql_command
Definition: my_sqlcommand.h:45
lex_string.h
Sql_cmd_analyze_table
Sql_cmd_analyze_table represents the ANALYZE TABLE statement.
Definition: sql_admin.h:62
Sql_cmd_alter_user_default_role::execute
virtual bool execute(THD *thd)
Execute this SQL statement.
Definition: sql_admin.cc:2078
Sql_cmd_clone
Sql_cmd_clone implements CLONE ...
Definition: sql_admin.h:407
Sql_cmd_show
Sql_cmd_show represents the SHOW COLUMNS/SHOW INDEX statements.
Definition: sql_admin.h:486
Sql_cmd_show_grants::using_users
const List< LEX_USER > * using_users
Definition: sql_admin.h:359
Sql_cmd
Representation of an SQL command.
Definition: sql_cmd.h:63
Sql_cmd_check_table
Sql_cmd_check_table represents the CHECK TABLE statement.
Definition: sql_admin.h:169
Sql_cmd_clone::sql_command_code
virtual enum_sql_command sql_command_code() const
Return the command code for this statement.
Definition: sql_admin.h:436
Sql_cmd_clone::m_host
LEX_CSTRING m_host
Remote server IP.
Definition: sql_admin.h:459
Sql_cmd_grant_roles::Sql_cmd_grant_roles
Sql_cmd_grant_roles(const List< LEX_USER > *roles_arg, const List< LEX_USER > *users_arg, bool with_admin_option_arg)
Definition: sql_admin.h:294
port
static in_port_t port
Definition: testapp.c:33
TABLE_LIST
Definition: table.h:2467
Sql_cmd_show::m_sql_command
enum_sql_command m_sql_command
Definition: sql_admin.h:494
PT_drop_role
Definition: parse_tree_nodes.h:2871
Sql_cmd_alter_user_default_role::roles
const List< LEX_USER > * roles
Definition: sql_admin.h:333
Sql_cmd_analyze_table::handle_histogram_command
bool handle_histogram_command(THD *thd, TABLE_LIST *table)
Definition: sql_admin.cc:1449
SQLCOM_ALTER_USER_DEFAULT_ROLE
@ SQLCOM_ALTER_USER_DEFAULT_ROLE
Definition: my_sqlcommand.h:193
Sql_cmd_optimize_table::execute
bool execute(THD *thd)
Execute this SQL statement.
Definition: sql_admin.cc:1585
Sql_cmd_clone::m_user
LEX_CSTRING m_user
User name for remote connection.
Definition: sql_admin.h:465
Sql_cmd_clone::m_plugin
plugin_ref m_plugin
Loaded clone plugin reference.
Definition: sql_admin.h:477
Sql_cmd_analyze_table::Histogram_command
Histogram_command
Specifies which (if any) of the commands UPDATE HISTOGRAM or DROP HISTOGRAM that is specified after A...
Definition: sql_admin.h:68
PT_show_grants
Definition: parse_tree_nodes.h:3017
Sql_cmd_show_grants
Sql_cmd_show_grants SHOW GRANTS ...
Definition: sql_admin.h:355
Clone_handler
Clone plugin handler to convenient way to.
Definition: clone_handler.h:52
Sql_cmd_analyze_table::set_histogram_fields
bool set_histogram_fields(List< String > *fields)
Set which fields to (try and) create/update or delete histogram statistics for.
Definition: sql_admin.cc:1434
Sql_cmd_grant_roles::users
const List< LEX_USER > * users
Definition: sql_admin.h:290
SQLCOM_GRANT_ROLE
@ SQLCOM_GRANT_ROLE
Definition: my_sqlcommand.h:191
Sql_cmd_clone::m_data_dir
LEX_CSTRING m_data_dir
Data directory for cloned data.
Definition: sql_admin.h:471
Sql_cmd_analyze_table::execute
bool execute(THD *thd) override
Execute this SQL statement.
Definition: sql_admin.cc:1525
Sql_cmd_alter_user_default_role::role_type
const role_enum role_type
Definition: sql_admin.h:334
Sql_cmd_analyze_table::sql_command_code
enum_sql_command sql_command_code() const override
Return the command code for this statement.
Definition: sql_admin.h:84
Sql_cmd_set_role::Sql_cmd_set_role
Sql_cmd_set_role(const List< LEX_USER > *role_arg)
Definition: sql_admin.h:240
Sql_cmd_drop_role
Sql_cmd_drop_role represetns the DROP ROLE ...
Definition: sql_admin.h:270
Sql_cmd_set_role::sql_command_code
virtual enum_sql_command sql_command_code() const
Return the command code for this statement.
Definition: sql_admin.h:244
alter_instance_action_enum
alter_instance_action_enum
Definition: sql_admin.h:372
SQLCOM_DROP_ROLE
@ SQLCOM_DROP_ROLE
Definition: my_sqlcommand.h:189
Sql_cmd_set_role
Sql_cmd_set_role represetns the SET ROLE ...
Definition: sql_admin.h:222
Sql_cmd_create_role::Sql_cmd_create_role
Sql_cmd_create_role(bool if_not_exists_arg, const List< LEX_USER > *roles_arg)
Definition: sql_admin.h:257
SQLCOM_CREATE_ROLE
@ SQLCOM_CREATE_ROLE
Definition: my_sqlcommand.h:188
DBUG_ASSERT
#define DBUG_ASSERT(A)
Definition: my_dbug.h:197
Sql_cmd_show_grants::for_user
const LEX_USER * for_user
Definition: sql_admin.h:358
Alter_instance
Definition: sql_alter_instance.h:30
Sql_cmd_clone::Sql_cmd_clone
Sql_cmd_clone(LEX_CSTRING data_dir)
Construct clone command for local clone.
Definition: sql_admin.h:427
ROTATE_BINLOG_MASTER_KEY
@ ROTATE_BINLOG_MASTER_KEY
Definition: sql_admin.h:376
Sql_cmd_analyze_table::update_histogram
bool update_histogram(THD *thd, TABLE_LIST *table, histograms::results_map &results)
Update one or more histograms.
Definition: sql_admin.cc:458
Sql_cmd_analyze_table::get_histogram_buckets
int get_histogram_buckets() const
Definition: sql_admin.h:111
Sql_cmd_alter_instance::alter_instance_action
enum alter_instance_action_enum alter_instance_action
Definition: sql_admin.h:388
Sql_cmd_clone::m_passwd
LEX_CSTRING m_passwd
Password for remote connection.
Definition: sql_admin.h:468
Sql_cmd_drop_role::ignore_errors
bool ignore_errors
Definition: sql_admin.h:273
Sql_cmd_set_role::execute
virtual bool execute(THD *thd)
Execute this SQL statement.
Definition: sql_admin.cc:2019
Sql_cmd_clone::Sql_cmd_clone
Sql_cmd_clone()
Construct clone command for clone server.
Definition: sql_admin.h:410
Sql_cmd_alter_instance::alter_instance
Alter_instance * alter_instance
Definition: sql_admin.h:389
PT_set_role
Definition: parse_tree_nodes.h:2881
Sql_cmd_shutdown::execute
virtual bool execute(THD *thd)
Execute this SQL statement.
Definition: sql_admin.cc:1641
Sql_cmd_revoke_roles::sql_command_code
virtual enum_sql_command sql_command_code() const
Return the command code for this statement.
Definition: sql_admin.h:320
Sql_cmd_clone::m_port
const ulong m_port
Remote server port.
Definition: sql_admin.h:462
Sql_cmd_alter_user_default_role::Sql_cmd_alter_user_default_role
Sql_cmd_alter_user_default_role(bool if_exists_arg, const List< LEX_USER > *users_arg, const List< LEX_USER > *roles_arg, const role_enum role_type_arg)
Definition: sql_admin.h:337
SQLCOM_CLONE
@ SQLCOM_CLONE
Definition: my_sqlcommand.h:199
Sql_cmd_grant_roles::roles
const List< LEX_USER > * roles
Definition: sql_admin.h:289
Sql_cmd_analyze_table::get_histogram_command
Histogram_command get_histogram_command() const
Definition: sql_admin.h:106
ulong
unsigned long ulong
Definition: my_inttypes.h:48
Sql_cmd_set_role::role_list
const List< LEX_USER > * role_list
Definition: sql_admin.h:226
SQLCOM_OPTIMIZE
@ SQLCOM_OPTIMIZE
Definition: my_sqlcommand.h:91
List
Definition: aggregate_check.h:523
ALTER_INSTANCE_RELOAD_TLS
@ ALTER_INSTANCE_RELOAD_TLS
Definition: sql_admin.h:374
Sql_cmd_show_grants::sql_command_code
virtual enum_sql_command sql_command_code() const
Return the command code for this statement.
Definition: sql_admin.h:367
Sql_cmd_drop_role::sql_command_code
virtual enum_sql_command sql_command_code() const
Return the command code for this statement.
Definition: sql_admin.h:282
Sql_cmd_shutdown
Sql_cmd_shutdown represents the SHUTDOWN statement.
Definition: sql_admin.h:211
Sql_cmd_analyze_table::Histogram_command::UPDATE_HISTOGRAM
@ UPDATE_HISTOGRAM
UPDATE HISTOGRAM ...
SQLCOM_ANALYZE
@ SQLCOM_ANALYZE
Definition: my_sqlcommand.h:97
Sql_cmd_show::sql_command_code
virtual enum_sql_command sql_command_code() const
Return the command code for this statement.
Definition: sql_admin.h:490
Sql_cmd_grant_roles
Sql_cmd_grant_roles represents the GRANT role-list TO ...
Definition: sql_admin.h:288
Sql_cmd_repair_table::sql_command_code
virtual enum_sql_command sql_command_code() const
Return the command code for this statement.
Definition: sql_admin.h:205
Sql_cmd_show_grants::execute
virtual bool execute(THD *thd)
Execute this SQL statement.
Definition: sql_admin.cc:2087
Sql_cmd_create_role::sql_command_code
virtual enum_sql_command sql_command_code() const
Return the command code for this statement.
Definition: sql_admin.h:262
Sql_cmd_alter_instance
Definition: sql_admin.h:386
Column_name_comparator::operator()
bool operator()(const String *lhs, const String *rhs) const
Definition: sql_admin.cc:100
SQLCOM_SET_ROLE
@ SQLCOM_SET_ROLE
Definition: my_sqlcommand.h:190
Sql_cmd_alter_user_default_role::if_exists
const bool if_exists
Definition: sql_admin.h:331
SQLCOM_SHOW_GRANTS
@ SQLCOM_SHOW_GRANTS
Definition: my_sqlcommand.h:69
SQLCOM_REVOKE_ROLE
@ SQLCOM_REVOKE_ROLE
Definition: my_sqlcommand.h:192
Sql_cmd_analyze_table::Histogram_command::DROP_HISTOGRAM
@ DROP_HISTOGRAM
DROP HISTOGRAM ... is specified after ANALYZE TABLE.
sql_cmd_ddl_table.h
Sql_cmd_drop_role::execute
virtual bool execute(THD *thd)
Execute this SQL statement.
Definition: sql_admin.cc:1997
sql_plugin_ref.h
PT_create_role
Definition: parse_tree_nodes.h:2861
st_plugin_int
Definition: sql_plugin_ref.h:44
Sql_cmd_optimize_table::sql_command_code
virtual enum_sql_command sql_command_code() const
Return the command code for this statement.
Definition: sql_admin.h:190
Sql_cmd_analyze_table::m_histogram_buckets
int m_histogram_buckets
The number of buckets specified by the user in UPDATE HISTOGRAM.
Definition: sql_admin.h:103
false
#define false
Definition: config_static.h:43