MySQL 8.4.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/**
52 * @brief
53 * Statement_handle is extension of Ed_connection. Some of the
54 * limitations in Ed_connection is that,
55 * - It does not support reading result metadata
56 * - It does not support prepared statement, parameters and cursors.
57 *
58 * Above limitation leads to implementation of this interface.
59 *
60 * Statement_handle supports both execution of regular and
61 * prepared statement.
62 *
63 * Note that we can get rid of Ed_connection implementation
64 * as we support more functionality with Statement_handle.
65 */
67 public:
68 Statement_handle(THD *thd, const char *query, size_t length);
69
70 /**
71 * @brief Check if error is reported.
72 *
73 * @return true of error is reported.
74 */
75 bool is_error() const { return m_diagnostics_area->is_error(); }
76
77 /**
78 * @brief Check if error is reported.
79 *
80 * @return true of error is reported.
81 */
82 const char *get_last_error() {
83 assert(is_error());
88 }
89
90 /**
91 * @brief Get the last mysql errno.
92 *
93 * @return unsigned int
94 */
95 unsigned int get_last_errno() const {
96 assert(is_error());
98 }
99
100 /**
101 * @brief Get the mysql error state.
102 *
103 * @return const char*
104 */
105 const char *get_mysql_state() {
106 assert(is_error());
111 }
112
113 /**
114 * @brief Get number of warnings generated.
115 *
116 * @return ulonglong
117 */
119
120 /**
121 * @brief Get list of all warnings.
122 *
123 * @return Warning*
124 */
126
127 /**
128 * @brief Get the next result sets generated while executing the statement.
129 *
130 * @return Result_set*
131 */
133
134 /**
135 * @brief Get the current result set object
136 *
137 * @return Result_set*
138 */
140
141 /**
142 * @brief Make the next result set the current result set.
143 * We do it once we have read the current result set.
144 *
145 */
147 auto next_rset = m_current_rset->get_next();
148 m_current_rset = next_rset;
149 }
150
151 /**
152 * @brief Execute the SQL command.
153 * This can be either Regular or Prepared statement.
154 *
155 * @return true upon failure.
156 * @return false upon success.
157 */
158 virtual bool execute() = 0;
159
160 /**
161 * @brief Check if we are processing a prepared statement.
162 *
163 * @return true upon failure.
164 * @return false upon success.
165 */
166 virtual bool is_prepared_statement() = 0;
167
168 /**
169 * @brief Check if the statement has been executed or prepared
170 *
171 * @return true upon executed or prepared
172 * @return false otherwise
173 */
174 virtual bool is_executed_or_prepared() = 0;
175
176 /**
177 * @brief Feel all the result collected so far, from query execution.
178 *
179 */
180 void free_old_result();
181
182 /**
183 * @brief Get the query string being executed.
184 *
185 * @return std::string_view
186 */
187 std::string_view get_query() { return m_query; }
188
189 /**
190 * @brief Set the capacity in bytes allowed for caching results.
191 *
192 * @param capacity of the result set
193 */
194 void set_capacity(size_t capacity) {
196 }
197
198 /**
199 * @brief Get the capacity in bytes allowed for caching results.
200 *
201 * @return size_t
202 */
204
205 /**
206 * @brief Set thd protocol to enable result pass through.
207 *
208 * @param use_thd_protocol - parameter that decides if THD protocol should be
209 * used
210 */
211 void set_use_thd_protocol(bool use_thd_protocol) {
212 m_use_thd_protocol = use_thd_protocol;
213 }
214
215 /**
216 * @brief Check if thd protocol is used.
217 *
218 * @return true if enabled.
219 * @return false if not.
220 */
222
223 /**
224 * @brief Set either Protocol_local_v2 when m_use_thd_protocol is not set or
225 * or classical protocol when m_use_thd_protocol is set to THD.
226 */
227 void set_thd_protocol();
228
229 /**
230 * @brief Reset THD protocol.
231 */
232 void reset_thd_protocol();
233
234 /**
235 * @brief Set the expected charset
236 *
237 * @param charset_name Name of the charset
238 */
239 void set_expected_charset(const char *charset_name) {
241 get_charset_by_csname(charset_name, MY_CS_PRIMARY, MYF(0));
242 }
243
244 /**
245 * @brief Get the expected charset
246 *
247 * @return const char* the expected charset name
248 */
249 const char *get_expected_charset() {
250 if (m_expected_charset == nullptr) return nullptr;
252 }
253
254 /**
255 * @brief Get the num rows per fetch.
256 *
257 * @return size_t
258 */
260
261 /**
262 * @brief Set the num of rows to be retrieved per fetch.
263 *
264 * @param num_rows_per_fetch number of rows per fetch
265 */
266 void set_num_rows_per_fetch(size_t num_rows_per_fetch) {
267 m_num_rows_per_fetch = num_rows_per_fetch;
268 }
269
270 /**
271 * @brief Destroy the Statement_handle object
272 *
273 */
275
276 protected:
277 /**
278 * @brief Send statement execution status after execute().
279 */
281
282 protected:
283 // The query being executed.
284 std::string m_query;
285
286 // Details about error or warning occured.
291
292 // The thread executing the statement.
294
295 // List of all results generated by the query.
297
298 // The last result generated by the guery.
300
301 // Do not intercept the results in the protocol, but pass it to
302 // THD* protocol. E.g., if this is set to 'false', the results are
303 // captured into Protocol_result_v2, else it goes to THD->get_protocol()
304 bool m_use_thd_protocol = false;
305
306 // Max rows to read per fetch() call.
308
310
311 // Collect result set from single statement.
312 void add_result_set(Result_set *result_set);
313
314 // Set result set from prepared statement with cursor.
315 // This is called at the end of fetch().
316 void set_result_set(Result_set *result_set);
317
318 /**
319 * @brief Copy the warnings generated for the query from the
320 * diagnostics area
321 */
322 void copy_warnings();
323
324 // Protocol that intercepts all the rows from query executed.
326 friend class Protocol_local_v2;
327
328 // Protocol used by THD before switching.
330
331 // No copies.
333 // No move.
335 // No self assignment.
337 // No move.
339};
340
341/**
342 * @brief Regular_statement_handle enables execution of all SQL statements
343 * except for prepared statements.
344 */
346 public:
347 Regular_statement_handle(THD *thd, const char *query, uint length)
348 : Statement_handle(thd, query, length) {}
349
350 /**
351 * @brief Execute a regular statement.
352 *
353 * @return true if statement fails.
354 * @return false if statement succeeds.
355 */
356 bool execute() override;
357
358 /**
359 * @brief Convey that this is regular statement.
360 *
361 * @return Always returns 'false'
362 */
363 bool is_prepared_statement() override { return false; }
364
365 /**
366 * @brief Check if the statement has been executed
367 *
368 * @return true if executed
369 * @return false otherwise
370 */
371 bool is_executed_or_prepared() override { return m_is_executed; }
372
373 private:
374 // Flag to show whether statement has been executed. Change to true after
375 // execute is called
376 bool m_is_executed = false;
377
378 // Used by execute() above.
379 bool execute(Server_runnable *server_runnable);
380};
381
382/**
383 * @brief Prepared_statement_handle enables support for prepared
384 * statement execution. Supports parameters and cursors.
385 */
387 public:
388 Prepared_statement_handle(THD *thd, const char *query, uint length)
391 thd->variables.query_alloc_block_size) {}
392
393 /**
394 * @brief Prepares the statement using m_query.
395 *
396 * If the statement is already in executing mode, close the cursor
397 * deallocate the previous statement and start preparing new statement
398 * using m_query.
399 *
400 * @return true if fails.
401 * @return false if succeeds.
402 */
403 bool prepare();
404
405 /**
406 * @brief Set the parameter value in a prepared statement.
407 *
408 * @param idx Index of '?' in prepared statement.
409 * @param is_null Set parameter to NULL value.
410 * @param type Set the parameters field type.
411 * @param is_unsigned Mark parameter as unsigned.
412 * @param data Pointer to buffer containing the value.
413 * @param data_length Length of buffer 'data'
414 * @param name Name of parameter (mostly unused)
415 * @param name_length Length of 'name'
416 *
417 * @return true if fails.
418 * @return false if succeeds.
419 */
420 bool set_parameter(uint idx, bool is_null, enum_field_types type,
421 bool is_unsigned, const void *data,
422 unsigned long data_length, const char *name,
423 unsigned long name_length);
424
425 /**
426 * @brief Get the parameter object
427 *
428 * @param index of the parameter
429 * @return Item_param*
430 */
431 Item_param *get_parameter(size_t index);
432
433 /**
434 * @brief Execute the statement that is prepared.
435 *
436 * If a statement is not yet prepared, we fail.
437 *
438 * If a statement was already in EXECUTED state, we close the cursor
439 * and execute the statement again.
440 *
441 * @return true
442 * @return false
443 */
444 bool execute() override;
445
446 /**
447 * @brief Fetch rows from statement using cursor.
448 *
449 * Not all statement uses cursor. Check is_cursor_open() and
450 * then invoke this call.
451 *
452 * Attempt to call fetch rows without preparing or executing the
453 * statement will cause failure.
454 *
455 * Attempt to call fetch() without cursor in use, will cause failure.
456 *
457 * @return true
458 * @return false
459 */
460 bool fetch();
461
462 /**
463 * @brief Check if the statement uses cursor and it is open.
464 *
465 * If the API is called without preparing the statement will
466 * result in 'false'
467 *
468 * @return true if cursor is in use
469 * @return false if cursor not in use.
470 */
472 if (!m_stmt) return false;
473 return m_stmt->m_cursor && m_stmt->m_cursor->is_open();
474 }
475
476 /**
477 * @brief Check if the statement uses cursor.
478 *
479 * If the API is called without executing the statement
480 * will result in 'false'
481 *
482 * @return true if statement uses cursor.
483 * @return false if statement does not uses cursor.
484 */
485 bool uses_cursor() {
487 return false;
488 return m_stmt->m_cursor != nullptr;
489 }
490
491 /**
492 * @brief Reset the statement parameters and cursors.
493 *
494 * Invoking this API will close the cursor in use.
495 * This is invoked generally before executing
496 * the statement for the second time, after prepare.
497 *
498 * @return true
499 * @return false
500 */
501 bool reset();
502
503 /**
504 * @brief Close the statement that is prepared.
505 *
506 * @return true
507 * @return false
508 */
509 bool close();
510
511 /**
512 * @brief Get number of parameters used in the statement.
513 *
514 * This should be called after preparing a statement.
515 *
516 * @return uint
517 */
518 uint get_param_count() { return m_stmt ? m_stmt->m_param_count : 0; }
519
520 /**
521 * @brief Convey that this is prepared statement.
522 *
523 * @return Always returns true
524 */
525 bool is_prepared_statement() override { return true; }
526
527 /**
528 * @brief Check if the statement has been executed or prepared
529 *
530 * @return true if executed or prepared
531 * @return false otherwise
532 */
533 bool is_executed_or_prepared() override {
534 return m_stmt != nullptr &&
536 }
537
538 /**
539 * @brief Virtual destroy for Prepared_statement_handle object
540 *
541 */
543
544 private:
545 /**
546 * @brief This is a wrapper function used to execute
547 * and operation on Prepared_statement. This takes case of using
548 * relevant protocol, diagnostic area, backup the current query arena
549 * before executing the prepared statement operation.
550 *
551 * @tparam Function type of function to run
552 * @param exec_func function to run
553 * @return true
554 * @return false
555 */
556 template <typename Function>
557 bool run(Function exec_func);
558
559 // See prepare()
560 bool internal_prepare();
561
562 // See execute()
563 bool internal_execute();
564
565 // See fetch()
566 bool internal_fetch();
567
568 // See reset()
569 bool internal_reset();
570
571 /**
572 * @brief Reset the statement parameters and cursors.
573 *
574 * @param invalidate_params When set to true parameters are invalidated.
575 *
576 * @return true on failure.
577 * @return false on execute.
578 */
579
580 bool internal_reset(bool invalidate_params);
581
582 // See close()
583 bool internal_close();
584
585 /**
586 * @brief Method to enable cursor.
587 *
588 * @return true if cursor can be used for a statement.
589 * @return false if cursor can not be used for a statement.
590 */
591 bool enable_cursor();
592
593 /**
594 * @brief Create a parameter buffers
595 *
596 * @return true on failure
597 * @return false on success
598 */
600
601 // The prepared statement implementation.
603
604 // Parameters values.
606
607 /*
608 Store the parameter and parameter values in a separate mem_root.
609 These can be even stored in m_stmt's mem_root. But reprepare() would
610 free up the memory used by the prepared statement. Hence, using separate
611 mem_root.
612 */
614
615 /*
616 Size of each parameter buffer allocated in mem_root.
617 We re-use the same buffer, if the parameter value size fit
618 within this max.
619 */
620 ulong *m_parameter_buffer_max{nullptr};
621
622 /*
623 Denotes if new parameters were set.
624 This is set 'true' for the first time. It is set to 'false' upon
625 re-execute without rebinding any parameters.
626 */
628};
629
630#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:4764
Prepared_statement_handle enables support for prepared statement execution.
Definition: statement.h:386
Prepared_statement_handle(THD *thd, const char *query, uint length)
Definition: statement.h:388
bool reset()
Reset the statement parameters and cursors.
Definition: statement.cc:685
bool close()
Close the statement that is prepared.
Definition: statement.cc:689
bool m_bound_new_parameter_types
Definition: statement.h:627
ulong * m_parameter_buffer_max
Definition: statement.h:620
bool internal_close()
Definition: statement.cc:638
bool is_executed_or_prepared() override
Check if the statement has been executed or prepared.
Definition: statement.h:533
bool execute() override
Execute the statement that is prepared.
Definition: statement.cc:677
bool run(Function exec_func)
This is a wrapper function used to execute and operation on Prepared_statement.
Definition: statement.cc:694
bool internal_reset()
Definition: statement.cc:604
bool create_parameter_buffers()
Create a parameter buffers.
Definition: statement.cc:749
Prepared_statement * m_stmt
Definition: statement.h:602
bool prepare()
Prepares the statement using m_query.
Definition: statement.cc:673
uint get_param_count()
Get number of parameters used in the statement.
Definition: statement.h:518
bool is_cursor_open()
Check if the statement uses cursor and it is open.
Definition: statement.h:471
bool uses_cursor()
Check if the statement uses cursor.
Definition: statement.h:485
bool internal_fetch()
Definition: statement.cc:564
bool enable_cursor()
Method to enable cursor.
Definition: statement.cc:470
bool fetch()
Fetch rows from statement using cursor.
Definition: statement.cc:681
bool internal_prepare()
Definition: statement.cc:394
virtual ~Prepared_statement_handle() override
Virtual destroy for Prepared_statement_handle object.
Definition: statement.h:542
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:780
Item_param * get_parameter(size_t index)
Get the parameter object.
Definition: statement.cc:832
MEM_ROOT m_parameter_mem_root
Definition: statement.h:613
bool internal_execute()
Definition: statement.cc:492
PS_PARAM * m_parameters
Definition: statement.h:605
bool is_prepared_statement() override
Convey that this is prepared statement.
Definition: statement.h:525
Prepared_statement: a statement that can contain placeholders.
Definition: sql_prepare.h:152
Server_side_cursor * m_cursor
Pointer to cursor, may be NULL if statement never used with a cursor.
Definition: sql_prepare.h:161
Query_arena m_arena
Memory allocation arena, for permanent allocations to statement.
Definition: sql_prepare.h:155
uint m_param_count
Number of parameters expected for statement.
Definition: sql_prepare.h:167
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:345
bool is_prepared_statement() override
Convey that this is regular statement.
Definition: statement.h:363
bool m_is_executed
Definition: statement.h:376
bool execute() override
Execute a regular statement.
Definition: statement.cc:171
Regular_statement_handle(THD *thd, const char *query, uint length)
Definition: statement.h:347
bool is_executed_or_prepared() override
Check if the statement has been executed.
Definition: statement.h:371
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 extension of Ed_connection.
Definition: statement.h:66
size_t get_num_rows_per_fetch()
Get the num rows per fetch.
Definition: statement.h:259
void next_result_set()
Make the next result set the current result set.
Definition: statement.h:146
Statement_handle(Statement_handle &&)=delete
const char * get_mysql_state()
Get the mysql error state.
Definition: statement.h:105
void set_capacity(size_t capacity)
Set the capacity in bytes allowed for caching results.
Definition: statement.h:194
Result_set * m_current_rset
Definition: statement.h:299
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:266
Statement_handle & operator=(Statement_handle &&)=delete
const char * get_expected_charset()
Get the expected charset.
Definition: statement.h:249
void set_use_thd_protocol(bool use_thd_protocol)
Set thd protocol to enable result pass through.
Definition: statement.h:211
Result_set * get_current_result_set()
Get the current result set object.
Definition: statement.h:139
ulonglong warning_count() const
Get number of warnings generated.
Definition: statement.h:118
CHARSET_INFO * m_expected_charset
Definition: statement.h:309
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:301
bool is_error() const
Check if error is reported.
Definition: statement.h:75
Statement_handle(THD *thd, const char *query, size_t length)
Definition: statement.cc:248
void copy_warnings()
Copy the warnings generated for the query from the diagnostics area.
Definition: statement.cc:260
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:288
Result_set * m_result_sets
Definition: statement.h:296
bool is_using_thd_protocol() const
Check if thd protocol is used.
Definition: statement.h:221
Diagnostics_area * m_diagnostics_area
Definition: statement.h:290
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:130
virtual ~Statement_handle()
Destroy the Statement_handle object.
Definition: statement.h:274
Protocol * m_saved_protocol
Definition: statement.h:329
Result_set * get_result_sets()
Get the next result sets generated while executing the statement.
Definition: statement.h:132
void add_result_set(Result_set *result_set)
Definition: statement.cc:239
bool m_use_thd_protocol
Definition: statement.h:304
void set_result_set(Result_set *result_set)
Definition: statement.cc:297
void set_expected_charset(const char *charset_name)
Set the expected charset.
Definition: statement.h:239
unsigned int get_last_errno() const
Get the last mysql errno.
Definition: statement.h:95
void reset_thd_protocol()
Reset THD protocol.
Definition: statement.cc:330
std::string m_query
Definition: statement.h:284
std::string_view get_query()
Get the query string being executed.
Definition: statement.h:187
size_t m_num_rows_per_fetch
Definition: statement.h:307
Statement_handle(const Statement_handle &)=delete
MEM_ROOT m_warning_mem_root
Definition: statement.h:287
const char * get_last_error()
Check if error is reported.
Definition: statement.h:82
THD * m_thd
Definition: statement.h:293
size_t get_capacity()
Get the capacity in bytes allowed for caching results.
Definition: statement.h:203
Warning * get_warnings()
Get list of all warnings.
Definition: statement.cc:290
Protocol_local_v2 m_protocol
Definition: statement.h:325
void free_old_result()
Feel all the result collected so far, from query execution.
Definition: statement.cc:292
Statement_handle & operator=(const Statement_handle &)=delete
ulonglong m_warnings_count
Definition: statement.h:289
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
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:326
static constexpr uint32_t MY_CS_PRIMARY
Definition: m_ctype.h:122
MYSQL_PLUGIN_IMPORT CHARSET_INFO * system_charset_info
Definition: mysqld.cc:1542
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
PSI_memory_key key_memory_prepared_statement_main_mem_root
Definition: psi_memory_key.cc:128
required string type
Definition: replication_group_member_actions.proto:34
char * 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
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:423
const char * csname
Definition: m_ctype.h:428
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:83
Definition: com_data.h:46