MySQL  8.0.19
Source Code Documentation
que0que.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3 Copyright (c) 1996, 2019, Oracle and/or its affiliates. All Rights Reserved.
4 
5 This program is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License, version 2.0, as published by the
7 Free Software Foundation.
8 
9 This program is also distributed with certain software (including but not
10 limited to OpenSSL) that is licensed under separate terms, as designated in a
11 particular file or component or in included license documentation. The authors
12 of MySQL hereby grant you an additional permission to link the program and
13 your derivative works with the separately licensed software that they have
14 included with MySQL.
15 
16 This program is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0,
19 for more details.
20 
21 You should have received a copy of the GNU General Public License along with
22 this program; if not, write to the Free Software Foundation, Inc.,
23 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 
25 *****************************************************************************/
26 
27 /** @file include/que0que.h
28  Query graph
29 
30  Created 5/27/1996 Heikki Tuuri
31  *******************************************************/
32 
33 #ifndef que0que_h
34 #define que0que_h
35 
36 #include "data0data.h"
37 #include "dict0types.h"
38 #include "pars0types.h"
39 #include "que0types.h"
40 #include "row0types.h"
41 #include "srv0srv.h"
42 #include "trx0roll.h"
43 #include "trx0trx.h"
44 #include "univ.i"
45 #include "usr0types.h"
46 
47 /** Mutex protecting the query threads. */
48 extern ib_mutex_t que_thr_mutex;
49 
50 /** Creates a query graph fork node.
51  @return own: fork node */
53  que_t *graph, /*!< in: graph, if NULL then this
54  fork node is assumed to be the
55  graph root */
56  que_node_t *parent, /*!< in: parent node */
57  ulint fork_type, /*!< in: fork type */
58  mem_heap_t *heap); /*!< in: memory heap where created */
59 /** Gets the first thr in a fork. */
60 UNIV_INLINE
61 que_thr_t *que_fork_get_first_thr(que_fork_t *fork); /*!< in: query fork */
62 /** Gets the child node of the first thr in a fork. */
63 UNIV_INLINE
64 que_node_t *que_fork_get_child(que_fork_t *fork); /*!< in: query fork */
65 
66 /** Sets the parent of a graph node.
67 @param[in] node graph node
68 @param[in] parent parent */
69 UNIV_INLINE
70 void que_node_set_parent(que_node_t *node, que_node_t *parent);
71 
72 /** Creates a query graph thread node.
73 @param[in] parent parent node, i.e., a fork node
74 @param[in] heap memory heap where created
75 @param[in] prebuilt row prebuilt structure
76 @return own: query thread node */
78  row_prebuilt_t *prebuilt);
79 /** Frees a query graph, but not the heap where it was created. Does not free
80  explicit cursor declarations, they are freed in que_graph_free. */
81 void que_graph_free_recursive(que_node_t *node); /*!< in: query graph node */
82 /** Frees a query graph. */
83 void que_graph_free(que_t *graph); /*!< in: query graph; we assume that the
84  memory heap where this graph was created is
85  private to this graph: if not, then use
86  que_graph_free_recursive and free the heap
87  afterwards! */
88 /** Stops a query thread if graph or trx is in a state requiring it. The
89  conditions are tested in the order (1) graph, (2) trx. The lock_sys_t::mutex
90  has to be reserved.
91  @return true if stopped */
92 ibool que_thr_stop(que_thr_t *thr); /*!< in: query thread */
93 /** Moves a thread from another state to the QUE_THR_RUNNING state. Increments
94  the n_active_thrs counters of the query graph and transaction. */
96  que_thr_t *thr, /*!< in: an query thread */
97  trx_t *trx); /*!< in: transaction */
98 /** A patch for MySQL used to 'stop' a dummy query thread used in MySQL
99  select, when there is no error or lock wait. */
100 void que_thr_stop_for_mysql_no_error(que_thr_t *thr, /*!< in: query thread */
101  trx_t *trx); /*!< in: transaction */
102 /** A patch for MySQL used to 'stop' a dummy query thread used in MySQL. The
103  query thread is stopped and made inactive, except in the case where
104  it was put to the lock wait state in lock0lock.cc, but the lock has already
105  been granted or the transaction chosen as a victim in deadlock resolution. */
106 void que_thr_stop_for_mysql(que_thr_t *thr); /*!< in: query thread */
107 /** Run a query thread. Handles lock waits. */
108 void que_run_threads(que_thr_t *thr); /*!< in: query thread */
109 /** Moves a suspended query thread to the QUE_THR_RUNNING state and release
110  a worker thread to execute it. This function should be used to end
111  the wait state of a query thread waiting for a lock or a stored procedure
112  completion.
113  @return query thread instance of thread to wakeup or NULL */
114 que_thr_t *que_thr_end_lock_wait(trx_t *trx); /*!< in: transaction in the
115  QUE_THR_LOCK_WAIT state */
116 /** Starts execution of a command in a query fork. Picks a query thread which
117  is not in the QUE_THR_RUNNING state and moves it to that state. If none
118  can be chosen, a situation which may arise in parallelized fetches, NULL
119  is returned.
120  @return a query thread of the graph moved to QUE_THR_RUNNING state, or
121  NULL; the query thread should be executed by que_run_threads by the
122  caller */
123 que_thr_t *que_fork_start_command(que_fork_t *fork); /*!< in: a query fork */
124 /** Gets the trx of a query thread. */
125 UNIV_INLINE
126 trx_t *thr_get_trx(que_thr_t *thr); /*!< in: query thread */
127 /** Determines if this thread is rolling back an incomplete transaction
128  in crash recovery.
129  @return true if thr is rolling back an incomplete transaction in crash
130  recovery */
131 UNIV_INLINE
132 ibool thr_is_recv(const que_thr_t *thr); /*!< in: query thread */
133 /** Gets the type of a graph node. */
134 UNIV_INLINE
135 ulint que_node_get_type(const que_node_t *node); /*!< in: graph node */
136 /** Gets pointer to the value data type field of a graph node. */
137 UNIV_INLINE
138 dtype_t *que_node_get_data_type(que_node_t *node); /*!< in: graph node */
139 /** Gets pointer to the value dfield of a graph node. */
140 UNIV_INLINE
141 dfield_t *que_node_get_val(que_node_t *node); /*!< in: graph node */
142 /** Gets the value buffer size of a graph node.
143  @return val buffer size, not defined if val.data == NULL in node */
144 UNIV_INLINE
145 ulint que_node_get_val_buf_size(que_node_t *node); /*!< in: graph node */
146 
147 /** Sets the value buffer size of a graph node.
148 @param[in] node graph node
149 @param[in] size size */
150 UNIV_INLINE
151 void que_node_set_val_buf_size(que_node_t *node, ulint size);
152 
153 /** Gets the next list node in a list of query graph nodes. */
154 UNIV_INLINE
155 que_node_t *que_node_get_next(que_node_t *node); /*!< in: node in a list */
156 /** Gets the parent node of a query graph node.
157  @return parent node or NULL */
158 UNIV_INLINE
159 que_node_t *que_node_get_parent(que_node_t *node); /*!< in: node */
160 /** Get the first containing loop node (e.g. while_node_t or for_node_t) for the
161  given node, or NULL if the node is not within a loop.
162  @return containing loop node, or NULL. */
164  que_node_t *node); /*!< in: node */
165 
166 /** Catenates a query graph node to a list of them, possible empty list.
167 @param[in] node_list node list, or NULL
168 @param[in] node node
169 @return one-way list of nodes */
170 UNIV_INLINE
172 
173 /*************************************************************************
174 Get the last node from the list.*/
175 UNIV_INLINE
177  /* out: node last node from list.*/
178  que_node_t *node_list); /* in: node list, or NULL */
179 /** Gets a query graph node list length.
180  @return length, for NULL list 0 */
181 UNIV_INLINE
183  que_node_t *node_list); /*!< in: node list, or NULL */
184 /** Checks if graph, trx, or session is in a state where the query thread should
185  be stopped.
186  @return true if should be stopped; NOTE that if the peek is made
187  without reserving the trx_t::mutex, then another peek with the mutex
188  reserved is necessary before deciding the actual stopping */
189 UNIV_INLINE
190 ibool que_thr_peek_stop(que_thr_t *thr); /*!< in: query thread */
191 /** Returns TRUE if the query graph is for a SELECT statement.
192  @return true if a select */
193 UNIV_INLINE
194 ibool que_graph_is_select(que_t *graph); /*!< in: graph */
195 /** Prints info of an SQL query graph node. */
196 void que_node_print_info(que_node_t *node); /*!< in: query graph node */
197 /** Evaluate the given SQL
198  @return error code or DB_SUCCESS */
199 dberr_t que_eval_sql(pars_info_t *info, /*!< in: info struct, or NULL */
200  const char *sql, /*!< in: SQL string */
201  ibool reserve_dict_mutex,
202  /*!< in: if TRUE, acquire/release
203  dict_sys->mutex around call to pars_sql. */
204  trx_t *trx); /*!< in: trx */
205 
206 /** Round robin scheduler.
207  @return a query thread of the graph moved to QUE_THR_RUNNING state, or
208  NULL; the query thread should be executed by que_run_threads by the
209  caller */
211  que_fork_t *fork, /*!< in: a query fork */
212  que_thr_t *thr); /*!< in: current pos */
213 
214 /** Initialise the query sub-system. */
215 void que_init(void);
216 
217 /** Close the query sub-system. */
218 void que_close(void);
219 
220 /** Query thread states */
224  /** in selects this means that the thread is at the end of its
225  result set (or start, in case of a scroll cursor); in other
226  statements, this means the thread has done its task */
231 };
232 
233 /** Query thread lock states */
238 };
239 
240 /** From where the cursor position is counted */
242 
243 /* Query graph query thread node: the fields are protected by the
244 trx_t::mutex with the exceptions named below */
245 
246 struct que_thr_t {
247  que_common_t common; /*!< type: QUE_NODE_THR */
248  ulint magic_n; /*!< magic number to catch memory
249  corruption */
250  que_node_t *child; /*!< graph child node */
251  que_t *graph; /*!< graph where this node belongs */
252  que_thr_state_t state; /*!< state of the query thread */
253  ibool is_active; /*!< TRUE if the thread has been set
254  to the run state in
255  que_thr_move_to_run_state, but not
256  deactivated in
257  que_thr_dec_reference_count */
258  /*------------------------------*/
259  /* The following fields are private to the OS thread executing the
260  query thread, and are not protected by any mutex: */
261 
262  que_node_t *run_node; /*!< pointer to the node where the
263  subgraph down from this node is
264  currently executed */
265  que_node_t *prev_node; /*!< pointer to the node from which
266  the control came */
267  ulint resource; /*!< resource usage of the query thread
268  thus far */
269  ulint lock_state; /*!< lock state of thread (table or
270  row) */
271 
272  /** The thread slot in the lock_sys->waiting_threads array protected by
273  lock_sys->wait_mutex when writing to it, and also by trx->mutex when changing
274  from null to non-null.
275  While reading, one either hold the lock_sys->wait_mutex, or hold the
276  lock_sys->mutex, trx->mutex and a proof that noone else has woken the trx yet,
277  so the slot is either null, or changing to non-null, but definitely not
278  changing from non-null to null (as it happens after wake up). */
279  struct srv_slot_t *slot;
280  /*------------------------------*/
281  /* The following fields are links for the various lists that
282  this type can be on. */
284  thrs; /*!< list of thread nodes of the fork
285  node */
287  trx_thrs; /*!< lists of threads in wait list of
288  the trx */
290  queue; /*!< list of runnable thread nodes in
291  the server task queue */
292  ulint fk_cascade_depth; /*!< maximum cascading call depth
293  supported for foreign key constraint
294  related delete/updates */
295  row_prebuilt_t *prebuilt; /*!< prebuilt structure processed by
296  the query thread */
297 };
298 
299 #define QUE_THR_MAGIC_N 8476583
300 #define QUE_THR_MAGIC_FREED 123461526
301 
302 /* Query graph fork node: its fields are protected by the query thread mutex */
303 struct que_fork_t {
304  que_common_t common; /*!< type: QUE_NODE_FORK */
305  que_t *graph; /*!< query graph of this node */
306  ulint fork_type; /*!< fork type */
307  ulint n_active_thrs; /*!< if this is the root of a graph, the
308  number query threads that have been
309  started in que_thr_move_to_run_state
310  but for which que_thr_dec_refer_count
311  has not yet been called */
312  trx_t *trx; /*!< transaction: this is set only in
313  the root node */
314  ulint state; /*!< state of the fork node */
315  que_thr_t *caller; /*!< pointer to a possible calling query
316  thread */
318  thrs; /*!< list of query threads */
319  /*------------------------------*/
320  /* The fields in this section are defined only in the root node */
321  sym_tab_t *sym_tab; /*!< symbol table of the query,
322  generated by the parser, or NULL
323  if the graph was created 'by hand' */
324  pars_info_t *info; /*!< info struct, or NULL */
325  /* The following cur_... fields are relevant only in a select graph */
326 
327  ulint cur_end; /*!< QUE_CUR_NOT_DEFINED, QUE_CUR_START,
328  QUE_CUR_END */
329  ulint cur_pos; /*!< if there are n rows in the result
330  set, values 0 and n + 1 mean before
331  first row, or after last row, depending
332  on cur_end; values 1...n mean a row
333  index */
334  ibool cur_on_row; /*!< TRUE if cursor is on a row, i.e.,
335  it is not before the first row or
336  after the last row */
337  sel_node_t *last_sel_node; /*!< last executed select node, or NULL
338  if none */
340  graphs; /*!< list of query graphs of a session
341  or a stored procedure */
342  /*------------------------------*/
343  mem_heap_t *heap; /*!< memory heap where the fork was
344  created */
345 };
346 
347 /* Query fork (or graph) types */
348 #define QUE_FORK_SELECT_NON_SCROLL 1 /* forward-only cursor */
349 #define QUE_FORK_SELECT_SCROLL 2 /* scrollable cursor */
350 #define QUE_FORK_INSERT 3
351 #define QUE_FORK_UPDATE 4
352 #define QUE_FORK_ROLLBACK 5
353 /* This is really the undo graph used in rollback,
354 no signal-sending roll_node in this graph */
355 #define QUE_FORK_PURGE 6
356 #define QUE_FORK_EXECUTE 7
357 #define QUE_FORK_PROCEDURE 8
358 #define QUE_FORK_PROCEDURE_CALL 9
359 #define QUE_FORK_MYSQL_INTERFACE 10
360 #define QUE_FORK_RECOVERY 11
361 
362 /* Query fork (or graph) states */
363 #define QUE_FORK_ACTIVE 1
364 #define QUE_FORK_COMMAND_WAIT 2
365 #define QUE_FORK_INVALID 3
366 #define QUE_FORK_BEING_FREED 4
367 
368 /* Flag which is ORed to control structure statement node types */
369 #define QUE_NODE_CONTROL_STAT 1024
370 
371 /* Query graph node types */
372 #define QUE_NODE_LOCK 1
373 #define QUE_NODE_INSERT 2
374 #define QUE_NODE_UPDATE 4
375 #define QUE_NODE_CURSOR 5
376 #define QUE_NODE_SELECT 6
377 #define QUE_NODE_AGGREGATE 7
378 #define QUE_NODE_FORK 8
379 #define QUE_NODE_THR 9
380 #define QUE_NODE_UNDO 10
381 #define QUE_NODE_COMMIT 11
382 #define QUE_NODE_ROLLBACK 12
383 #define QUE_NODE_PURGE 13
384 #define QUE_NODE_SYMBOL 14
385 #define QUE_NODE_RES_WORD 15
386 #define QUE_NODE_FUNC 16
387 #define QUE_NODE_ORDER 17
388 #define QUE_NODE_PROC (18 + QUE_NODE_CONTROL_STAT)
389 #define QUE_NODE_IF (19 + QUE_NODE_CONTROL_STAT)
390 #define QUE_NODE_WHILE (20 + QUE_NODE_CONTROL_STAT)
391 #define QUE_NODE_ASSIGNMENT 21
392 #define QUE_NODE_FETCH 22
393 #define QUE_NODE_OPEN 23
394 #define QUE_NODE_COL_ASSIGNMENT 24
395 #define QUE_NODE_FOR (25 + QUE_NODE_CONTROL_STAT)
396 #define QUE_NODE_RETURN 26
397 #define QUE_NODE_ELSIF 27
398 #define QUE_NODE_CALL 28
399 #define QUE_NODE_EXIT 29
400 
401 #include "que0que.ic"
402 
403 #endif
que_fork_get_child
UNIV_INLINE que_node_t * que_fork_get_child(que_fork_t *fork)
Gets the child node of the first thr in a fork.
que_fork_t::n_active_thrs
ulint n_active_thrs
if this is the root of a graph, the number query threads that have been started in que_thr_move_to_ru...
Definition: que0que.h:307
que_node_get_val_buf_size
UNIV_INLINE ulint que_node_get_val_buf_size(que_node_t *node)
Gets the value buffer size of a graph node.
dict0types.h
QUE_THR_LOCK_ROW
@ QUE_THR_LOCK_ROW
Definition: que0que.h:236
QUE_CUR_NOT_DEFINED
@ QUE_CUR_NOT_DEFINED
Definition: que0que.h:241
QUE_THR_LOCK_TABLE
@ QUE_THR_LOCK_TABLE
Definition: que0que.h:237
UT_LIST_BASE_NODE_T
#define UT_LIST_BASE_NODE_T(TYPE)
Definition: innodb_utility.h:46
que_thr_t::prebuilt
row_prebuilt_t * prebuilt
prebuilt structure processed by the query thread
Definition: que0que.h:295
que_thr_stop
ibool que_thr_stop(que_thr_t *thr)
Stops a query thread if graph or trx is in a state requiring it.
Definition: que0que.cc:597
que_thr_stop_for_mysql
void que_thr_stop_for_mysql(que_thr_t *thr)
A patch for MySQL used to 'stop' a dummy query thread used in MySQL.
Definition: que0que.cc:693
que_thr_t::magic_n
ulint magic_n
magic number to catch memory corruption
Definition: que0que.h:248
que_thr_t::thrs
thrs
list of thread nodes of the fork node
Definition: que0que.h:284
UT_LIST_NODE_T
#define UT_LIST_NODE_T(TYPE)
Definition: innodb_utility.h:40
pars0types.h
QUE_THR_LOCK_WAIT
@ QUE_THR_LOCK_WAIT
Definition: que0que.h:229
que_thr_t::trx_thrs
trx_thrs
lists of threads in wait list of the trx
Definition: que0que.h:287
que_thr_t::is_active
ibool is_active
TRUE if the thread has been set to the run state in que_thr_move_to_run_state, but not deactivated in...
Definition: que0que.h:253
pars_info_t
Extra information supplied for pars_sql().
Definition: pars0pars.h:442
que_fork_t::trx
trx_t * trx
transaction: this is set only in the root node
Definition: que0que.h:312
dberr_t
dberr_t
Definition: db0err.h:38
que_thr_mutex
ib_mutex_t que_thr_mutex
Mutex protecting the query threads.
que_thr_end_lock_wait
que_thr_t * que_thr_end_lock_wait(trx_t *trx)
Moves a suspended query thread to the QUE_THR_RUNNING state and release a worker thread to execute it...
Definition: que0que.cc:190
que_thr_t::child
que_node_t * child
graph child node
Definition: que0que.h:250
que_graph_is_select
UNIV_INLINE ibool que_graph_is_select(que_t *graph)
Returns TRUE if the query graph is for a SELECT statement.
que0types.h
mem_block_info_t
The info structure stored at the beginning of a heap block.
Definition: mem0mem.h:337
que_thr_t::prev_node
que_node_t * prev_node
pointer to the node from which the control came
Definition: que0que.h:265
que_node_get_containing_loop_node
que_node_t * que_node_get_containing_loop_node(que_node_t *node)
Get the first containing loop node (e.g.
Definition: que0que.cc:770
srv0srv.h
que_node_get_data_type
UNIV_INLINE dtype_t * que_node_get_data_type(que_node_t *node)
Gets pointer to the value data type field of a graph node.
que_thr_state_t
que_thr_state_t
Query thread states.
Definition: que0que.h:221
que_cur_t
que_cur_t
From where the cursor position is counted.
Definition: que0que.h:241
que_fork_t::graph
que_t * graph
query graph of this node
Definition: que0que.h:305
QUE_THR_COMPLETED
@ QUE_THR_COMPLETED
in selects this means that the thread is at the end of its result set (or start, in case of a scroll ...
Definition: que0que.h:227
que_init
void que_init(void)
Initialise the query sub-system.
Definition: que0que.cc:1087
QUE_THR_PROCEDURE_WAIT
@ QUE_THR_PROCEDURE_WAIT
Definition: que0que.h:223
que_thr_stop_for_mysql_no_error
void que_thr_stop_for_mysql_no_error(que_thr_t *thr, trx_t *trx)
A patch for MySQL used to 'stop' a dummy query thread used in MySQL select, when there is no error or...
Definition: que0que.cc:750
que_node_list_get_last
UNIV_INLINE que_node_t * que_node_list_get_last(que_node_t *node_list)
trx0roll.h
row0types.h
que_graph_free
void que_graph_free(que_t *graph)
Frees a query graph.
Definition: que0que.cc:509
que_node_list_get_len
UNIV_INLINE ulint que_node_list_get_len(que_node_t *node_list)
Gets a query graph node list length.
que_thr_lock_t
que_thr_lock_t
Query thread lock states.
Definition: que0que.h:234
que_node_set_parent
UNIV_INLINE void que_node_set_parent(que_node_t *node, que_node_t *parent)
Sets the parent of a graph node.
sym_tab_t
Symbol table.
Definition: pars0sym.h:200
que_thr_t::common
que_common_t common
type: QUE_NODE_THR
Definition: que0que.h:247
que_thr_peek_stop
UNIV_INLINE ibool que_thr_peek_stop(que_thr_t *thr)
Checks if graph, trx, or session is in a state where the query thread should be stopped.
que_node_t
void que_node_t
Definition: que0types.h:40
que_common_t
Definition: que0types.h:50
que_thr_t::queue
queue
list of runnable thread nodes in the server task queue
Definition: que0que.h:290
que_thr_t::lock_state
ulint lock_state
lock state of thread (table or row)
Definition: que0que.h:269
dtype_t
Definition: data0type.h:471
thr_get_trx
UNIV_INLINE trx_t * thr_get_trx(que_thr_t *thr)
Gets the trx of a query thread.
que_node_get_parent
UNIV_INLINE que_node_t * que_node_get_parent(que_node_t *node)
Gets the parent node of a query graph node.
que_fork_t::common
que_common_t common
type: QUE_NODE_FORK
Definition: que0que.h:304
que_fork_scheduler_round_robin
que_thr_t * que_fork_scheduler_round_robin(que_fork_t *fork, que_thr_t *thr)
Round robin scheduler.
Definition: que0que.cc:235
que_node_get_type
UNIV_INLINE ulint que_node_get_type(const que_node_t *node)
Gets the type of a graph node.
thr_is_recv
UNIV_INLINE ibool thr_is_recv(const que_thr_t *thr)
Determines if this thread is rolling back an incomplete transaction in crash recovery.
que_run_threads
void que_run_threads(que_thr_t *thr)
Run a query thread.
Definition: que0que.cc:1002
sel_node_t
Select statement node.
Definition: row0sel.h:337
que_fork_get_first_thr
UNIV_INLINE que_thr_t * que_fork_get_first_thr(que_fork_t *fork)
Gets the first thr in a fork.
usr0types.h
que_fork_t
Definition: que0que.h:303
que_thr_t::state
que_thr_state_t state
state of the query thread
Definition: que0que.h:252
que_fork_t::state
ulint state
state of the fork node
Definition: que0que.h:314
que_thr_create
que_thr_t * que_thr_create(que_fork_t *parent, mem_heap_t *heap, row_prebuilt_t *prebuilt)
Creates a query graph thread node.
Definition: que0que.cc:157
que_thr_t::resource
ulint resource
resource usage of the query thread thus far
Definition: que0que.h:267
que_thr_t::graph
que_t * graph
graph where this node belongs
Definition: que0que.h:251
QUE_THR_RUNNING
@ QUE_THR_RUNNING
Definition: que0que.h:222
que_eval_sql
dberr_t que_eval_sql(pars_info_t *info, const char *sql, ibool reserve_dict_mutex, trx_t *trx)
Evaluate the given SQL.
Definition: que0que.cc:1049
que_fork_t::fork_type
ulint fork_type
fork type
Definition: que0que.h:306
data0data.h
QUE_THR_COMMAND_WAIT
@ QUE_THR_COMMAND_WAIT
Definition: que0que.h:228
trx0trx.h
que_fork_t::caller
que_thr_t * caller
pointer to a possible calling query thread
Definition: que0que.h:315
srv_slot_t
Thread slot in the thread table.
Definition: srv0srv.h:1164
dfield_t
Structure for an SQL data field.
Definition: data0data.h:644
QUE_CUR_END
@ QUE_CUR_END
Definition: que0que.h:241
que_graph_free_recursive
void que_graph_free_recursive(que_node_t *node)
Frees a query graph, but not the heap where it was created.
Definition: que0que.cc:366
que_thr_move_to_run_state_for_mysql
void que_thr_move_to_run_state_for_mysql(que_thr_t *thr, trx_t *trx)
Moves a thread from another state to the QUE_THR_RUNNING state.
Definition: que0que.cc:731
que_thr_t
Definition: que0que.h:246
row_prebuilt_t
A struct for (sometimes lazily) prebuilt structures in an Innobase table handle used within MySQL; th...
Definition: row0mysql.h:539
que_close
void que_close(void)
Close the query sub-system.
Definition: que0que.cc:1091
QUE_CUR_START
@ QUE_CUR_START
Definition: que0que.h:241
que_thr_t::slot
struct srv_slot_t * slot
The thread slot in the lock_sys->waiting_threads array protected by lock_sys->wait_mutex when writing...
Definition: que0que.h:279
QUE_THR_SUSPENDED
@ QUE_THR_SUSPENDED
Definition: que0que.h:230
que_thr_t::run_node
que_node_t * run_node
pointer to the node where the subgraph down from this node is currently executed
Definition: que0que.h:262
info
Log info(cout, "NOTE")
que_fork_create
que_fork_t * que_fork_create(que_t *graph, que_node_t *parent, ulint fork_type, mem_heap_t *heap)
Creates a query graph fork node.
Definition: que0que.cc:121
que_node_print_info
void que_node_print_info(que_node_t *node)
Prints info of an SQL query graph node.
QUE_THR_LOCK_NOLOCK
@ QUE_THR_LOCK_NOLOCK
Definition: que0que.h:235
trx_t
Definition: trx0trx.h:780
que_node_get_val
UNIV_INLINE dfield_t * que_node_get_val(que_node_t *node)
Gets pointer to the value dfield of a graph node.
que_fork_start_command
que_thr_t * que_fork_start_command(que_fork_t *fork)
Starts execution of a command in a query fork.
Definition: que0que.cc:279
que_node_set_val_buf_size
UNIV_INLINE void que_node_set_val_buf_size(que_node_t *node, ulint size)
Sets the value buffer size of a graph node.
que_thr_t::fk_cascade_depth
ulint fk_cascade_depth
maximum cascading call depth supported for foreign key constraint related delete/updates
Definition: que0que.h:292
que_node_get_next
UNIV_INLINE que_node_t * que_node_get_next(que_node_t *node)
Gets the next list node in a list of query graph nodes.
que_node_list_add_last
UNIV_INLINE que_node_t * que_node_list_add_last(que_node_t *node_list, que_node_t *node)
Catenates a query graph node to a list of them, possible empty list.