MySQL  8.0.19
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, 2019, Oracle and/or its affiliates. All rights reserved.
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 <stddef.h>
26 #include <sys/types.h>
27 #include <new>
28 
29 #include "lex_string.h"
30 #include "my_alloc.h"
31 #include "my_command.h"
32 #include "my_dbug.h"
33 #include "my_inttypes.h"
34 #include "my_psi_config.h"
36 #include "mysql_com.h"
37 #include "sql/sql_class.h" // Query_arena
38 #include "sql/sql_error.h"
39 #include "sql/sql_list.h"
40 
41 class Item;
42 class Item_param;
43 class Prepared_statement;
44 class Query_result_send;
45 class String;
46 struct LEX;
47 struct PS_PARAM;
48 struct TABLE_LIST;
49 union COM_DATA;
50 
51 /**
52  An interface that is used to take an action when
53  the locking module notices that a table version has changed
54  since the last execution. "Table" here may refer to any kind of
55  table -- a base table, a temporary table, a view or an
56  information schema table.
57 
58  When we open and lock tables for execution of a prepared
59  statement, we must verify that they did not change
60  since statement prepare. If some table did change, the statement
61  parse tree *may* be no longer valid, e.g. in case it contains
62  optimizations that depend on table metadata.
63 
64  This class provides an interface (a method) that is
65  invoked when such a situation takes place.
66  The implementation of the method simply reports an error, but
67  the exact details depend on the nature of the SQL statement.
68 
69  At most 1 instance of this class is active at a time, in which
70  case THD::m_reprepare_observer is not NULL.
71 
72  @sa check_and_update_table_version() for details of the
73  version tracking algorithm
74 
75  @sa Open_tables_state::m_reprepare_observer for the life cycle
76  of metadata observers.
77 */
78 
80  public:
81  /**
82  Check if a change of metadata is OK. In future
83  the signature of this method may be extended to accept the old
84  and the new versions, but since currently the check is very
85  simple, we only need the THD to report an error.
86  */
87  bool report_error(THD *thd);
88  bool is_invalidated() const { return m_invalidated; }
90 
91  private:
93 };
94 
95 bool mysql_stmt_precheck(THD *thd, const COM_DATA *com_data,
97  Prepared_statement **stmt);
98 void mysqld_stmt_prepare(THD *thd, const char *query, uint length,
99  Prepared_statement *stmt);
100 void mysqld_stmt_execute(THD *thd, Prepared_statement *stmt, bool has_new_types,
101  ulong execute_flags, PS_PARAM *parameters);
102 void mysqld_stmt_close(THD *thd, Prepared_statement *stmt);
103 void mysql_sql_stmt_prepare(THD *thd);
104 void mysql_sql_stmt_execute(THD *thd);
105 void mysql_sql_stmt_close(THD *thd);
106 void mysqld_stmt_fetch(THD *thd, Prepared_statement *stmt, ulong num_rows);
107 void mysqld_stmt_reset(THD *thd, Prepared_statement *stmt);
109  uint param_number, uchar *longdata, ulong length);
110 bool reinit_stmt_before_use(THD *thd, LEX *lex);
111 bool select_like_stmt_cmd_test(THD *thd, class Sql_cmd_dml *cmd,
112  ulong setup_tables_done_option);
113 bool mysql_test_show(Prepared_statement *stmt, TABLE_LIST *tables);
114 
115 /**
116  Execute a fragment of server code in an isolated context, so that
117  it doesn't leave any effect on THD. THD must have no open tables.
118  The code must not leave any open tables around.
119  The result of execution (if any) is stored in Ed_result.
120 */
121 
123  public:
124  virtual bool execute_server_code(THD *thd) = 0;
125  virtual ~Server_runnable();
126 };
127 
128 /**
129  Execute direct interface.
130 
131  @todo Implement support for prelocked mode.
132 */
133 
134 class Ed_row;
135 
136 /**
137  Ed_result_set -- a container with result set rows.
138  @todo Implement support for result set metadata and
139  automatic type conversion.
140 */
141 
143  public:
144  operator List<Ed_row> &() { return *m_rows; }
145  unsigned int size() const { return m_rows->elements; }
146  Ed_row *get_fields() { return m_fields; }
147 
148  Ed_result_set(List<Ed_row> *rows_arg, Ed_row *fields, size_t column_count,
149  MEM_ROOT *mem_root_arg);
150 
151  /** We don't call member destructors, they all are POD types. */
153 
154  size_t get_field_count() const { return m_column_count; }
155 
156  static void operator delete(void *, size_t) noexcept {
157  // Does nothing because m_mem_root is deallocated in the destructor
158  }
159 
160  static void operator delete(
161  void *, MEM_ROOT *, const std::nothrow_t &)noexcept { /* never called */
162  }
163 
164  private:
165  Ed_result_set(const Ed_result_set &); /* not implemented */
166  Ed_result_set &operator=(Ed_result_set &); /* not implemented */
167  private:
173  friend class Ed_connection;
174 };
175 
177  public:
178  /**
179  Construct a new "execute direct" connection.
180 
181  The connection can be used to execute SQL statements.
182  If the connection failed to initialize, the error
183  will be returned on the attempt to execute a statement.
184 
185  @pre thd must have no open tables
186  while the connection is used. However,
187  Ed_connection works okay in LOCK TABLES mode.
188  Other properties of THD, such as the current warning
189  information, errors, etc. do not matter and are
190  preserved by Ed_connection. One thread may have many
191  Ed_connections created for it.
192  */
193  Ed_connection(THD *thd);
194 
195  /**
196  Execute one SQL statement.
197 
198  Until this method is executed, no other methods of
199  Ed_connection can be used. Life cycle of Ed_connection is:
200 
201  Initialized -> a statement has been executed ->
202  look at result, move to next result ->
203  look at result, move to next result ->
204  ...
205  moved beyond the last result == Initialized.
206 
207  This method can be called repeatedly. Once it's invoked,
208  results of the previous execution are lost.
209 
210  A result of execute_direct() can be either:
211 
212  - success, no result set rows. In this case get_field_count()
213  returns 0. This happens after execution of INSERT, UPDATE,
214  DELETE, DROP and similar statements. Some other methods, such
215  as get_affected_rows() can be used to retrieve additional
216  result information.
217 
218  - success, there are some result set rows (maybe 0). E.g.
219  happens after SELECT. In this case get_field_count() returns
220  the number of columns in a result set and store_result()
221  can be used to retrieve a result set..
222 
223  - an error, methods to retrieve error information can
224  be used.
225 
226  @return execution status
227  @retval false success, use get_field_count()
228  to determine what to do next.
229  @retval true error, use get_last_error()
230  to see the error number.
231  */
232  bool execute_direct(LEX_STRING sql_text);
233 
234  /**
235  Same as the previous, but takes an instance of Server_runnable
236  instead of SQL statement text.
237 
238  @return execution status
239 
240  @retval false success, use get_field_count()
241  if your code fragment is supposed to
242  return a result set
243  @retval true failure
244  */
245  bool execute_direct(Server_runnable *server_runnable);
246 
247  /**
248  The following three members are only valid if execute_direct()
249  or move_to_next_result() returned an error.
250  They never fail, but if they are called when there is no
251  result, or no error, the result is not defined.
252  */
253  const char *get_last_error() const {
255  }
256 
257  unsigned int get_last_errno() const {
259  }
260 
262 
264 
265  private:
267  /**
268  Execute direct interface does not support multi-statements, only
269  multi-results. So we never have a situation when we have
270  a mix of result sets and OK or error packets. We either
271  have a single result set, a single error, or a single OK,
272  or we have a series of result sets, followed by an OK or error.
273  */
277  friend class Protocol_local;
278 
279  private:
280  void free_old_result();
281  void add_result_set(Ed_result_set *ed_result_set);
282 
283  private:
284  Ed_connection(const Ed_connection &); /* not implemented */
285  Ed_connection &operator=(Ed_connection &); /* not implemented */
286 };
287 
288 /** One result set column. */
289 
290 struct Ed_column final : public LEX_STRING {
291  /** Implementation note: destructor for this class is never called. */
292 };
293 
294 /** One result set record. */
295 
296 class Ed_row final {
297  public:
298  const Ed_column &operator[](const unsigned int column_index) const {
299  return *get_column(column_index);
300  }
301  const Ed_column *get_column(const unsigned int column_index) const {
302  DBUG_ASSERT(column_index < size());
303  return m_column_array + column_index;
304  }
305  size_t size() const { return m_column_count; }
306 
307  Ed_row(Ed_column *column_array_arg, size_t column_count_arg)
308  : m_column_array(column_array_arg), m_column_count(column_count_arg) {}
309 
310  private:
312  size_t m_column_count; /* TODO: change to point to metadata */
313 };
314 
315 class Server_side_cursor;
316 
317 /**
318  Prepared_statement: a statement that can contain placeholders.
319 */
320 
323 
324  public:
332 
333  /*
334  Uniquely identifies each statement object in thread scope; change during
335  statement lifetime.
336  */
337  const ulong id;
338 
339  LEX *lex; // parse tree descriptor
340 
341  /**
342  The query associated with this statement.
343  */
345 
346  /* Performance Schema interface for a prepared statement. */
348 
349  private:
351 
353  bool with_log;
354  LEX_CSTRING m_name; /* name for named prepared statements */
355  /**
356  Name of the current (default) database.
357 
358  If there is the current (default) database, "db" contains its name. If
359  there is no current (default) database, "db" is NULL and "db_length" is
360  0. In other words, "db", "db_length" must either be NULL, or contain a
361  valid database name.
362 
363  @note this attribute is set and alloced by the slave SQL thread (for
364  the THD of that thread); that thread is (and must remain, for now) the
365  only responsible for freeing this member.
366  */
368 
369  /**
370  The memory root to allocate parsed tree elements (instances of Item,
371  SELECT_LEX and other classes).
372  */
374 
375  public:
376  Prepared_statement(THD *thd_arg);
377  virtual ~Prepared_statement();
378  bool set_name(const LEX_CSTRING &name);
379  const LEX_CSTRING &name() const { return m_name; }
380  void close_cursor();
381  bool is_in_use() const { return flags & (uint)IS_IN_USE; }
382  bool is_sql_prepare() const { return flags & (uint)IS_SQL_PREPARE; }
384  bool prepare(const char *packet, size_t packet_length);
385  bool execute_loop(String *expanded_query, bool open_cursor);
386  bool execute_server_runnable(Server_runnable *server_runnable);
387 #ifdef HAVE_PSI_PS_INTERFACE
389 #endif
390  /* Destroy this statement */
391  void deallocate();
392  bool set_parameters(String *expanded_query, bool has_new_types,
393  PS_PARAM *parameters);
394  bool set_parameters(String *expanded_query);
395 
396  private:
397  void cleanup_stmt();
398  void setup_set_params();
399  bool set_db(const LEX_CSTRING &db_length);
400 
401  bool execute(String *expanded_query, bool open_cursor);
402  bool reprepare();
406  bool insert_params(String *query, PS_PARAM *parameters);
407 };
408 
409 #endif // SQL_PREPARE_H
Prepared_statement::name
const LEX_CSTRING & name() const
Definition: sql_prepare.h:379
Prepared_statement::flags
uint flags
Definition: sql_prepare.h:352
Diagnostics_area::mysql_errno
uint mysql_errno() const
Definition: sql_error.h:380
Ed_result_set::get_fields
Ed_row * get_fields()
Definition: sql_prepare.h:146
PS_PARAM
Definition: com_data.h:53
sql_class.h
MYSQL_LEX_CSTRING
Definition: mysql_lex_string.h:39
Item
Definition: item.h:665
THD
Definition: sql_class.h:764
Prepared_statement::param_count
uint param_count
Definition: sql_prepare.h:329
Ed_result_set
Ed_result_set – a container with result set rows.
Definition: sql_prepare.h:142
Ed_connection::m_current_rset
Ed_result_set * m_current_rset
Definition: sql_prepare.h:276
Ed_result_set::Ed_result_set
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:3312
Prepared_statement::m_query_string
LEX_CSTRING m_query_string
The query associated with this statement.
Definition: sql_prepare.h:344
Server_runnable
Execute a fragment of server code in an isolated context, so that it doesn't leave any effect on THD.
Definition: sql_prepare.h:122
mysqld_stmt_reset
void mysqld_stmt_reset(THD *thd, Prepared_statement *stmt)
Reset a prepared statement in case there was a recoverable error.
Definition: sql_prepare.cc:2036
Sql_cmd_dml
Definition: sql_cmd_dml.h:32
Ed_result_set::m_rows
List< Ed_row > * m_rows
Definition: sql_prepare.h:170
Prepared_statement::last_error
char last_error[MYSQL_ERRMSG_SIZE]
Definition: sql_prepare.h:331
Ed_connection::m_rsets
Ed_result_set * m_rsets
Definition: sql_prepare.h:275
Ed_row::size
size_t size() const
Definition: sql_prepare.h:305
Prepared_statement::Prepared_statement
Prepared_statement(THD *thd_arg)
Definition: sql_prepare.cc:2294
Prepared_statement::main_mem_root
MEM_ROOT main_mem_root
The memory root to allocate parsed tree elements (instances of Item, SELECT_LEX and other classes).
Definition: sql_prepare.h:373
Reprepare_observer::reset_reprepare_observer
void reset_reprepare_observer()
Definition: sql_prepare.h:89
Prepared_statement::last_errno
uint last_errno
Definition: sql_prepare.h:330
Prepared_statement::flag_values
flag_values
Definition: sql_prepare.h:322
Ed_connection::free_old_result
void free_old_result()
Free all result sets of the previous statement, if any, and reset warnings and errors.
Definition: sql_prepare.cc:3338
Prepared_statement::set_name
bool set_name(const LEX_CSTRING &name)
Definition: sql_prepare.cc:2379
psi_statement_bits.h
Prepared_statement::swap_prepared_statement
void swap_prepared_statement(Prepared_statement *copy)
Replace the original prepared statement with a prepared copy.
Definition: sql_prepare.cc:3010
Prepared_statement::~Prepared_statement
virtual ~Prepared_statement()
Destroy this prepared statement, cleaning up all used memory and resources.
Definition: sql_prepare.cc:2351
Ed_connection::~Ed_connection
~Ed_connection()
Definition: sql_prepare.h:263
Prepared_statement::execute_loop
bool execute_loop(String *expanded_query, bool open_cursor)
Execute a prepared statement.
Definition: sql_prepare.cc:2756
Ed_result_set::operator=
Ed_result_set & operator=(Ed_result_set &)
my_dbug.h
Server_runnable::execute_server_code
virtual bool execute_server_code(THD *thd)=0
String
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:164
Prepared_statement::with_log
bool with_log
Definition: sql_prepare.h:353
sql_error.h
mysqld_stmt_fetch
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:1995
my_psi_config.h
Ed_column
One result set column.
Definition: sql_prepare.h:290
Diagnostics_area::message_text
const char * message_text() const
Definition: sql_error.h:375
Ed_connection::operator=
Ed_connection & operator=(Ed_connection &)
Protocol_local
Protocol_local: a helper class to intercept the result of the data written to the network.
Definition: sql_prepare.cc:239
Prepared_statement::m_db
LEX_CSTRING m_db
Name of the current (default) database.
Definition: sql_prepare.h:367
mysqld_stmt_close
void mysqld_stmt_close(THD *thd, Prepared_statement *stmt)
Delete a prepared statement from memory.
Definition: sql_prepare.cc:2062
Ed_result_set::m_fields
Ed_row * m_fields
Definition: sql_prepare.h:171
Prepared_statement::set_parameters
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:2687
MYSQL_ERRMSG_SIZE
#define MYSQL_ERRMSG_SIZE
Max length of a error message.
Definition: mysql_com.h:826
Prepared_statement::m_name
LEX_CSTRING m_name
Definition: sql_prepare.h:354
reinit_stmt_before_use
bool reinit_stmt_before_use(THD *thd, LEX *lex)
Reinit prepared statement/stored procedure before execution.
Definition: sql_prepare.cc:1744
Prepared_statement::lex
LEX * lex
Definition: sql_prepare.h:339
Ed_result_set::m_mem_root
MEM_ROOT m_mem_root
Definition: sql_prepare.h:168
Reprepare_observer::report_error
bool report_error(THD *thd)
Check if a change of metadata is OK.
Definition: sql_prepare.cc:2200
my_alloc.h
Ed_result_set::size
unsigned int size() const
Definition: sql_prepare.h:145
Ed_connection::get_result_sets
Ed_result_set * get_result_sets()
Definition: sql_prepare.h:261
Ed_connection::m_diagnostics_area
Diagnostics_area m_diagnostics_area
Definition: sql_prepare.h:266
Prepared_statement::insert_params_from_vars
bool insert_params_from_vars(List< LEX_STRING > &varnames, String *query)
Assign prepared statement parameters from user variables.
Definition: sql_prepare.cc:891
Query_result_send
Definition: query_result.h:187
Prepared_statement::deallocate
void deallocate()
Common part of DEALLOCATE PREPARE and mysqld_stmt_close.
Definition: sql_prepare.cc:3291
my_inttypes.h
Prepared_statement::reprepare
bool reprepare()
Reprepare this prepared statement.
Definition: sql_prepare.cc:2929
Ed_row::get_column
const Ed_column * get_column(const unsigned int column_index) const
Definition: sql_prepare.h:301
Prepared_statement::prepare
bool prepare(const char *packet, size_t packet_length)
Parse statement text, validate the statement, and prepare it for execution.
Definition: sql_prepare.cc:2435
COM_DATA
Definition: com_data.h:106
Prepared_statement::is_in_use
bool is_in_use() const
Definition: sql_prepare.h:381
Prepared_statement::IS_SQL_PREPARE
@ IS_SQL_PREPARE
Definition: sql_prepare.h:322
select_like_stmt_cmd_test
bool select_like_stmt_cmd_test(THD *thd, class Sql_cmd_dml *cmd, ulong setup_tables_done_option)
Prepared_statement::thd
THD * thd
Definition: sql_prepare.h:326
MEM_ROOT
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:77
mysqld_stmt_prepare
void mysqld_stmt_prepare(THD *thd, const char *query, uint length, Prepared_statement *stmt)
COM_STMT_PREPARE handler.
Definition: sql_prepare.cc:1451
Item_param
Placeholder ('?') of prepared statement.
Definition: item.h:3649
lex_string.h
Reprepare_observer
An interface that is used to take an action when the locking module notices that a table version has ...
Definition: sql_prepare.h:79
Ed_result_set::m_column_count
size_t m_column_count
Definition: sql_prepare.h:169
Prepared_statement::insert_params
bool insert_params(String *query, PS_PARAM *parameters)
Routines to assign parameters from data supplied by the client.
Definition: sql_prepare.cc:759
Server_side_cursor
Server_side_cursor – an interface for materialized implementation of cursors.
Definition: sql_cursor.h:51
Reprepare_observer::is_invalidated
bool is_invalidated() const
Definition: sql_prepare.h:88
Ed_row::Ed_row
Ed_row(Ed_column *column_array_arg, size_t column_count_arg)
Definition: sql_prepare.h:307
uint
unsigned int uint
Definition: uca-dump.cc:29
Prepared_statement::is_sql_prepare
bool is_sql_prepare() const
Definition: sql_prepare.h:382
Ed_connection::Ed_connection
Ed_connection(THD *thd)
Construct a new "execute direct" connection.
Definition: sql_prepare.cc:3328
mysql_com.h
my_command.h
Prepared_statement::get_PS_prepared_stmt
PSI_prepared_stmt * get_PS_prepared_stmt()
Definition: sql_prepare.h:388
Ed_row::m_column_array
Ed_column * m_column_array
Definition: sql_prepare.h:311
Prepared_statement::id
const ulong id
Definition: sql_prepare.h:337
TABLE_LIST
Definition: table.h:2467
Query_arena
Definition: sql_class.h:226
cmd
COM_DATA cmd
Definition: test_session_info.cc:95
uchar
unsigned char uchar
Definition: my_inttypes.h:51
Ed_row
One result set record.
Definition: sql_prepare.h:296
mysql_sql_stmt_close
void mysql_sql_stmt_close(THD *thd)
SQLCOM_DEALLOCATE implementation.
Definition: sql_prepare.cc:2085
Ed_row::m_column_count
size_t m_column_count
Definition: sql_prepare.h:312
Prepared_statement::result
Query_result_send * result
Definition: sql_prepare.h:350
Ed_connection
Definition: sql_prepare.h:176
Ed_connection::m_thd
THD * m_thd
Execute direct interface does not support multi-statements, only multi-results.
Definition: sql_prepare.h:274
PSI_prepared_stmt
struct PSI_prepared_stmt PSI_prepared_stmt
Definition: psi_statement_bits.h:80
Prepared_statement::setup_set_params
void setup_set_params()
Definition: sql_prepare.cc:2323
query
static char * query
Definition: myisam_ftdump.cc:44
Ed_connection::add_result_set
void add_result_set(Ed_result_set *ed_result_set)
A helper method that is called only during execution.
Definition: sql_prepare.cc:3416
Ed_result_set::m_next_rset
Ed_result_set * m_next_rset
Definition: sql_prepare.h:172
MYSQL_LEX_STRING
Definition: mysql_lex_string.h:34
LEX
Definition: sql_lex.h:3221
mysql_sql_stmt_prepare
void mysql_sql_stmt_prepare(THD *thd)
SQLCOM_PREPARE implementation.
Definition: sql_prepare.cc:1669
sql_list.h
DBUG_ASSERT
#define DBUG_ASSERT(A)
Definition: my_dbug.h:197
Prepared_statement::set_db
bool set_db(const LEX_CSTRING &db_length)
Remember the current database.
Definition: sql_prepare.cc:2396
Prepared_statement::set_sql_prepare
void set_sql_prepare()
Definition: sql_prepare.h:383
Ed_result_set::get_field_count
size_t get_field_count() const
Definition: sql_prepare.h:154
Reprepare_observer::m_invalidated
bool m_invalidated
Definition: sql_prepare.h:92
mysql_stmt_precheck
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:1494
Prepared_statement::validate_metadata
bool validate_metadata(Prepared_statement *copy)
Validate statement result set metadata (if the statement returns a result set).
Definition: sql_prepare.cc:2986
Prepared_statement::execute
bool execute(String *expanded_query, bool open_cursor)
Execute a prepared statement.
Definition: sql_prepare.cc:3073
Ed_connection::get_last_errno
unsigned int get_last_errno() const
Definition: sql_prepare.h:257
Ed_connection::execute_direct
bool execute_direct(LEX_STRING sql_text)
Execute one SQL statement.
Definition: sql_prepare.cc:3353
Ed_connection::get_last_error
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:253
gis::length
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
Prepared_statement::IS_IN_USE
@ IS_IN_USE
Definition: sql_prepare.h:322
Prepared_statement::close_cursor
void close_cursor()
Definition: sql_prepare.cc:2316
ulong
unsigned long ulong
Definition: my_inttypes.h:48
Diagnostics_area
Stores status of the currently executed statement.
Definition: sql_error.h:268
Prepared_statement::param_array
Item_param ** param_array
Definition: sql_prepare.h:327
List< Ed_row >
Prepared_statement::m_prepared_stmt
PSI_prepared_stmt * m_prepared_stmt
Definition: sql_prepare.h:347
mysqld_stmt_execute
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:1895
Server_runnable::~Server_runnable
virtual ~Server_runnable()
Definition: sql_prepare.cc:2224
mysql_stmt_get_longdata
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:2123
final
#define final(a, b, c)
Definition: hash.c:109
mysql_test_show
bool mysql_test_show(Prepared_statement *stmt, TABLE_LIST *tables)
Validate SHOW statement.
Definition: sql_prepare.cc:975
Ed_result_set::~Ed_result_set
~Ed_result_set()
We don't call member destructors, they all are POD types.
Definition: sql_prepare.h:152
enum_server_command
enum_server_command
A list of all MySQL protocol commands.
Definition: my_command.h:47
Prepared_statement::cleanup_stmt
void cleanup_stmt()
Definition: sql_prepare.cc:2370
mysql_sql_stmt_execute
void mysql_sql_stmt_execute(THD *thd)
SQLCOM_EXECUTE implementation.
Definition: sql_prepare.cc:1959
Prepared_statement::cursor
Server_side_cursor * cursor
Definition: sql_prepare.h:328
Ed_row::operator[]
const Ed_column & operator[](const unsigned int column_index) const
Definition: sql_prepare.h:298
Prepared_statement::execute_server_runnable
bool execute_server_runnable(Server_runnable *server_runnable)
Definition: sql_prepare.cc:2882
Prepared_statement::m_arena
Query_arena m_arena
Definition: sql_prepare.h:325
Prepared_statement
Prepared_statement: a statement that can contain placeholders.
Definition: sql_prepare.h:321