MySQL 26.7.0
Source Code Documentation
sql_parse.h
Go to the documentation of this file.
1/* Copyright (c) 2006, 2026, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is designed to work 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 either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef SQL_PARSE_INCLUDED
25#define SQL_PARSE_INCLUDED
26
27#include <stddef.h>
28#include <sys/types.h>
29
30#include "lex_string.h"
31#include "my_command.h"
32#include "my_sqlcommand.h"
34#include "mysql_com.h" // enum_server_command
35#include "sql/handler.h" // enum_schema_tables
36#include "sql/system_variables.h" // System_variables
38
39struct mysql_rwlock_t;
40template <typename T>
41class SQL_I_List;
42
43/**
44 @addtogroup GROUP_PARSER
45 @{
46*/
47
48class Comp_creator;
49class Item;
51class Parser_state;
52class THD;
53class Table_ident;
54struct LEX;
55struct LEX_USER;
56struct ORDER;
57struct Parse_context;
58class Table_ref;
59union COM_DATA;
60enum class enum_sp_type;
61
62extern "C" int test_if_data_home_dir(const char *dir);
63
64bool stmt_causes_implicit_commit(const THD *thd, uint mask);
65
66#ifndef NDEBUG
68#endif
69
70bool parse_sql(THD *thd, Parser_state *parser_state,
71 Object_creation_ctx *creation_ctx);
72
73void free_items(Item *item);
74void cleanup_items(Item *item);
75void bind_fields(Item *first);
76
77Comp_creator *comp_eq_creator(bool invert);
79Comp_creator *comp_ge_creator(bool invert);
80Comp_creator *comp_gt_creator(bool invert);
81Comp_creator *comp_le_creator(bool invert);
82Comp_creator *comp_lt_creator(bool invert);
83Comp_creator *comp_ne_creator(bool invert);
84
85int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident,
86 enum enum_schema_tables schema_table_idx);
87void get_default_definer(THD *thd, LEX_USER *definer);
90bool check_string_char_length(const LEX_CSTRING &str, const char *err_msg,
91 size_t max_char_length, const CHARSET_INFO *cs,
92 bool no_error);
95 const CHARSET_INFO **to);
98 const CHARSET_INFO **to);
101bool is_update_query(enum enum_sql_command command);
102bool is_explainable_query(enum enum_sql_command command);
104
105/**
106 Return the length of a query string with trailing ';' and whitespace
107 removed. Used by alloc_query() and by callers that need to lex the same
108 trimmed-end view of a query that dispatch_command() sees, while keeping
109 their own buffer pointer (and thus byte offsets) intact.
110*/
111inline size_t trim_trailing_semicolons(const CHARSET_INFO *cs, const char *str,
112 size_t length) {
113 while (length > 0 &&
114 (str[length - 1] == ';' || my_isspace(cs, str[length - 1])))
115 length--;
116 return length;
117}
118
119bool alloc_query(THD *thd, const char *packet, size_t packet_length);
120void dispatch_sql_command(THD *thd, Parser_state *parser_state,
121 bool is_retry = false);
125 const char *db_name, const char *sp_name);
127 bool sp_did_not_exist, const char *db_name,
128 const char *sp_name);
129int mysql_execute_command(THD *thd, bool first_level = false);
130bool do_command(THD *thd);
131bool dispatch_command(THD *thd, const COM_DATA *com_data,
132 enum enum_server_command command);
133bool prepare_index_and_data_dir_path(THD *thd, const char **data_file_name,
134 const char **index_file_name,
135 const char *table_name);
136int append_file_to_dir(THD *thd, const char **filename_ptr,
137 const char *table_name);
138void execute_init_command(THD *thd, LEX_STRING *init_command,
139 mysql_rwlock_t *var_lock);
141void add_join_on(Table_ref *b, Item *expr);
143 Table_ref *right_op);
144void init_sql_command_flags(void);
147bool shutdown(THD *thd, enum mysql_enum_shutdown_level level);
148bool show_precheck(THD *thd, LEX *lex, bool lock);
150
151/* Variables */
152
153extern uint sql_command_flags[];
154
155/**
156 Map from enumeration values of type enum_server_command to
157 descriptions of type std::string.
158
159 In this context, a "command" is a type code for a remote procedure
160 call in the client-server protocol; for instance, a "connect" or a
161 "ping" or a "query".
162
163 The getter functions use @@terminology_use_previous to
164 decide which version of the name to use, for names that depend on
165 it.
166*/
168 private:
169 /**
170 Array indexed by enum_server_command, where each element is a
171 description string.
172 */
173 static const std::string m_names[];
174 /**
175 Command whose name depends on @@terminology_use_previous.
176
177 Currently, there is only one such command, so we use a single
178 member variable. In case we ever change any other command name
179 and control the use of the old or new name using
180 @@terminology_use_previous, we need to change the
181 following three members into some collection type, e.g.,
182 std::unordered_set.
183 */
185 /**
186 Name to use when compatibility is enabled.
187 */
188 static const std::string m_replace_str;
189 /**
190 The version when the name was changed.
191 */
194 /**
195 Given a system_variable object, returns the string to use for
196 m_replace_com, according to the setting of
197 terminology_use_previous stored in the object.
198
199 @param sysvars The System_variables object holding the
200 configuration that should be considered when doing the translation.
201
202 @return The instrumentation name that was in use in the configured
203 version, for m_replace_com.
204 */
205 static const std::string &translate(const System_variables &sysvars);
206 /**
207 Cast an integer to enum_server_command, and assert it is in range.
208
209 @param cmd The integer value
210 @return The enum_server_command
211 */
213 assert(cmd >= 0);
214 assert(cmd <= COM_END);
215 return static_cast<enum_server_command>(cmd);
216 }
217
218 public:
219 /**
220 Return a description string for a given enum_server_command.
221
222 This bypasses @@terminology_use_previous and acts as if
223 it was set to NONE.
224
225 @param cmd The enum_server_command
226 @retval The description string
227 */
228 static const std::string &str_notranslate(enum_server_command cmd) {
229 return m_names[cmd];
230 }
231 /**
232 Return a description string for an integer that is the numeric
233 value of an enum_server_command.
234
235 This bypasses @@terminology_use_previous and acts as if
236 it was set to NONE.
237
238 @param cmd The integer value
239 @retval The description string
240 */
241 static const std::string &str_notranslate(int cmd) {
242 return str_notranslate(int_to_cmd(cmd));
243 }
244 /**
245 Return a description string for a given enum_server_command.
246
247 This takes @@session.terminology_use_previous into
248 account, and returns an old name if one has been defined and the
249 option is enabled.
250
251 @param cmd The enum_server_command
252 @retval The description string
253 */
254 static const std::string &str_session(enum_server_command cmd);
255 /**
256 Return a description string for a given enum_server_command.
257
258 This takes @@global.terminology_use_previous into
259 account, and returns an old name if one has been defined and the
260 option is enabled.
261
262 @param cmd The enum_server_command
263 @retval The description string
264 */
265 static const std::string &str_global(enum_server_command cmd);
266 /**
267 Return a description string for an integer that is the numeric
268 value of an enum_server_command.
269
270 This takes @@session.terminology_use_previous into
271 account, and returns an old name if one has been defined and the
272 option is enabled.
273
274 @param cmd The integer value
275 @retval The description string
276 */
277 static const std::string &str_session(int cmd) {
278 return str_session(int_to_cmd(cmd));
279 }
280};
281
283
284/**
285 @brief This function checks if the sql_command is one that identifies the
286 boundaries (begin, end or savepoint) of a transaction.
287
288 @note this is used for replication purposes.
289
290 @param command The parsed SQL_COMM to check.
291 @return true if this is either a BEGIN, COMMIT, SAVEPOINT, ROLLBACK,
292 ROLLBACK_TO_SAVEPOINT.
293 @return false any other SQL command.
294 */
296
297/**
298 @brief This function checks if the sql_command is one that identifies the
299 boundaries (begin, end or savepoint) of an XA transaction. It does not
300 consider PREPARE statements.
301
302 @note this is used for replication purposes.
303
304 @param command The parsed SQL_COMM to check.
305 @return true if this is either a XA_START, XA_END, XA_COMMIT, XA_ROLLBACK.
306 @return false any other SQL command.
307 */
309
310bool all_tables_not_ok(THD *thd, Table_ref *tables);
312
313// TODO: remove after refactoring of ALTER DATABASE:
314bool set_default_charset(HA_CREATE_INFO *create_info,
315 const CHARSET_INFO *value);
316// TODO: remove after refactoring of ALTER DATABASE:
317bool set_default_collation(HA_CREATE_INFO *create_info,
318 const CHARSET_INFO *value);
319
320bool sp_process_definer(THD *);
321
322/* Bits in sql_command_flags */
323
324#define CF_CHANGES_DATA (1U << 0)
325/* The 2nd bit is unused -- it used to be CF_HAS_ROW_COUNT. */
326#define CF_STATUS_COMMAND (1U << 2)
327#define CF_SHOW_TABLE_COMMAND (1U << 3)
328#define CF_WRITE_LOGS_COMMAND (1U << 4)
329/**
330 Must be set for SQL statements that may contain
331 Item expressions and/or use joins and tables.
332 Indicates that the parse tree of such statement may
333 contain rule-based optimizations that depend on metadata
334 (i.e. number of columns in a table), and consequently
335 that the statement must be re-prepared whenever
336 referenced metadata changes. Must not be set for
337 statements that themselves change metadata, e.g. RENAME,
338 ALTER and other DDL, since otherwise will trigger constant
339 reprepare. Consequently, complex item expressions and
340 joins are currently prohibited in these statements.
341*/
342#define CF_REEXECUTION_FRAGILE (1U << 5)
343/**
344 Implicitly commit before the SQL statement is executed.
345
346 Statements marked with this flag will cause any active
347 transaction to end (commit) before proceeding with the
348 command execution.
349
350 This flag should be set for statements that probably can't
351 be rolled back or that do not expect any previously metadata
352 locked tables.
353*/
354#define CF_IMPLICIT_COMMIT_BEGIN (1U << 6)
355/**
356 Implicitly commit after the SQL statement.
357
358 Statements marked with this flag are automatically committed
359 at the end of the statement.
360
361 This flag should be set for statements that will implicitly
362 open and take metadata locks on system tables that should not
363 be carried for the whole duration of a active transaction.
364*/
365#define CF_IMPLICIT_COMMIT_END (1U << 7)
366/**
367 CF_IMPLICIT_COMMIT_BEGIN and CF_IMPLICIT_COMMIT_END are used
368 to ensure that the active transaction is implicitly committed
369 before and after every DDL statement and any statement that
370 modifies our currently non-transactional system tables.
371*/
372#define CF_AUTO_COMMIT_TRANS (CF_IMPLICIT_COMMIT_BEGIN | CF_IMPLICIT_COMMIT_END)
373
374/**
375 Diagnostic statement.
376 Diagnostic statements:
377 - SHOW WARNING
378 - SHOW ERROR
379 - GET DIAGNOSTICS (WL#2111)
380 do not modify the Diagnostics Area during execution.
381*/
382#define CF_DIAGNOSTIC_STMT (1U << 8)
383
384/**
385 Identifies statements that may generate row events
386 and that may end up in the binary log.
387*/
388#define CF_CAN_GENERATE_ROW_EVENTS (1U << 9)
389
390/**
391 Identifies statements which may deal with temporary tables and for which
392 temporary tables should be pre-opened to simplify privilege checks.
393*/
394#define CF_PREOPEN_TMP_TABLES (1U << 10)
395
396/**
397 Identifies statements for which open handlers should be closed in the
398 beginning of the statement.
399*/
400#define CF_HA_CLOSE (1U << 11)
401
402/**
403 Identifies statements that can be explained with EXPLAIN.
404*/
405#define CF_CAN_BE_EXPLAINED (1U << 12)
406
407/** Identifies statements which may generate an optimizer trace */
408#define CF_OPTIMIZER_TRACE (1U << 14)
409
410/**
411 Identifies statements that should always be disallowed in
412 read only transactions.
413*/
414#define CF_DISALLOW_IN_RO_TRANS (1U << 15)
415
416/**
417 Identifies statements and commands that can be used with Protocol Plugin
418*/
419#define CF_ALLOW_PROTOCOL_PLUGIN (1U << 16)
420
421/**
422 Identifies statements (typically DDL) which needs auto-commit mode
423 temporarily turned off.
424
425 @note This is necessary to prevent InnoDB from automatically committing
426 InnoDB transaction each time data-dictionary tables are closed
427 after being updated.
428
429 @note This is also necessary for ACL DDL, so the code which
430 saves GTID state or slave state in the system tables at the
431 commit time works correctly. This code does statement commit
432 on low-level (see System_table_access:: close_table()) and
433 thus can pre-maturely commit DDL if @@autocommit=1.
434*/
435#define CF_NEEDS_AUTOCOMMIT_OFF (1U << 17)
436
437/**
438 Identifies statements which can return rows of data columns (SELECT, SHOW ...)
439*/
440#define CF_HAS_RESULT_SET (1U << 18)
441
442/**
443 Identifies DDL statements which can be atomic.
444 Having the bit ON does not yet define an atomic.
445 The property is used both on the master and slave.
446 On the master atomicity infers the binlog and gtid_executed system table.
447 On the slave it more involves the slave info table.
448
449 @note At the momemnt of declaration the covered DDL subset coincides
450 with the of CF_NEEDS_AUTOCOMMIT_OFF.
451*/
452#define CF_POTENTIAL_ATOMIC_DDL (1U << 19)
453
454/**
455 Statement is depending on the ACL cache, which can be disabled by the
456 --skip-grant-tables server option.
457*/
458#define CF_REQUIRE_ACL_CACHE (1U << 20)
459
460/**
461 Identifies statements as SHOW commands using INFORMATION_SCHEMA system views.
462*/
463#define CF_SHOW_USES_SYSTEM_VIEW (1U << 21)
464
465/* Bits in server_command_flags */
466
467/**
468 Skip the increase of the global query id counter. Commonly set for
469 commands that are stateless (won't cause any change on the server
470 internal states). This is made obsolete as query id is incremented
471 for ping and statistics commands as well because of race condition
472 (Bug#58785).
473*/
474#define CF_SKIP_QUERY_ID (1U << 0)
475
476/**
477 Skip the increase of the number of statements that clients have
478 sent to the server. Commonly used for commands that will cause
479 a statement to be executed but the statement might have not been
480 sent by the user (ie: stored procedure).
481*/
482#define CF_SKIP_QUESTIONS (1U << 1)
483
484/**
485 1U << 16 is reserved for Protocol Plugin statements and commands
486*/
487
488/**
489 @} (end of group GROUP_PARSER)
490*/
491
492#endif /* SQL_PARSE_INCLUDED */
Map from enumeration values of type enum_server_command to descriptions of type std::string.
Definition: sql_parse.h:167
static constexpr terminology_use_previous::enum_compatibility_version m_replace_version
The version when the name was changed.
Definition: sql_parse.h:193
static enum_server_command int_to_cmd(int cmd)
Cast an integer to enum_server_command, and assert it is in range.
Definition: sql_parse.h:212
static constexpr enum_server_command m_replace_com
Command whose name depends on @terminology_use_previous.
Definition: sql_parse.h:184
static const std::string & str_notranslate(int cmd)
Return a description string for an integer that is the numeric value of an enum_server_command.
Definition: sql_parse.h:241
static const std::string & str_notranslate(enum_server_command cmd)
Return a description string for a given enum_server_command.
Definition: sql_parse.h:228
static const std::string & str_session(int cmd)
Return a description string for an integer that is the numeric value of an enum_server_command.
Definition: sql_parse.h:277
Abstract factory interface for creating comparison predicates.
Definition: item_cmpfunc.h:547
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:929
Object_creation_ctx – interface for creation context of database objects (views, stored routines,...
Definition: table.h:213
Internal state of the parser.
Definition: sql_lexer_parser_state.h:44
Simple intrusive linked list.
Definition: sql_list.h:48
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Definition: sql_lex.h:313
Definition: table.h:2958
Definition: sp_head.h:124
int test_if_data_home_dir(const char *dir)
Definition: sql_parse.cc:7064
bool check_host_name(const LEX_CSTRING &str)
Check that host name string is valid.
Definition: sql_parse.cc:7103
int mysql_execute_command(THD *thd, bool first_level=false)
Execute command saved in thd and lex->sql_command.
Definition: sql_parse.cc:3027
void execute_init_command(THD *thd, LEX_STRING *init_command, mysql_rwlock_t *var_lock)
Definition: sql_parse.cc:1242
void statement_id_to_session(THD *thd)
Definition: sql_parse.cc:5278
void add_to_list(SQL_I_List< ORDER > &list, ORDER *order)
save order by and tables in own lists.
Definition: sql_parse.cc:5746
bool is_log_table_write_query(enum enum_sql_command command)
Check if a sql command is allowed to write to log tables.
Definition: sql_parse.cc:1222
bool mysql_test_parse_for_slave(THD *thd)
Usable by the replication SQL thread only: just parse a query to know if it can be ignored because of...
Definition: sql_parse.cc:5502
bool all_tables_not_ok(THD *thd, Table_ref *tables)
Returns true if all tables should be ignored.
Definition: sql_parse.cc:296
bool prepare_index_and_data_dir_path(THD *thd, const char **data_file_name, const char **index_file_name, const char *table_name)
prepares the index and data directory path.
Definition: sql_parse.cc:6714
bool shutdown(THD *thd, enum mysql_enum_shutdown_level level)
Shutdown the mysqld server.
Definition: sql_parse.cc:2555
Comp_creator * comp_equal_creator(bool invert)
Definition: sql_parse.cc:6788
void add_automatic_sp_privileges(THD *thd, enum_sp_type sp_type, const char *db_name, const char *sp_name)
Definition: sql_parse.cc:2903
bool remove_automatic_sp_privileges(THD *thd, enum_sp_type sp_type, bool sp_did_not_exist, const char *db_name, const char *sp_name)
Definition: sql_parse.cc:2977
bool do_command(THD *thd)
Read one command from connection and execute it (query or simple command).
Definition: sql_parse.cc:1347
Comp_creator * comp_le_creator(bool invert)
Definition: sql_parse.cc:6801
bool is_normal_transaction_boundary_stmt(enum enum_sql_command command)
This function checks if the sql_command is one that identifies the boundaries (begin,...
Definition: sql_parse.cc:303
Comp_creator * comp_eq_creator(bool invert)
Definition: sql_parse.cc:6784
bool is_xa_transaction_boundary_stmt(enum enum_sql_command command)
This function checks if the sql_command is one that identifies the boundaries (begin,...
Definition: sql_parse.cc:318
bool is_explainable_query(enum enum_sql_command command)
Definition: sql_parse.cc:1212
bool show_precheck(THD *thd, LEX *lex, bool lock)
Do special checking for SHOW statements.
Definition: sql_parse.cc:5127
bool stmt_causes_implicit_commit(const THD *thd, uint mask)
Returns whether the command in thd->lex->sql_command should cause an implicit commit.
Definition: sql_parse.cc:406
const CHARSET_INFO * get_bin_collation(const CHARSET_INFO *cs)
Definition: sql_parse.cc:6546
bool sqlcom_can_generate_row_events(enum enum_sql_command command)
Definition: sql_parse.cc:1203
bool set_default_charset(HA_CREATE_INFO *create_info, const CHARSET_INFO *value)
Definition: parse_tree_nodes.cc:2600
bool some_non_temp_table_to_be_updated(THD *thd, Table_ref *tables)
Definition: sql_parse.cc:381
bool merge_sp_var_charset_and_collation(const CHARSET_INFO *charset, const CHARSET_INFO *collation, const CHARSET_INFO **to)
Definition: sql_parse.cc:7407
int append_file_to_dir(THD *thd, const char **filename_ptr, const char *table_name)
If pointer is not a null pointer, append filename to it.
Definition: sql_parse.cc:6754
LEX_USER * create_default_definer(THD *thd)
Create default definer for the specified THD.
Definition: sql_parse.cc:6934
Comp_creator * comp_gt_creator(bool invert)
Definition: sql_parse.cc:6797
bool alloc_query(THD *thd, const char *packet, size_t packet_length)
Read query from packet and store in thd->query.
Definition: sql_parse.cc:2674
void bind_fields(Item *first)
Bind Item fields to Field objects.
Definition: sql_parse.cc:1331
void create_table_set_open_action_and_adjust_tables(LEX *lex)
Set proper open mode and table type for element representing target table of CREATE TABLE statement,...
Definition: sql_parse.cc:6863
Comp_creator * comp_ne_creator(bool invert)
Definition: sql_parse.cc:6809
void turn_parser_debug_on()
enum_sp_type
enum_sp_type defines type codes of stored programs.
Definition: sql_lex.h:226
bool sp_process_definer(THD *)
Definition: sql_parse.cc:2695
int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident, enum enum_schema_tables schema_table_idx)
Create a Table_ref object for an INFORMATION_SCHEMA table.
Definition: sql_parse.cc:2612
void add_join_on(Table_ref *b, Item *expr)
Add an ON condition to the second operand of a JOIN ... ON.
Definition: sql_parse.cc:6529
Comp_creator * comp_lt_creator(bool invert)
Definition: sql_parse.cc:6805
void mysql_reset_thd_for_next_command(THD *thd)
Reset the part of THD responsible for the state of command processing.
Definition: sql_parse.cc:5190
void killall_non_super_threads(THD *thd)
Definition: sql_parse.cc:6695
bool parse_sql(THD *thd, Parser_state *parser_state, Object_creation_ctx *creation_ctx)
Transform an SQL statement into an AST that is ready for resolving, using the supplied parser state a...
Definition: sql_parse.cc:7204
bool dispatch_command(THD *thd, const COM_DATA *com_data, enum enum_server_command command)
Perform one connection-level (COM_XXXX) command.
Definition: sql_parse.cc:1752
LEX_USER * get_current_user(THD *thd, LEX_USER *user)
Returns information about user or current user.
Definition: sql_parse.cc:6956
bool is_update_query(enum enum_sql_command command)
Definition: sql_parse.cc:1207
Comp_creator * comp_ge_creator(bool invert)
Definition: sql_parse.cc:6793
size_t trim_trailing_semicolons(const CHARSET_INFO *cs, const char *str, size_t length)
Return the length of a query string with trailing ';' and whitespace removed.
Definition: sql_parse.h:111
uint sql_command_flags[]
Mark all commands that somehow changes a table.
Definition: sql_parse.cc:512
void init_sql_command_flags(void)
Definition: sql_parse.cc:515
void get_default_definer(THD *thd, LEX_USER *definer)
Set the specified definer to the default value, which is the current user in the thread.
Definition: sql_parse.cc:6891
bool set_default_collation(HA_CREATE_INFO *create_info, const CHARSET_INFO *value)
Definition: parse_tree_nodes.cc:2624
bool merge_charset_and_collation(const CHARSET_INFO *charset, const CHARSET_INFO *collation, const CHARSET_INFO **to)
(end of group Runtime_Environment)
Definition: sql_parse.cc:7393
void free_items(Item *item)
Definition: sql_parse.cc:1308
void dispatch_sql_command(THD *thd, Parser_state *parser_state, bool is_retry=false)
Parse an SQL command from a text string and pass the resulting AST to the query executor.
Definition: sql_parse.cc:5303
void cleanup_items(Item *item)
This works because items are allocated with (*THR_MALLOC)->Alloc().
Definition: sql_parse.cc:1321
bool push_new_name_resolution_context(Parse_context *pc, Table_ref *left_op, Table_ref *right_op)
Push a new name resolution context for a JOIN ... ON clause to the context stack of a query block.
Definition: sql_parse.cc:6501
bool check_string_char_length(const LEX_CSTRING &str, const char *err_msg, size_t max_char_length, const CHARSET_INFO *cs, bool no_error)
Definition: sql_parse.cc:7035
static const std::string & str_session(enum_server_command cmd)
Return a description string for a given enum_server_command.
Definition: sql_parse.cc:273
static const std::string & str_global(enum_server_command cmd)
Return a description string for a given enum_server_command.
Definition: sql_parse.cc:279
static const std::string m_replace_str
Name to use when compatibility is enabled.
Definition: sql_parse.h:188
static const std::string & translate(const System_variables &sysvars)
Given a system_variable object, returns the string to use for m_replace_com, according to the setting...
Definition: sql_parse.cc:264
static const std::string m_names[]
Array indexed by enum_server_command, where each element is a description string.
Definition: sql_parse.h:173
mysql_enum_shutdown_level
We want levels to be in growing order of hardness (because we use number comparisons).
Definition: mysql_com.h:1006
A better implementation of the UNIX ctype(3) library.
bool my_isspace(const CHARSET_INFO *cs, char ch)
Definition: m_ctype.h:591
static mi_bit_type mask[]
Definition: mi_packrec.cc:141
enum_server_command
A list of all MySQL protocol commands.
Definition: my_command.h:48
@ COM_END
Not a real command.
Definition: my_command.h:102
@ COM_REGISTER_SLAVE
Definition: my_command.h:74
enum_sql_command
Definition: my_sqlcommand.h:46
Common definition between mysql server & client.
char * user
Definition: mysqladmin.cc:67
const char * collation
Definition: audit_api_message_emit.cc:184
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1077
const std::string charset("charset")
Definition: applier_version.h:27
std::string dir
Double write files location.
Definition: buf0dblwr.cc:81
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:76
Provides atomic access in shared-exclusive modes.
Definition: shared_spin_lock.h:79
ValueType value(const std::optional< ValueType > &v)
Definition: gtid.h:83
const char * table_name
Definition: rules_table_service.cc:56
const char * db_name
Definition: rules_table_service.cc:55
enum_compatibility_version
Enumeration holding the possible values for @terminology_use_previous.
Definition: terminology_use_previous_enum.h:48
@ BEFORE_8_0_26
Use names that were in use up to 8.0.25, inclusive.
Definition: terminology_use_previous_enum.h:52
std::list< T, ut::allocator< T > > list
Specialization of list which uses ut_allocator.
Definition: ut0new.h:2728
enum_schema_tables
Definition: handler.h:946
Definition: m_ctype.h:421
Struct to hold information about the table that should be created.
Definition: handler.h:3356
Definition: table.h:2825
The LEX object currently serves three different purposes:
Definition: sql_lex.h:4021
Definition: mysql_lex_string.h:40
Definition: mysql_lex_string.h:35
Definition: table.h:298
Environment data for the contextualization phase.
Definition: parse_tree_node_base.h:422
Definition: system_variables.h:205
An instrumented rwlock structure.
Definition: mysql_rwlock_bits.h:51
Definition: com_data.h:104