MySQL 9.1.0
Source Code Documentation
statement.h
Go to the documentation of this file.
1/* Copyright (c) 2023, 2024, Oracle and/or its affiliates.
2
3This program is free software; you can redistribute it and/or modify
4it under the terms of the GNU General Public License, version 2.0,
5as published by the Free Software Foundation.
6
7This program is designed to work with certain software (including
8but not limited to OpenSSL) that is licensed under separate terms,
9as designated in a particular file or component or in included license
10documentation. The authors of MySQL hereby grant you an additional
11permission to link the program and your derivative works with the
12separately licensed software that they have either included with
13the program or referenced in the documentation.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License, version 2.0, for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef RUN_COMMAND_H
25#define RUN_COMMAND_H
26
27#include <cstddef>
28#include <forward_list>
29#include <new>
30#include <string>
31#include <string_view>
32
33#include "lex_string.h"
34#include "my_alloc.h"
35#include "my_inttypes.h"
36#include "mysql_time.h"
37#include "sql/current_thd.h"
38#include "sql/sql_class.h"
39#include "sql/sql_cursor.h"
40#include "sql/sql_prepare.h" // Prepared_statement
43#include "utils.h"
44
45/**
46 There must be one function of this kind in order for the symbols in the
47 server's dynamic library to be visible to components.
48*/
50
51/// Max limit for Regular Statement Handles in use.
52static constexpr unsigned short MAX_REGULAR_STATEMENT_HANDLES_LIMIT{1024};
53
54/**
55 Number of PSI_statement_info instruments for Statement handles.
56*/
57#define STMT_HANDLE_PSI_STATEMENT_INFO_COUNT 6
58
59#ifdef HAVE_PSI_INTERFACE
60/**
61 Initializes Statement Handles PFS statement instrumentation information
62 instances.
63*/
65#endif
66
67/**
68 * @brief Statement_handle is similar to Ed_connection. Some of the
69 * limitations in Ed_connection is that,
70 * - It does not support reading result metadata
71 * - It does not support prepared statement, parameters and cursors.
72 *
73 * Above limitation leads to implementation of this interface.
74 *
75 * Statement_handle supports both execution of regular and
76 * prepared statement.
77 *
78 * Note that we can get rid of Ed_connection implementation
79 * as we support more functionality with Statement_handle.
80 */
82 public:
83 Statement_handle(THD *thd, const char *query, size_t length);
84
85 /**
86 * @brief Check if error is reported.
87 *
88 * @return true of error is reported.
89 */
90 bool is_error() const { return m_diagnostics_area->is_error(); }
91
92 /**
93 * @brief Check if error is reported.
94 *
95 * @return true of error is reported.
96 */
98 assert(is_error());
103 }
104
105 /**
106 * @brief Get the last mysql errno.
107 *
108 * @return unsigned int
109 */
110 unsigned int get_last_errno() const {
111 assert(is_error());
113 }
114
115 /**
116 * @brief Get the mysql error state.
117 *
118 * @return const char*
119 */
121 assert(is_error());
126 }
127
128 /**
129 * @brief Get number of warnings generated.
130 *
131 * @return ulonglong
132 */
134
135 /**
136 * @brief Get list of all warnings.
137 *
138 * @return Warning*
139 */
141
142 /**
143 * @brief Get the next result sets generated while executing the statement.
144 *
145 * @return Result_set*
146 */
148
149 /**
150 * @brief Get the current result set object
151 *
152 * @return Result_set*
153 */
155
156 /**
157 * @brief Make the next result set the current result set.
158 * We do it once we have read the current result set.
159 *
160 */
162 auto next_rset = m_current_rset->get_next();
163 m_current_rset = next_rset;
164 }
165
166 /**
167 * @brief Execute the SQL command.
168 * This can be either Regular or Prepared statement.
169 *
170 * @return true upon failure.
171 * @return false upon success.
172 */
173 virtual bool execute() = 0;
174
175 /**
176 * @brief Check if we are processing a prepared statement.
177 *
178 * @return true upon failure.
179 * @return false upon success.
180 */
181 virtual bool is_prepared_statement() = 0;
182
183 /**
184 * @brief Check if the statement has been executed or prepared
185 *
186 * @return true upon executed or prepared
187 * @return false otherwise
188 */
189 virtual bool is_executed_or_prepared() = 0;
190
191 /**
192 * @brief Feel all the result collected so far, from query execution.
193 *
194 */
195 void free_old_result();
196
197 /**
198 * @brief Get the query string being executed.
199 *
200 * @return std::string_view
201 */
202 std::string_view get_query() { return m_query; }
203
204 /**
205 * @brief Set the capacity in bytes allowed for caching results.
206 *
207 * @param capacity of the result set
208 */
209 void set_capacity(size_t capacity) {
211 }
212
213 /**
214 * @brief Get the capacity in bytes allowed for caching results.
215 *
216 * @return size_t
217 */
219
220 /**
221 * @brief Set thd protocol to enable result pass through.
222 *
223 * @param use_thd_protocol - parameter that decides if THD protocol should be
224 * used
225 */
226 void set_use_thd_protocol(bool use_thd_protocol) {
227 m_use_thd_protocol = use_thd_protocol;
228 }
229
230 /**
231 * @brief Check if thd protocol is used.
232 *
233 * @return true if enabled.
234 * @return false if not.
235 */
237
238 /**
239 * @brief Set either Protocol_local_v2 when m_use_thd_protocol is not set or
240 * or classical protocol when m_use_thd_protocol is set to THD.
241 */
242 void set_thd_protocol();
243
244 /**
245 * @brief Reset THD protocol.
246 */
247 void reset_thd_protocol();
248
249 /**
250 * @brief Set the expected charset
251 *
252 * @param charset_name Name of the charset
253 */
254 void set_expected_charset(const char *charset_name) {
256 get_charset_by_csname(charset_name, MY_CS_PRIMARY, MYF(0));
257 }
258
259 /**
260 * @brief Get the expected charset
261 *
262 * @return const char* the expected charset name
263 */
264 const char *get_expected_charset() {
265 if (m_expected_charset == nullptr) return nullptr;
267 }
268
269 /**
270 * @brief Get the num rows per fetch.
271 *
272 * @return size_t
273 */
275
276 /**
277 * @brief Set the num of rows to be retrieved per fetch.
278 *
279 * @param num_rows_per_fetch number of rows per fetch
280 */
281 void set_num_rows_per_fetch(size_t num_rows_per_fetch) {
282 m_num_rows_per_fetch = num_rows_per_fetch;
283 }
284
285 /**
286 * @brief Destroy the Statement_handle object
287 *
288 */
290
291 protected:
292 /**
293 * @brief Send statement execution status after execute().
294 */
296
297 protected:
298 // The query being executed.
299 std::string m_query;
300
301 // Details about error or warning occured.
306
307 // The thread executing the statement.
309
310 // List of all results generated by the query.
312
313 // The last result generated by the guery.
315
316 // Do not intercept the results in the protocol, but pass it to
317 // THD* protocol. E.g., if this is set to 'false', the results are
318 // captured into Protocol_result_v2, else it goes to THD->get_protocol()
319 bool m_use_thd_protocol = false;
320
321 // Max rows to read per fetch() call.
323
325
326 // Collect result set from single statement.
328
329 // Set result set from prepared statement with cursor.
330 // This is called at the end of fetch().
332
333 /**
334 * @brief Copy the warnings generated for the query from the
335 * diagnostics area
336 */
337 void copy_warnings();
338
339 // Protocol that intercepts all the rows from query executed.
341 friend class Protocol_local_v2;
342
343 // Protocol used by THD before switching.
345
346 // No copies.
348 // No move.
350 // No self assignment.
352 // No move.
354};
355
356/**
357 * @brief Regular_statement_handle enables execution of all SQL statements
358 * except for prepared statements.
359 */
361 public:
362 Regular_statement_handle(THD *thd, const char *query, uint length)
363 : Statement_handle(thd, query, length) {}
364
367 }
368
369 /**
370 * @brief Execute a regular statement.
371 *
372 * @return true if statement fails.
373 * @return false if statement succeeds.
374 */
375 bool execute() override;
376
377 /**
378 * @brief Convey that this is regular statement.
379 *
380 * @return Always returns 'false'
381 */
382 bool is_prepared_statement() override { return false; }
383
384 /**
385 * @brief Check if the statement has been executed
386 *
387 * @return true if executed
388 * @return false otherwise
389 */
390 bool is_executed_or_prepared() override { return m_is_executed; }
391
392 public:
393#ifdef HAVE_PSI_INTERFACE
394 // PSI_statement_info instances for regular statement handle.
396#endif
397
398 private:
399 /// Flag to indicate if statement has been executed. Set to true in execute().
400 bool m_is_executed = false;
401
402 // Used by execute() above.
403 bool execute(Server_runnable *server_runnable);
404};
405
406/**
407 * @brief Prepared_statement_handle enables support for prepared
408 * statement execution. Supports parameters and cursors.
409 */
411 public:
412 Prepared_statement_handle(THD *thd, const char *query, uint length)
415 thd->variables.query_alloc_block_size) {}
416
417 /**
418 * @brief Prepares the statement using m_query.
419 *
420 * If the statement is already in executing mode, close the cursor
421 * deallocate the previous statement and start preparing new statement
422 * using m_query.
423 *
424 * @return true if fails.
425 * @return false if succeeds.
426 */
427 bool prepare();
428
429 /**
430 * @brief Set the parameter value in a prepared statement.
431 *
432 * @param idx Index of '?' in prepared statement.
433 * @param is_null Set parameter to NULL value.
434 * @param type Set the parameters field type.
435 * @param is_unsigned Mark parameter as unsigned.
436 * @param data Pointer to buffer containing the value.
437 * @param data_length Length of buffer 'data'
438 * @param name Name of parameter (mostly unused)
439 * @param name_length Length of 'name'
440 *
441 * @return true if fails.
442 * @return false if succeeds.
443 */
444 bool set_parameter(uint idx, bool is_null, enum_field_types type,
445 bool is_unsigned, const void *data,
446 unsigned long data_length, const char *name,
447 unsigned long name_length);
448
449 /**
450 * @brief Get the parameter object
451 *
452 * @param index of the parameter
453 * @return Item_param*
454 */
455 Item_param *get_parameter(size_t index);
456
457 /**
458 * @brief Execute the statement that is prepared.
459 *
460 * If a statement is not yet prepared, we fail.
461 *
462 * If a statement was already in EXECUTED state, we close the cursor
463 * and execute the statement again.
464 *
465 * @return true
466 * @return false
467 */
468 bool execute() override;
469
470 /**
471 * @brief Fetch rows from statement using cursor.
472 *
473 * Not all statement uses cursor. Check is_cursor_open() and
474 * then invoke this call.
475 *
476 * Attempt to call fetch rows without preparing or executing the
477 * statement will cause failure.
478 *
479 * Attempt to call fetch() without cursor in use, will cause failure.
480 *
481 * @return true
482 * @return false
483 */
484 bool fetch();
485
486 /**
487 * @brief Check if the statement uses cursor and it is open.
488 *
489 * If the API is called without preparing the statement will
490 * result in 'false'
491 *
492 * @return true if cursor is in use
493 * @return false if cursor not in use.
494 */
496 if (!m_stmt) return false;
497 return m_stmt->m_cursor && m_stmt->m_cursor->is_open();
498 }
499
500 /**
501 * @brief Check if the statement uses cursor.
502 *
503 * If the API is called without executing the statement
504 * will result in 'false'
505 *
506 * @return true if statement uses cursor.
507 * @return false if statement does not uses cursor.
508 */
509 bool uses_cursor() {
511 return false;
512 return m_stmt->m_cursor != nullptr;
513 }
514
515 /**
516 * @brief Reset the statement parameters and cursors.
517 *
518 * Invoking this API will close the cursor in use.
519 * This is invoked generally before executing
520 * the statement for the second time, after prepare.
521 *
522 * @return true
523 * @return false
524 */
525 bool reset();
526
527 /**
528 * @brief Close the statement that is prepared.
529 *
530 * @return true
531 * @return false
532 */
533 bool close();
534
535 /**
536 * @brief Get number of parameters used in the statement.
537 *
538 * This should be called after preparing a statement.
539 *
540 * @return uint
541 */
542 uint get_param_count() { return m_stmt ? m_stmt->m_param_count : 0; }
543
544 /**
545 * @brief Convey that this is prepared statement.
546 *
547 * @return Always returns true
548 */
549 bool is_prepared_statement() override { return true; }
550
551 /**
552 * @brief Check if the statement has been executed or prepared
553 *
554 * @return true if executed or prepared
555 * @return false otherwise
556 */
557 bool is_executed_or_prepared() override {
558 return m_stmt != nullptr &&
560 }
561
562 /**
563 * @brief Virtual destroy for Prepared_statement_handle object
564 *
565 */
567
568#ifdef HAVE_PSI_INTERFACE
569 // PSI_statement_info instances for prepared statement handle.
575#endif
576
577 private:
578 /**
579 * @brief This is a wrapper function used to execute
580 * and operation on Prepared_statement. This takes case of using
581 * relevant protocol, diagnostic area, backup the current query arena
582 * before executing the prepared statement operation.
583 *
584 * @tparam Function type of function to run
585 * @param exec_func function to run
586 * @param psi_info PSI_statement_info instance.
587 *
588 * @return true
589 * @return false
590 */
591 template <typename Function>
592 bool run(Function exec_func, PSI_statement_info *psi_info);
593
594 // See prepare()
595 bool internal_prepare();
596
597 // See execute()
598 bool internal_execute();
599
600 // See fetch()
601 bool internal_fetch();
602
603 // See reset()
604 bool internal_reset();
605
606 /**
607 * @brief Reset the statement parameters and cursors.
608 *
609 * @param invalidate_params When set to true parameters are invalidated.
610 *
611 * @return true on failure.
612 * @return false on execute.
613 */
614
615 bool internal_reset(bool invalidate_params);
616
617 // See close()
618 bool internal_close();
619
620 /**
621 * @brief Method to enable cursor.
622 *
623 * @return true if cursor can be used for a statement.
624 * @return false if cursor can not be used for a statement.
625 */
626 bool enable_cursor();
627
628 /**
629 * @brief Create a parameter buffers
630 *
631 * @return true on failure
632 * @return false on success
633 */
635
636 // The prepared statement implementation.
638
639 // Parameters values.
641
642 /*
643 Store the parameter and parameter values in a separate mem_root.
644 These can be even stored in m_stmt's mem_root. But reprepare() would
645 free up the memory used by the prepared statement. Hence, using separate
646 mem_root.
647 */
649
650 /*
651 Size of each parameter buffer allocated in mem_root.
652 We re-use the same buffer, if the parameter value size fit
653 within this max.
654 */
655 ulong *m_parameter_buffer_max{nullptr};
656
657 /*
658 Denotes if new parameters were set.
659 This is set 'true' for the first time. It is set to 'false' upon
660 re-execute without rebinding any parameters.
661 */
663};
664
665#endif
Stores status of the currently executed statement.
Definition: sql_error.h:269
bool is_error() const
Definition: sql_error.h:366
const char * message_text() const
Definition: sql_error.h:376
uint mysql_errno() const
Definition: sql_error.h:386
const char * returned_sqlstate() const
Definition: sql_error.h:391
Dynamic parameters used as placeholders ('?') inside prepared statements.
Definition: item.h:4789
Prepared_statement_handle enables support for prepared statement execution.
Definition: statement.h:410
Prepared_statement_handle(THD *thd, const char *query, uint length)
Definition: statement.h:412
bool reset()
Reset the statement parameters and cursors.
Definition: statement.cc:849
bool close()
Close the statement that is prepared.
Definition: statement.cc:854
bool m_bound_new_parameter_types
Definition: statement.h:662
ulong * m_parameter_buffer_max
Definition: statement.h:655
bool internal_close()
Definition: statement.cc:799
static PSI_statement_info fetch_psi_info
Definition: statement.h:572
bool is_executed_or_prepared() override
Check if the statement has been executed or prepared.
Definition: statement.h:557
static PSI_statement_info execute_psi_info
Definition: statement.h:571
bool execute() override
Execute the statement that is prepared.
Definition: statement.cc:839
bool run(Function exec_func, PSI_statement_info *psi_info)
This is a wrapper function used to execute and operation on Prepared_statement.
Definition: statement.cc:860
static PSI_statement_info prepare_psi_info
Definition: statement.h:570
bool internal_reset()
Definition: statement.cc:765
bool create_parameter_buffers()
Create a parameter buffers.
Definition: statement.cc:922
Prepared_statement * m_stmt
Definition: statement.h:637
bool prepare()
Prepares the statement using m_query.
Definition: statement.cc:834
uint get_param_count()
Get number of parameters used in the statement.
Definition: statement.h:542
bool is_cursor_open()
Check if the statement uses cursor and it is open.
Definition: statement.h:495
bool uses_cursor()
Check if the statement uses cursor.
Definition: statement.h:509
bool internal_fetch()
Definition: statement.cc:725
bool enable_cursor()
Method to enable cursor.
Definition: statement.cc:626
static PSI_statement_info close_psi_info
Definition: statement.h:574
bool fetch()
Fetch rows from statement using cursor.
Definition: statement.cc:844
bool internal_prepare()
Definition: statement.cc:552
virtual ~Prepared_statement_handle() override
Virtual destroy for Prepared_statement_handle object.
Definition: statement.h:566
bool set_parameter(uint idx, bool is_null, enum_field_types type, bool is_unsigned, const void *data, unsigned long data_length, const char *name, unsigned long name_length)
Set the parameter value in a prepared statement.
Definition: statement.cc:953
Item_param * get_parameter(size_t index)
Get the parameter object.
Definition: statement.cc:1005
MEM_ROOT m_parameter_mem_root
Definition: statement.h:648
static PSI_statement_info reset_psi_info
Definition: statement.h:573
bool internal_execute()
Definition: statement.cc:648
PS_PARAM * m_parameters
Definition: statement.h:640
bool is_prepared_statement() override
Convey that this is prepared statement.
Definition: statement.h:549
Prepared_statement: a statement that can contain placeholders.
Definition: sql_prepare.h:150
Server_side_cursor * m_cursor
Pointer to cursor, may be NULL if statement never used with a cursor.
Definition: sql_prepare.h:159
Query_arena m_arena
Memory allocation arena, for permanent allocations to statement.
Definition: sql_prepare.h:153
uint m_param_count
Number of parameters expected for statement.
Definition: sql_prepare.h:165
This is extention of Protocol_local.
Definition: protocol_local_v2.h:315
void set_result_set_capacity(size_t capacity)
Set the capacity in bytes allowed for caching results.
Definition: protocol_local_v2.h:432
size_t get_result_set_capacity()
Get the capacity in bytes allowed for caching results.
Definition: protocol_local_v2.h:439
Definition: protocol.h:33
enum_state get_state() const
Definition: sql_class.h:411
@ STMT_INITIALIZED
Definition: sql_class.h:368
@ STMT_EXECUTED
Definition: sql_class.h:372
Regular_statement_handle enables execution of all SQL statements except for prepared statements.
Definition: statement.h:360
bool is_prepared_statement() override
Convey that this is regular statement.
Definition: statement.h:382
static PSI_statement_info stmt_psi_info
Definition: statement.h:395
bool m_is_executed
Flag to indicate if statement has been executed. Set to true in execute().
Definition: statement.h:400
bool execute() override
Execute a regular statement.
Definition: statement.cc:295
Regular_statement_handle(THD *thd, const char *query, uint length)
Definition: statement.h:362
bool is_executed_or_prepared() override
Check if the statement has been executed.
Definition: statement.h:390
~Regular_statement_handle() override
Definition: statement.h:365
A result set contains the result of a query.
Definition: protocol_local_v2.h:154
Result_set * get_next()
Get the next result set object.
Definition: protocol_local_v2.h:284
Execute a fragment of server code in an isolated context, so that it doesn't leave any effect on THD.
Definition: statement_runnable.h:42
virtual bool is_open() const =0
Statement_handle is similar to Ed_connection.
Definition: statement.h:81
size_t get_num_rows_per_fetch()
Get the num rows per fetch.
Definition: statement.h:274
void next_result_set()
Make the next result set the current result set.
Definition: statement.h:161
Statement_handle(Statement_handle &&)=delete
void set_capacity(size_t capacity)
Set the capacity in bytes allowed for caching results.
Definition: statement.h:209
Result_set * m_current_rset
Definition: statement.h:314
void set_num_rows_per_fetch(size_t num_rows_per_fetch)
Set the num of rows to be retrieved per fetch.
Definition: statement.h:281
Statement_handle & operator=(Statement_handle &&)=delete
const char * get_expected_charset()
Get the expected charset.
Definition: statement.h:264
void set_use_thd_protocol(bool use_thd_protocol)
Set thd protocol to enable result pass through.
Definition: statement.h:226
Result_set * get_current_result_set()
Get the current result set object.
Definition: statement.h:154
ulonglong warning_count() const
Get number of warnings generated.
Definition: statement.h:133
CHARSET_INFO * m_expected_charset
Definition: statement.h:324
void set_thd_protocol()
Set either Protocol_local_v2 when m_use_thd_protocol is not set or or classical protocol when m_use_t...
Definition: statement.cc:517
bool is_error() const
Check if error is reported.
Definition: statement.h:90
Statement_handle(THD *thd, const char *query, size_t length)
Definition: statement.cc:464
void copy_warnings()
Copy the warnings generated for the query from the diagnostics area.
Definition: statement.cc:476
virtual bool is_executed_or_prepared()=0
Check if the statement has been executed or prepared.
virtual bool execute()=0
Execute the SQL command.
Warning * m_warnings
Definition: statement.h:303
Result_set * m_result_sets
Definition: statement.h:311
bool is_using_thd_protocol() const
Check if thd protocol is used.
Definition: statement.h:236
Diagnostics_area * m_diagnostics_area
Definition: statement.h:305
virtual bool is_prepared_statement()=0
Check if we are processing a prepared statement.
void send_statement_status()
Send statement execution status after execute().
Definition: statement.cc:254
virtual ~Statement_handle()
Destroy the Statement_handle object.
Definition: statement.h:289
LEX_CSTRING get_last_error()
Check if error is reported.
Definition: statement.h:97
Protocol * m_saved_protocol
Definition: statement.h:344
Result_set * get_result_sets()
Get the next result sets generated while executing the statement.
Definition: statement.h:147
void add_result_set(Result_set *result_set)
Definition: statement.cc:455
bool m_use_thd_protocol
Definition: statement.h:319
void set_result_set(Result_set *result_set)
Definition: statement.cc:513
void set_expected_charset(const char *charset_name)
Set the expected charset.
Definition: statement.h:254
unsigned int get_last_errno() const
Get the last mysql errno.
Definition: statement.h:110
void reset_thd_protocol()
Reset THD protocol.
Definition: statement.cc:546
std::string m_query
Definition: statement.h:299
std::string_view get_query()
Get the query string being executed.
Definition: statement.h:202
size_t m_num_rows_per_fetch
Definition: statement.h:322
Statement_handle(const Statement_handle &)=delete
MEM_ROOT m_warning_mem_root
Definition: statement.h:302
THD * m_thd
Definition: statement.h:308
size_t get_capacity()
Get the capacity in bytes allowed for caching results.
Definition: statement.h:218
Warning * get_warnings()
Get list of all warnings.
Definition: statement.cc:506
Protocol_local_v2 m_protocol
Definition: statement.h:340
void free_old_result()
Feel all the result collected so far, from query execution.
Definition: statement.cc:508
Statement_handle & operator=(const Statement_handle &)=delete
LEX_CSTRING get_mysql_state()
Get the mysql error state.
Definition: statement.h:120
ulonglong m_warnings_count
Definition: statement.h:304
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
unsigned short m_regular_statement_handle_count
Count of Regular Statement Handles in use.
Definition: sql_class.h:4848
Class representing a warning.
Definition: warning.h:41
enum_field_types
Column types for MySQL Note: Keep include/mysql/components/services/bits/stored_program_bits....
Definition: field_types.h:55
CHARSET_INFO * get_charset_by_csname(const char *cs_name, uint cs_flags, myf my_flags)
Definition: charset.cc:343
static constexpr uint32_t MY_CS_PRIMARY
Definition: m_ctype.h:122
MYSQL_PLUGIN_IMPORT CHARSET_INFO * system_charset_info
Definition: mysqld.cc:1554
This file follows Google coding style, except for the name MEM_ROOT (which is kept for historical rea...
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
#define MYF(v)
Definition: my_inttypes.h:97
static char * query
Definition: myisam_ftdump.cc:47
Time declarations shared between the server and client API: you should not add anything to this heade...
std::function< void(const Type)> Function
Definition: ut0counter.h:241
constexpr value_type is_unsigned
Definition: classic_protocol_constants.h:273
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
static mysql_service_status_t result_set(UDF_INIT *, const char *, void *) noexcept
Definition: mysql_udf_metadata_all_empty.cc:53
PSI_memory_key key_memory_prepared_statement_main_mem_root
Definition: psi_memory_key.cc:129
required string type
Definition: replication_group_member_actions.proto:34
LEX_CSTRING convert_and_store(MEM_ROOT *mem_root, const char *str, size_t length, const CHARSET_INFO *src_cs, const CHARSET_INFO *dst_cs)
Potentially convert a string from src charset to destination charset and store the returned string on...
Definition: utils.cc:72
Declarations for implementation of server side cursors.
case opt name
Definition: sslopt-case.h:29
void init_statement_handle_interface_psi_keys()
Initializes Statement Handles PFS statement instrumentation information instances.
Definition: statement.cc:145
static constexpr unsigned short MAX_REGULAR_STATEMENT_HANDLES_LIMIT
Max limit for Regular Statement Handles in use.
Definition: statement.h:52
int dummy_function_to_ensure_we_are_linked_into_the_server()
There must be one function of this kind in order for the symbols in the server's dynamic library to b...
Definition: statement.cc:51
Definition: m_ctype.h:421
const char * csname
Definition: m_ctype.h:426
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:83
Definition: mysql_lex_string.h:40
Statement instrument information.
Definition: psi_statement_bits.h:133
Definition: com_data.h:46