MySQL  8.0.26
Source Code Documentation
sql_prepare.h
Go to the documentation of this file.
1 #ifndef SQL_PREPARE_H
2 #define SQL_PREPARE_H
3 /* Copyright (c) 2009, 2021, Oracle and/or its affiliates.
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License, version 2.0,
7  as published by the Free Software Foundation.
8 
9  This program is also distributed with certain software (including
10  but not limited to OpenSSL) that is licensed under separate terms,
11  as designated in a particular file or component or in included license
12  documentation. The authors of MySQL hereby grant you an additional
13  permission to link the program and your derivative works with the
14  separately licensed software that they have included with MySQL.
15 
16  This program is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  GNU General Public License, version 2.0, for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with this program; if not, write to the Free Software
23  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
24 
25 #include <assert.h>
26 #include <stddef.h>
27 #include <sys/types.h>
28 #include <new>
29 
30 #include "lex_string.h"
31 #include "my_alloc.h"
32 #include "my_command.h"
33 
34 #include "my_inttypes.h"
35 #include "my_psi_config.h"
37 #include "mysql_com.h"
38 #include "sql/sql_class.h" // Query_arena
39 #include "sql/sql_error.h"
40 #include "sql/sql_list.h"
41 
42 class Item;
43 class Item_param;
44 class Prepared_statement;
45 class Query_result_send;
46 class String;
47 struct LEX;
48 struct PS_PARAM;
49 struct TABLE_LIST;
50 union COM_DATA;
51 
52 /**
53  An interface that is used to take an action when
54  the locking module notices that a table version has changed
55  since the last execution. "Table" here may refer to any kind of
56  table -- a base table, a temporary table, a view or an
57  information schema table.
58 
59  When we open and lock tables for execution of a prepared
60  statement, we must verify that they did not change
61  since statement prepare. If some table did change, the statement
62  parse tree *may* be no longer valid, e.g. in case it contains
63  optimizations that depend on table metadata.
64 
65  This class provides an interface (a method) that is
66  invoked when such a situation takes place.
67  The implementation of the method simply reports an error, but
68  the exact details depend on the nature of the SQL statement.
69 
70  At most 1 instance of this class is active at a time, in which
71  case THD::m_reprepare_observer is not NULL.
72 
73  @sa check_and_update_table_version() for details of the
74  version tracking algorithm
75 
76  @sa Open_tables_state::m_reprepare_observer for the life cycle
77  of metadata observers.
78 */
79 
80 class Reprepare_observer final {
81  public:
82  /**
83  Check if a change of metadata is OK. In future
84  the signature of this method may be extended to accept the old
85  and the new versions, but since currently the check is very
86  simple, we only need the THD to report an error.
87  */
88  bool report_error(THD *thd);
89  /**
90  @returns true if some table metadata is changed and statement should be
91  re-prepared.
92  */
93  bool is_invalidated() const { return m_invalidated; }
95  /// @returns true if prepared statement can (and will) be retried
96  bool can_retry() const {
97  // Only call for a statement that is invalidated
98  assert(is_invalidated());
100  DBUG_EVALUATE_IF("simulate_max_reprepare_attempts_hit_case", false,
101  true);
102  }
103 
104  private:
105  bool m_invalidated{false};
106  int m_attempt{0};
107 
108  /*
109  We take only 3 attempts to reprepare the query, otherwise we might end up
110  in endless loop.
111  */
112  static constexpr int MAX_REPREPARE_ATTEMPTS = 3;
113 };
114 
115 bool ask_to_reprepare(THD *thd);
116 bool mysql_stmt_precheck(THD *thd, const COM_DATA *com_data,
117  enum enum_server_command cmd,
118  Prepared_statement **stmt);
119 void mysqld_stmt_prepare(THD *thd, const char *query, uint length,
120  Prepared_statement *stmt);
121 void mysqld_stmt_execute(THD *thd, Prepared_statement *stmt, bool has_new_types,
122  ulong execute_flags, PS_PARAM *parameters);
123 void mysqld_stmt_close(THD *thd, Prepared_statement *stmt);
124 void mysql_sql_stmt_prepare(THD *thd);
125 void mysql_sql_stmt_execute(THD *thd);
126 void mysql_sql_stmt_close(THD *thd);
127 void mysqld_stmt_fetch(THD *thd, Prepared_statement *stmt, ulong num_rows);
128 void mysqld_stmt_reset(THD *thd, Prepared_statement *stmt);
130  uint param_number, uchar *longdata, ulong length);
132  ulong setup_tables_done_option);
133 
134 /**
135  Execute a fragment of server code in an isolated context, so that
136  it doesn't leave any effect on THD. THD must have no open tables.
137  The code must not leave any open tables around.
138  The result of execution (if any) is stored in Ed_result.
139 */
140 
142  public:
143  virtual bool execute_server_code(THD *thd) = 0;
144  virtual ~Server_runnable();
145 };
146 
147 /**
148  Execute direct interface.
149 
150  @todo Implement support for prelocked mode.
151 */
152 
153 class Ed_row;
154 
155 /**
156  Ed_result_set -- a container with result set rows.
157  @todo Implement support for result set metadata and
158  automatic type conversion.
159 */
160 
161 class Ed_result_set final {
162  public:
163  operator List<Ed_row> &() { return *m_rows; }
164  unsigned int size() const { return m_rows->elements; }
165  Ed_row *get_fields() { return m_fields; }
166 
167  Ed_result_set(List<Ed_row> *rows_arg, Ed_row *fields, size_t column_count,
168  MEM_ROOT *mem_root_arg);
169 
170  /** We don't call member destructors, they all are POD types. */
171  ~Ed_result_set() = default;
172 
173  size_t get_field_count() const { return m_column_count; }
174 
175  static void *operator new(size_t size, MEM_ROOT *mem_root,
176  const std::nothrow_t & = std::nothrow) noexcept {
177  return mem_root->Alloc(size);
178  }
179 
180  static void operator delete(void *, size_t) noexcept {
181  // Does nothing because m_mem_root is deallocated in the destructor
182  }
183 
184  static void operator delete(
185  void *, MEM_ROOT *, const std::nothrow_t &) noexcept { /* never called */
186  }
187 
188  private:
189  Ed_result_set(const Ed_result_set &); /* not implemented */
190  Ed_result_set &operator=(Ed_result_set &); /* not implemented */
191  private:
197  friend class Ed_connection;
198 };
199 
200 class Ed_connection final {
201  public:
202  /**
203  Construct a new "execute direct" connection.
204 
205  The connection can be used to execute SQL statements.
206  If the connection failed to initialize, the error
207  will be returned on the attempt to execute a statement.
208 
209  @pre thd must have no open tables
210  while the connection is used. However,
211  Ed_connection works okay in LOCK TABLES mode.
212  Other properties of THD, such as the current warning
213  information, errors, etc. do not matter and are
214  preserved by Ed_connection. One thread may have many
215  Ed_connections created for it.
216  */
217  Ed_connection(THD *thd);
218 
219  /**
220  Execute one SQL statement.
221 
222  Until this method is executed, no other methods of
223  Ed_connection can be used. Life cycle of Ed_connection is:
224 
225  Initialized -> a statement has been executed ->
226  look at result, move to next result ->
227  look at result, move to next result ->
228  ...
229  moved beyond the last result == Initialized.
230 
231  This method can be called repeatedly. Once it's invoked,
232  results of the previous execution are lost.
233 
234  A result of execute_direct() can be either:
235 
236  - success, no result set rows. In this case get_field_count()
237  returns 0. This happens after execution of INSERT, UPDATE,
238  DELETE, DROP and similar statements. Some other methods, such
239  as get_affected_rows() can be used to retrieve additional
240  result information.
241 
242  - success, there are some result set rows (maybe 0). E.g.
243  happens after SELECT. In this case get_field_count() returns
244  the number of columns in a result set and store_result()
245  can be used to retrieve a result set..
246 
247  - an error, methods to retrieve error information can
248  be used.
249 
250  @return execution status
251  @retval false success, use get_field_count()
252  to determine what to do next.
253  @retval true error, use get_last_error()
254  to see the error number.
255  */
256  bool execute_direct(LEX_STRING sql_text);
257 
258  /**
259  Same as the previous, but takes an instance of Server_runnable
260  instead of SQL statement text.
261 
262  @return execution status
263 
264  @retval false success, use get_field_count()
265  if your code fragment is supposed to
266  return a result set
267  @retval true failure
268  */
269  bool execute_direct(Server_runnable *server_runnable);
270 
271  /**
272  The following three members are only valid if execute_direct()
273  or move_to_next_result() returned an error.
274  They never fail, but if they are called when there is no
275  result, or no error, the result is not defined.
276  */
277  const char *get_last_error() const {
279  }
280 
281  unsigned int get_last_errno() const {
283  }
284 
286 
288 
289  private:
291  /**
292  Execute direct interface does not support multi-statements, only
293  multi-results. So we never have a situation when we have
294  a mix of result sets and OK or error packets. We either
295  have a single result set, a single error, or a single OK,
296  or we have a series of result sets, followed by an OK or error.
297  */
301  friend class Protocol_local;
302 
303  private:
304  void free_old_result();
305  void add_result_set(Ed_result_set *ed_result_set);
306 
307  private:
308  Ed_connection(const Ed_connection &); /* not implemented */
309  Ed_connection &operator=(Ed_connection &); /* not implemented */
310 };
311 
312 /** One result set column. */
313 
314 struct Ed_column final : public LEX_STRING {
315  /** Implementation note: destructor for this class is never called. */
316 };
317 
318 /** One result set record. */
319 
320 class Ed_row final {
321  public:
322  const Ed_column &operator[](const unsigned int column_index) const {
323  return *get_column(column_index);
324  }
325  const Ed_column *get_column(const unsigned int column_index) const {
326  assert(column_index < size());
327  return m_column_array + column_index;
328  }
329  size_t size() const { return m_column_count; }
330 
331  Ed_row(Ed_column *column_array_arg, size_t column_count_arg)
332  : m_column_array(column_array_arg), m_column_count(column_count_arg) {}
333 
334  private:
336  size_t m_column_count; /* TODO: change to point to metadata */
337 };
338 
339 class Server_side_cursor;
340 
341 /**
342  Prepared_statement: a statement that can contain placeholders.
343 */
344 
345 class Prepared_statement final {
347 
348  public:
353  /// Used to check that the protocol is stable during execution
354  const Protocol *m_active_protocol{nullptr};
358 
359  /*
360  Uniquely identifies each statement object in thread scope; change during
361  statement lifetime.
362  */
363  const ulong id;
364 
365  LEX *lex; // parse tree descriptor
366 
367  /**
368  The query associated with this statement.
369  */
371 
372  /* Performance Schema interface for a prepared statement. */
374 
375  private:
377 
379  bool with_log;
380  LEX_CSTRING m_name; /* name for named prepared statements */
381  /**
382  Name of the current (default) database.
383 
384  If there is the current (default) database, "db" contains its name. If
385  there is no current (default) database, "db" is NULL and "db_length" is
386  0. In other words, "db", "db_length" must either be NULL, or contain a
387  valid database name.
388 
389  @note this attribute is set and alloced by the slave SQL thread (for
390  the THD of that thread); that thread is (and must remain, for now) the
391  only responsible for freeing this member.
392  */
394 
395  /**
396  The memory root to allocate parsed tree elements (instances of Item,
397  Query_block and other classes).
398  */
400 
401  public:
402  Prepared_statement(THD *thd_arg);
403  virtual ~Prepared_statement();
404  bool set_name(const LEX_CSTRING &name);
405  const LEX_CSTRING &name() const { return m_name; }
406  void close_cursor();
407  bool is_in_use() const { return flags & (uint)IS_IN_USE; }
408  bool is_sql_prepare() const { return flags & (uint)IS_SQL_PREPARE; }
410  bool prepare(const char *packet, size_t packet_length,
411  Item_param **orig_param_array);
412  bool prepare_query();
413  bool execute_loop(String *expanded_query, bool open_cursor);
414  bool execute_server_runnable(Server_runnable *server_runnable);
415 #ifdef HAVE_PSI_PS_INTERFACE
417 #endif
418  /* Destroy this statement */
419  void deallocate();
420  bool set_parameters(String *expanded_query, bool has_new_types,
421  PS_PARAM *parameters);
422  bool set_parameters(String *expanded_query);
423  void trace_parameter_types();
424 
425  private:
426  void cleanup_stmt();
427  void setup_set_params();
428  bool check_parameter_types();
429  void copy_parameter_types(Item_param **from_param_array);
430  bool set_db(const LEX_CSTRING &db_length);
431 
432  bool execute(String *expanded_query, bool open_cursor);
433  bool reprepare();
437  bool insert_params(String *query, PS_PARAM *parameters);
438 };
439 
440 #endif // SQL_PREPARE_H
Stores status of the currently executed statement.
Definition: sql_error.h:265
uint mysql_errno() const
Definition: sql_error.h:377
const char * message_text() const
Definition: sql_error.h:372
Definition: sql_prepare.h:200
Diagnostics_area m_diagnostics_area
Definition: sql_prepare.h:290
Ed_connection & operator=(Ed_connection &)
Ed_connection(THD *thd)
Construct a new "execute direct" connection.
Definition: sql_prepare.cc:3606
Ed_result_set * m_rsets
Definition: sql_prepare.h:299
const char * get_last_error() const
The following three members are only valid if execute_direct() or move_to_next_result() returned an e...
Definition: sql_prepare.h:277
unsigned int get_last_errno() const
Definition: sql_prepare.h:281
~Ed_connection()
Definition: sql_prepare.h:287
bool execute_direct(LEX_STRING sql_text)
Execute one SQL statement.
Definition: sql_prepare.cc:3634
Ed_result_set * m_current_rset
Definition: sql_prepare.h:300
Ed_connection(const Ed_connection &)
Ed_result_set * get_result_sets()
Definition: sql_prepare.h:285
void free_old_result()
Free all result sets of the previous statement, if any, and reset warnings and errors.
Definition: sql_prepare.cc:3619
THD * m_thd
Execute direct interface does not support multi-statements, only multi-results.
Definition: sql_prepare.h:298
void add_result_set(Ed_result_set *ed_result_set)
A helper method that is called only during execution.
Definition: sql_prepare.cc:3697
Ed_result_set – a container with result set rows.
Definition: sql_prepare.h:161
Ed_result_set & operator=(Ed_result_set &)
Ed_result_set(const Ed_result_set &)
MEM_ROOT m_mem_root
Definition: sql_prepare.h:192
Ed_row * m_fields
Definition: sql_prepare.h:195
Ed_result_set(List< Ed_row > *rows_arg, Ed_row *fields, size_t column_count, MEM_ROOT *mem_root_arg)
Initialize an instance of Ed_result_set.
Definition: sql_prepare.cc:3590
Ed_result_set * m_next_rset
Definition: sql_prepare.h:196
Ed_row * get_fields()
Definition: sql_prepare.h:165
size_t get_field_count() const
Definition: sql_prepare.h:173
List< Ed_row > * m_rows
Definition: sql_prepare.h:194
size_t m_column_count
Definition: sql_prepare.h:193
unsigned int size() const
Definition: sql_prepare.h:164
~Ed_result_set()=default
We don't call member destructors, they all are POD types.
One result set record.
Definition: sql_prepare.h:320
Ed_row(Ed_column *column_array_arg, size_t column_count_arg)
Definition: sql_prepare.h:331
size_t size() const
Definition: sql_prepare.h:329
size_t m_column_count
Definition: sql_prepare.h:336
const Ed_column & operator[](const unsigned int column_index) const
Definition: sql_prepare.h:322
Ed_column * m_column_array
Definition: sql_prepare.h:335
const Ed_column * get_column(const unsigned int column_index) const
Definition: sql_prepare.h:325
Dynamic parameters used as placeholders ('?') inside prepared statements.
Definition: item.h:4391
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:801
Prepared_statement: a statement that can contain placeholders.
Definition: sql_prepare.h:345
uint flags
Definition: sql_prepare.h:378
bool set_db(const LEX_CSTRING &db_length)
Remember the current database.
Definition: sql_prepare.cc:2422
Prepared_statement(THD *thd_arg)
Definition: sql_prepare.cc:2294
const Protocol * m_active_protocol
Used to check that the protocol is stable during execution.
Definition: sql_prepare.h:354
void set_sql_prepare()
Definition: sql_prepare.h:409
LEX_CSTRING m_query_string
The query associated with this statement.
Definition: sql_prepare.h:370
bool execute_server_runnable(Server_runnable *server_runnable)
Definition: sql_prepare.cc:3102
void setup_set_params()
Definition: sql_prepare.cc:2321
bool set_parameters(String *expanded_query, bool has_new_types, PS_PARAM *parameters)
Assign parameter values either from variables, in case of SQL PS or from the execute packet.
Definition: sql_prepare.cc:2730
bool prepare(const char *packet, size_t packet_length, Item_param **orig_param_array)
Parse statement text, validate the statement, and prepare it for execution.
Definition: sql_prepare.cc:2465
LEX_CSTRING m_db
Name of the current (default) database.
Definition: sql_prepare.h:393
bool reprepare()
Reprepare this prepared statement.
Definition: sql_prepare.cc:3155
bool check_parameter_types()
Check resolved parameter types versus actual parameter types.
Definition: sql_prepare.cc:2779
void swap_prepared_statement(Prepared_statement *copy)
Swap the MEM_ROOT allocated data of two prepared statements.
Definition: sql_prepare.cc:3274
void deallocate()
Common part of DEALLOCATE PREPARE and mysqld_stmt_close.
Definition: sql_prepare.cc:3569
virtual ~Prepared_statement()
Destroy this prepared statement, cleaning up all used memory and resources.
Definition: sql_prepare.cc:2373
Item_param ** param_array
Definition: sql_prepare.h:351
bool prepare_query()
Perform semantic analysis of query and send a response packet to client.
Definition: sql_prepare.cc:1260
bool execute_loop(String *expanded_query, bool open_cursor)
Execute a prepared statement.
Definition: sql_prepare.cc:2953
void cleanup_stmt()
Definition: sql_prepare.cc:2397
uint last_errno
Definition: sql_prepare.h:356
bool is_sql_prepare() const
Definition: sql_prepare.h:408
flag_values
Definition: sql_prepare.h:346
@ IS_SQL_PREPARE
Definition: sql_prepare.h:346
@ IS_IN_USE
Definition: sql_prepare.h:346
Query_arena m_arena
Definition: sql_prepare.h:349
Server_side_cursor * cursor
Definition: sql_prepare.h:352
LEX_CSTRING m_name
Definition: sql_prepare.h:380
bool with_log
Definition: sql_prepare.h:379
void trace_parameter_types()
Definition: sql_prepare.cc:1474
const ulong id
Definition: sql_prepare.h:363
const LEX_CSTRING & name() const
Definition: sql_prepare.h:405
MEM_ROOT main_mem_root
The memory root to allocate parsed tree elements (instances of Item, Query_block and other classes).
Definition: sql_prepare.h:399
void close_cursor()
Definition: sql_prepare.cc:2316
bool validate_metadata(Prepared_statement *copy)
Validate statement result set metadata (if the statement returns a result set).
Definition: sql_prepare.cc:3243
bool insert_params_from_vars(List< LEX_STRING > &varnames, String *query)
Assign prepared statement parameters from user variables.
Definition: sql_prepare.cc:935
THD * thd
Definition: sql_prepare.h:350
Query_result_send * result
Definition: sql_prepare.h:376
char last_error[MYSQL_ERRMSG_SIZE]
Definition: sql_prepare.h:357
LEX * lex
Definition: sql_prepare.h:365
uint param_count
Definition: sql_prepare.h:355
bool insert_params(String *query, PS_PARAM *parameters)
Assign parameter values from data supplied by the client.
Definition: sql_prepare.cc:751
PSI_prepared_stmt * get_PS_prepared_stmt()
Definition: sql_prepare.h:416
bool set_name(const LEX_CSTRING &name)
Definition: sql_prepare.cc:2405
void copy_parameter_types(Item_param **from_param_array)
Copy parameter metada data from parameter array into current prepared stmt.
Definition: sql_prepare.cc:849
bool execute(String *expanded_query, bool open_cursor)
Execute a prepared statement.
Definition: sql_prepare.cc:3334
bool is_in_use() const
Definition: sql_prepare.h:407
PSI_prepared_stmt * m_prepared_stmt
Definition: sql_prepare.h:373
Protocol_local: a helper class to intercept the result of the data written to the network.
Definition: sql_prepare.cc:245
Definition: protocol.h:32
Definition: sql_class.h:234
Definition: query_result.h:211
An interface that is used to take an action when the locking module notices that a table version has ...
Definition: sql_prepare.h:80
bool is_invalidated() const
Definition: sql_prepare.h:93
bool report_error(THD *thd)
Check if a change of metadata is OK.
Definition: sql_prepare.cc:2186
bool can_retry() const
Definition: sql_prepare.h:96
void reset_reprepare_observer()
Definition: sql_prepare.h:94
bool m_invalidated
Definition: sql_prepare.h:105
int m_attempt
Definition: sql_prepare.h:106
static constexpr int MAX_REPREPARE_ATTEMPTS
Definition: sql_prepare.h:112
Execute a fragment of server code in an isolated context, so that it doesn't leave any effect on THD.
Definition: sql_prepare.h:141
virtual bool execute_server_code(THD *thd)=0
virtual ~Server_runnable()
Server_side_cursor – an interface for materialized implementation of cursors.
Definition: sql_cursor.h:50
Definition: sql_cmd_dml.h:34
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:165
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_class.h:821
uint elements
Definition: sql_list.h:135
static MEM_ROOT mem_root
Definition: client_plugin.cc:109
struct PSI_prepared_stmt PSI_prepared_stmt
Definition: psi_statement_bits.h:82
This file follows Google coding style, except for the name MEM_ROOT (which is kept for historical rea...
enum_server_command
A list of all MySQL protocol commands.
Definition: my_command.h:47
#define DBUG_EVALUATE_IF(keyword, a1, a2)
Definition: my_dbug.h:179
Some integer typedefs for easier portability.
unsigned char uchar
Definition: my_inttypes.h:51
Defines various enable/disable and HAVE_ macros related to the performance schema instrumentation sys...
static char * query
Definition: myisam_ftdump.cc:44
Common definition between mysql server & client.
#define MYSQL_ERRMSG_SIZE
Max length of a error message.
Definition: mysql_com.h:850
void copy(Shards< COUNT > &dst, const Shards< COUNT > &src) noexcept
Copy the counters, overwrite destination.
Definition: ut0counter.h:353
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:75
Performance schema instrumentation interface.
void mysqld_stmt_prepare(THD *thd, const char *query, uint length, Prepared_statement *stmt)
COM_STMT_PREPARE handler.
Definition: sql_prepare.cc:1552
void mysql_sql_stmt_close(THD *thd)
SQLCOM_DEALLOCATE implementation.
Definition: sql_prepare.cc:2071
void mysqld_stmt_fetch(THD *thd, Prepared_statement *stmt, ulong num_rows)
COM_STMT_FETCH handler: fetches requested amount of rows from cursor.
Definition: sql_prepare.cc:1984
void mysql_stmt_get_longdata(THD *thd, Prepared_statement *stmt, uint param_number, uchar *longdata, ulong length)
Handle long data in pieces from client.
Definition: sql_prepare.cc:2109
bool mysql_stmt_precheck(THD *thd, const COM_DATA *com_data, enum enum_server_command cmd, Prepared_statement **stmt)
Searches for the statement with the specified id and validates it.
Definition: sql_prepare.cc:1602
void mysqld_stmt_close(THD *thd, Prepared_statement *stmt)
Delete a prepared statement from memory.
Definition: sql_prepare.cc:2048
bool select_like_stmt_cmd_test(THD *thd, class Sql_cmd_dml *cmd, ulong setup_tables_done_option)
bool ask_to_reprepare(THD *thd)
Requests for repreparation of statement.
Definition: sql_prepare.cc:2211
void mysql_sql_stmt_execute(THD *thd)
SQLCOM_EXECUTE implementation.
Definition: sql_prepare.cc:1948
void mysqld_stmt_execute(THD *thd, Prepared_statement *stmt, bool has_new_types, ulong execute_flags, PS_PARAM *parameters)
COM_STMT_EXECUTE handler: execute a previously prepared statement.
Definition: sql_prepare.cc:1884
void mysqld_stmt_reset(THD *thd, Prepared_statement *stmt)
Reset a prepared statement in case there was a recoverable error.
Definition: sql_prepare.cc:2022
void mysql_sql_stmt_prepare(THD *thd)
SQLCOM_PREPARE implementation.
Definition: sql_prepare.cc:1790
One result set column.
Definition: sql_prepare.h:314
The LEX object currently serves three different purposes:
Definition: sql_lex.h:3638
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:78
void * Alloc(size_t length)
Allocate memory.
Definition: my_alloc.h:135
Definition: mysql_lex_string.h:39
Definition: mysql_lex_string.h:34
Definition: com_data.h:53
Definition: table.h:2612
unsigned int uint
Definition: uca-dump.cc:29
Definition: com_data.h:111