MySQL  8.0.16
Source Code Documentation
sql_admin.h
Go to the documentation of this file.
1 /* Copyright (c) 2010, 2018, 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
LEX_CSTRING m_passwd
Password for remote connection.
Definition: sql_admin.h:468
Sql_cmd_show_grants SHOW GRANTS ...
Definition: sql_admin.h:355
Sql_cmd_revoke_roles represents the REVOKE [role list] TO ...
Definition: sql_admin.h:310
Definition: parse_tree_nodes.h:3579
Definition: sql_plugin_ref.h:44
Sql_cmd_set_role(role_enum role_type_arg, const List< LEX_USER > *except_roles_arg)
Definition: sql_admin.h:230
Representation of an SQL command.
Definition: sql_cmd.h:62
Definition: my_sqlcommand.h:69
void rewrite(THD *thd)
Re-write clone statement to hide password.
Definition: sql_admin.cc:1822
Definition: parse_tree_nodes.h:3594
int get_histogram_buckets() const
Definition: sql_admin.h:111
bool operator()(const String *lhs, const String *rhs) const
Definition: sql_admin.cc:97
Sql_cmd_show represents the SHOW COLUMNS/SHOW INDEX statements.
Definition: sql_admin.h:486
A base class for CREATE/ALTER TABLE commands and friends.
Definition: sql_cmd_ddl_table.h:49
virtual enum_sql_command sql_command_code() const
Return the command code for this statement.
Definition: sql_admin.h:205
columns_set m_histogram_fields
The fields specified by the user in UPDATE/DROP HISTOGRAM.
Definition: sql_admin.h:100
Sql_cmd_clone(LEX_CSTRING data_dir)
Construct clone command for local clone.
Definition: sql_admin.h:427
Definition: my_sqlcommand.h:185
Sql_cmd_create_role represetns the CREATE ROLE ...
Definition: sql_admin.h:250
virtual bool execute(THD *thd)
Execute this SQL statement.
Definition: sql_admin.cc:2055
Histogram_command
Specifies which (if any) of the commands UPDATE HISTOGRAM or DROP HISTOGRAM that is specified after A...
Definition: sql_admin.h:68
plugin_ref m_plugin
Loaded clone plugin reference.
Definition: sql_admin.h:477
Definition: my_sqlcommand.h:189
Definition: my_sqlcommand.h:193
Sql_cmd_show(enum_sql_command sql_command)
Definition: sql_admin.h:488
Definition: keycache.h:70
struct passwd * user_info
Definition: mysqld.cc:1562
Definition: parse_tree_nodes.h:3399
virtual bool execute(THD *thd)
Execute this SQL statement.
Definition: sql_admin.cc:1679
const List< LEX_USER > * roles
Definition: sql_admin.h:311
const List< LEX_USER > * users
Definition: sql_admin.h:312
const List< LEX_USER > * roles
Definition: sql_admin.h:333
virtual bool execute(THD *thd)
Execute this SQL statement.
Definition: sql_admin.cc:1868
const List< LEX_USER > * using_users
Definition: sql_admin.h:359
Definition: parse_tree_nodes.h:3412
Sql_cmd_shutdown represents the SHUTDOWN statement.
Definition: sql_admin.h:211
LEX_CSTRING m_data_dir
Data directory for cloned data.
Definition: sql_admin.h:471
Definition: my_sqlcommand.h:188
bool handle_histogram_command(THD *thd, TABLE_LIST *table)
Definition: sql_admin.cc:1401
enum_sql_command
Definition: my_sqlcommand.h:45
bool execute_server(THD *thd)
Execute clone server.
Definition: sql_admin.cc:1784
Definition: mysql_lex_string.h:39
const List< LEX_USER > * roles
Definition: sql_admin.h:254
virtual bool execute(THD *thd)
Execute this SQL statement.
Definition: sql_admin.cc:1587
Sergei Dialog Client Authentication NULL
Definition: dialog.cc:352
Neither UPDATE or DROP histogram is specified.
Sql_cmd_drop_role represetns the DROP ROLE ...
Definition: sql_admin.h:270
bool execute(THD *thd)
Execute this SQL statement.
Definition: sql_admin.cc:1559
virtual enum_sql_command sql_command_code() const
Return the command code for this statement.
Definition: sql_admin.h:214
Representation of an SQL command.
bool update_histogram(THD *thd, TABLE_LIST *table, histograms::results_map &results)
Update one or more histograms.
Definition: sql_admin.cc:453
Clone plugin handler to convenient way to.
Definition: clone_handler.h:51
Definition: my_sqlcommand.h:190
Using this class is fraught with peril, and you need to be very careful when doing so...
Definition: sql_string.h:159
bool is_local() const
Definition: sql_admin.h:455
virtual enum_sql_command sql_command_code() const
Return the command code for this statement.
Definition: sql_admin.h:244
const LEX_USER * for_user
Definition: sql_admin.h:358
LEX_CSTRING m_user
User name for remote connection.
Definition: sql_admin.h:465
Definition: sql_admin.h:377
Definition: table.h:2339
#define DBUG_ASSERT(A)
Definition: my_dbug.h:128
static in_port_t port
Definition: testapp.c:33
virtual bool execute(THD *thd)
Execute this SQL statement.
Definition: sql_admin.cc:1974
virtual enum_sql_command sql_command_code() const
Return the command code for this statement.
Definition: sql_admin.h:398
virtual bool execute(THD *thd)
Execute this SQL statement.
Definition: sql_admin.cc:1916
const bool if_exists
Definition: sql_admin.h:331
const List< LEX_USER > * roles
Definition: sql_admin.h:289
Sql_cmd_set_role(const List< LEX_USER > *role_arg)
Definition: sql_admin.h:240
DROP HISTOGRAM ... is specified after ANALYZE TABLE.
Definition: aggregate_check.h:523
Sql_cmd_ddl_table(Alter_info *alter_info)
Definition: sql_cmd_ddl_table.cc:65
virtual bool prepare(THD *thd)
Prepare this SQL statement.
Definition: sql_admin.cc:2066
virtual bool execute(THD *thd)
Execute this SQL statement.
Definition: sql_admin.cc:1939
Histogram_command m_histogram_command
Which histogram command (if any) is specified.
Definition: sql_admin.h:97
virtual bool execute(THD *thd)
Execute this SQL statement.
Definition: sql_admin.cc:1987
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
Definition: sql_admin.h:373
Sql_cmd_revoke_roles(const List< LEX_USER > *roles_arg, const List< LEX_USER > *users_arg)
Definition: sql_admin.h:315
#define true
Definition: config_static.h:44
std::set< String *, Column_name_comparator, Memroot_allocator< String * > > columns_set
Definition: sql_admin.h:94
bool load(THD *thd)
Load clone plugin for clone server.
Definition: sql_admin.cc:1761
bool execute(THD *thd)
Execute this SQL statement.
Definition: sql_admin.cc:1510
Definition: my_sqlcommand.h:199
const List< LEX_USER > * except_roles
Definition: sql_admin.h:227
Definition: parse_tree_nodes.h:3386
virtual enum_sql_command sql_command_code() const
Return the command code for this statement.
Definition: sql_admin.h:490
virtual bool execute(THD *thd)
Execute this SQL statement.
Definition: sql_admin.cc:2000
Definition: my_sqlcommand.h:191
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:340
Sql_cmd_set_role represetns the SET ROLE ...
Definition: sql_admin.h:222
virtual enum_sql_command sql_command_code() const
Return the command code for this statement.
Definition: sql_admin.h:436
virtual bool execute(THD *thd)
Execute this SQL statement.
Definition: sql_admin.cc:1632
Alter_instance * alter_instance
Definition: sql_admin.h:389
Sql_cmd_repair_table represents the REPAIR TABLE statement.
Definition: sql_admin.h:199
Definition: my_sqlcommand.h:183
const role_enum role_type
Definition: sql_admin.h:334
const ulong m_port
Remote server port.
Definition: sql_admin.h:462
bool m_is_local
If it is local clone operation.
Definition: sql_admin.h:480
Sql_cmd_drop_role(bool ignore_errors_arg, const List< LEX_USER > *roles_arg)
Definition: sql_admin.h:277
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:286
bool execute(THD *thd)
Execute this SQL statement.
Definition: sql_admin.cc:1531
virtual bool execute(THD *thd)
Execute this SQL statement.
Definition: sql_admin.cc:2009
Sql_cmd_grant_roles represents the GRANT role-list TO ...
Definition: sql_admin.h:288
const List< LEX_USER > * role_list
Definition: sql_admin.h:226
Top-level node for the ALTER INSTANCE statement.
Definition: parse_tree_nodes.h:2537
enum alter_instance_action_enum alter_instance_action
Definition: sql_admin.h:388
Sql_cmd_clone()
Construct clone command for clone server.
Definition: sql_admin.h:410
Definition: my_sqlcommand.h:85
Sql_cmd_analyze_table represents the ANALYZE TABLE statement.
Definition: sql_admin.h:62
Sql_cmd_clone implements CLONE ...
Definition: sql_admin.h:407
virtual enum_sql_command sql_command_code() const
Return the command code for this statement.
Definition: sql_admin.h:347
Clone_handler * m_clone
Clone handle in server.
Definition: sql_admin.h:474
virtual enum_sql_command sql_command_code() const
Return the command code for this statement.
Definition: sql_admin.h:282
Data describing the table being created by CREATE TABLE or altered by ALTER TABLE.
Definition: sql_alter.h:188
virtual enum_sql_command sql_command_code() const
Return the command code for this statement.
Definition: sql_admin.h:262
alter_instance_action_enum
Definition: sql_admin.h:372
Definition: my_sqlcommand.h:91
Definition: sql_admin.h:374
role_enum
Definition: sql_admin.h:217
const bool if_not_exists
Definition: sql_admin.h:253
virtual enum_sql_command sql_command_code() const
Return the command code for this statement.
Definition: sql_admin.h:367
virtual enum_sql_command sql_command_code() const
Return the command code for this statement.
Definition: sql_admin.h:190
enum_sql_command m_sql_command
Definition: sql_admin.h:494
Definition: sql_admin.h:376
Histogram base class.
Sql_cmd_create_role(bool if_not_exists_arg, const List< LEX_USER > *roles_arg)
Definition: sql_admin.h:257
Sql_cmd_alter_instance(enum alter_instance_action_enum alter_instance_action_arg)
Definition: sql_admin.h:392
Definition: sql_admin.h:386
Histogram_command get_histogram_command() const
Definition: sql_admin.h:106
Definition: my_sqlcommand.h:92
Sql_cmd_alter_user_default_role ALTER USER ...
Definition: sql_admin.h:328
Sql_cmd_optimize_table represents the OPTIMIZE TABLE statement.
Definition: sql_admin.h:184
int m_histogram_buckets
The number of buckets specified by the user in UPDATE HISTOGRAM.
Definition: sql_admin.h:103
Definition: sql_alter_instance.h:30
enum_sql_command sql_command_code() const override
Return the command code for this statement.
Definition: sql_admin.h:84
const bool with_admin_option
Definition: sql_admin.h:291
virtual enum_sql_command sql_command_code() const
Return the command code for this statement.
Definition: sql_admin.h:175
Definition: table.h:2439
Definition: my_sqlcommand.h:192
const List< LEX_USER > * roles
Definition: sql_admin.h:274
Definition: sql_admin.h:49
bool ignore_errors
Definition: sql_admin.h:273
bool set_histogram_fields(List< String > *fields)
Set which fields to (try and) create/update or delete histogram statistics for.
Definition: sql_admin.cc:1386
const columns_set & get_histogram_fields() const
Definition: sql_admin.h:114
bool execute(THD *thd) override
Execute this SQL statement.
Definition: sql_admin.cc:1471
LEX_CSTRING m_host
Remote server IP.
Definition: sql_admin.h:459
virtual enum_sql_command sql_command_code() const
Return the command code for this statement.
Definition: sql_admin.h:302
bool drop_histogram(THD *thd, TABLE_LIST *table, histograms::results_map &results)
Drops one or more histograms.
Definition: sql_admin.cc:295
const role_enum role_type
Definition: sql_admin.h:225
unsigned long ulong
Definition: my_inttypes.h:46
virtual enum_sql_command sql_command_code() const
Return the command code for this statement.
Definition: sql_admin.h:320
#define false
Definition: config_static.h:43
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_check_table represents the CHECK TABLE statement.
Definition: sql_admin.h:169
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
Definition: my_sqlcommand.h:97
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_class.h:776
const List< LEX_USER > * users
Definition: sql_admin.h:332
const List< LEX_USER > * users
Definition: sql_admin.h:290
Sql_cmd_show_grants(const LEX_USER *for_user_arg, const List< LEX_USER > *using_users_arg)
Definition: sql_admin.h:362